Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Depending on the contents of two cells, I would like to include in a formula
a different variable name (already defined). The problem is, I would like to concatenate a given text together with the contents of those 2 cells to form the name of a specific variable. I have looked for a function which could do the trick (I mean, converting a string to a variable name), but apparently there is not one. Example: =Sum("Variable"&Q1&Q2) If Q1 = "A" and Q2 = "5", the formula should hipothetically return the sum of the cells referred by the variable named VariableA5. Unfortunately, it shows a VALUE error. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=INDIRECT(CONCATENATE(Q1,Q2))
Would return the contents of A5 in your example. Hope this helps! "Paulo" wrote: Depending on the contents of two cells, I would like to include in a formula a different variable name (already defined). The problem is, I would like to concatenate a given text together with the contents of those 2 cells to form the name of a specific variable. I have looked for a function which could do the trick (I mean, converting a string to a variable name), but apparently there is not one. Example: =Sum("Variable"&Q1&Q2) If Q1 = "A" and Q2 = "5", the formula should hipothetically return the sum of the cells referred by the variable named VariableA5. Unfortunately, it shows a VALUE error. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello
Use INDIRECT to build the variable range reference: =Sum(INDIRECT("Variable"&Q1&Q2,TRUE)) HTH Cordially Pascal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shortcut for referring to tab names in formulas | Excel Worksheet Functions | |||
Replace variable row number in formulas | Excel Discussion (Misc queries) | |||
Combining workbooks with some variable field names | Excel Discussion (Misc queries) | |||
Locking Sheet names in formulas | Excel Worksheet Functions | |||
Relative addressing using names or labels in formulas? | Excel Worksheet Functions |