# cell reference based on value in another cell

I think this should be easy, but I can't figure out quite how to do it.

Here is a simple representation

A     B     C     D     E
1   2                   2
2   4
3   6
4
5
6    x
In the cell A6 I need a function that returns the value in A1, A2 or A3 depending on the value of the relevant row in D1.

eg If D1 = 1 A6 is the value in A1.  If D1 = 3 A6 is the value in A3. etc

What is the easiest way of indicating a row reference based on the value in a given cell?

Best regards

Richard
###### Who is Participating?

Commented:
=INDEX(A1:A5,D1)
should work.
0

Commented:
Try this formula:
=OFFSET(A1,D1-1,0)
0

EngineerCommented:
or

=indirect("A"&D1)
0

Author Commented:
Thanks for the input.  All three solutions are clear and do the job.  I just chose one of course - shared points equally.

Regards

Richard
0

EngineerCommented:
Which one? ;-)

Thanks for the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.