Writing a formula in a variable

  • Thread starter Thread starter Chris Dunigan
  • Start date Start date
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
 
formula1 = "CONCATENATE((MID(A1,4,3)),""_"",C1,""_"",((IF(MID(A1,7,1)
""A"",""Activity"",""List""))))"

Regards,
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.
 
Tom,

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

Many Thanks,
Chris
 
Back
Top