MrExcel Publishing
Your One Stop for Excel Tips & Solutions

how do I use a variable in a cell reference


Posted by Thom on December 29, 2001 4:10 PM

I need help creating a reference to a cell using a variable in the cell reference. For example, I have a cell (A1) with a number in it (58). I want another cell to reference column D and the row of the number mentioned above. Then as I change the value of A1 the reference changes. I have done this a few years ago and can not remember how. Any help will be greatly appreciated.

=D(A1)


Posted by Jim on December 29, 2001 4:36 PM

Hi Thom,

If i understand you correctly "absolute reference"

in d58, =Sum($A$1) w/ this whatever you put in a1
will go to d58

Jim

Posted by Russell Hauf on December 29, 2001 6:57 PM

Try this:

=INDIRECT("D" & A1)

This will give you the value in cell D58, if cell A1 has the number 58 in it.

Hope this helps,

Russell