Variable Names in Formulas

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
=INDIRECT(CONCATENATE(Q1,Q2))

Would return the contents of A5 in your example.

Hope this helps!
 
Hello
Use INDIRECT to build the variable range reference:
=Sum(INDIRECT("Variable"&Q1&Q2,TRUE))

HTH
Cordially
Pascal
 

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

Similar Threads

Formula IF 1
reference to an external file 6
Sumproduct formula 3
SUMPRODUCT Formula 6
SUMIF with VLOOKUP nested 4
VLOOKUP - TWO Variables 4
Complex Pivot Table Function 1
Sum Formula with variable range 2

Back
Top