Writing a formula in a variable

C

Chris Dunigan

Hi, hope someone out there can help me with this problem.

I have a simple formula:

=CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1,7,1)
"A","Activity","List"))))

and i'd like that formula to be contained in a variable so that i can
use the formula on many worksheets within a workbook.

The problem that i'm coming across is to do with all the quotation
marks. Excel won't let me simply write:

formula1 = CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1,7,1)
"A","Activity","List"))))

Dows anyone have any suggestions about how to overcome this - maybe by
splitting the formula up into smaller components???


any helps greatly apprecieted.

chris
 
T

Tom Ogilvy

formula1 = "CONCATENATE((MID(A1,4,3)),""_"",C1,""_"",((IF(MID(A1,7,1)
""A"",""Activity"",""List""))))"

Regards,
Tom Ogilvy
 
T

Tom Ogilvy

Just to add.
I showed you how to set up the string you showed - I am not sure the string
you showed is a valid formula, but you should be able to adapt what I
provided.
 
C

Chris Dunigan

Tom,

You're right - my formula was slightly wrong, but have tweaked it and
you're suggestion works perfectly.

Many Thanks,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top