dynamic values formula

M

mwc0914

I don't even know if the Title is accurate to reflect what I need to
ask...

Assume cell A1 contains the value 1, and cell A2 contains the value 2.
Assume cell B1 contains the value "a" and cell B2 contains the value
"b"

Let's say I want to put a formula in cell C1 that says it is equal to
the value in column B, and the value contained in cell A2, thus
returning a value of "b" in cell C1. Would the formula in C1 look
something like =C[a2] ?

Thanks
 
M

MrShorty

It won't look like that. I'm not sure what you want the cell C1 to
return. The formula =B2 in C1 would return the value "b" to C1, if
that's what you want.
 
M

mwc0914

I mis-typed my original post...

Would the fornula in C1 look like =B[a2] thus returning a value of
"b".

Basically I want to get the value of a cell in column B, but the row
with the value to return is dependent on the value stored in the cells
in column A.

Also think that the row with the value to be returned could be stored
in a variable, so how do I write a formula in VB so that I can copy a
value from column B, row (value contained in a variable) and store ii
in cell C1?

Thanks
 
M

MrShorty

Still not quite understanding exactly what you want. Seems like you are
trying to describe a lookup table. If I put the numbers 1-26 in column
A, and the letters a-z in column B I have a lookup table. In C1 I can
put a number from 1-26, and in D1 I put the formula
=VLOOKUP(c1,$A$1:$B$26,2) and I can return the -n-th letter of the
alphabet where n is input in c1.

Is that something like what you're trying to do??
 
D

Dave Peterson

try
=indirect("B" & a2)


I mis-typed my original post...

Would the fornula in C1 look like =B[a2] thus returning a value of
"b".

Basically I want to get the value of a cell in column B, but the row
with the value to return is dependent on the value stored in the cells
in column A.

Also think that the row with the value to be returned could be stored
in a variable, so how do I write a formula in VB so that I can copy a
value from column B, row (value contained in a variable) and store ii
in cell C1?

Thanks
 

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