Variable formula

F

fabian

I have the following formula in cell A2 in worksheet "MainSheet":

HLOOKUP("Weight",sheet1!A1:C10,5,FALSE)

I also have in "MainSheet" a cell that contain a list with the names of
other worksheets; i.e., in cell A1 I can select "sheet1", "sheet2" or
"sheet3".

I need the formula above to change the reference to "sheet1" to the
worksheet I select in cell A1; in other words, the formula in A2 will
change its reference depending on what I select in cell A1.

How can I do this?
Thanks.
 
B

Bob Phillips

=HLOOKUP("Weight",INDIRECT("'sheet1'!"&A1&":C10"),5,FALSE)


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
R

Roger Govier

I think Bob meant to type

=HLOOKUP("Weight",INDIRECT(A1&"!A1:C10"),5,FALSE)

Regards

Roger Govier
 

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