Reference Sheets in a Vlookup

T

Thomas Roos

I have the following Vlookup formula

=ROUND(IFERROR(VLOOKUP($D196,'000-00'!$A$13:$AL$200,F$1,FALSE),0),0)

I want to have '000-00' change based on combining two cells.
My worksheet has 100 plus sheets and want to be able to reference the sheet
location based on two other cells.
Is there a way to do this?

thanks
 
V

vezerid

If K1 and L1 have the two components 000 and 00 then

=ROUND(IFERROR(VLOOKUP($D196,INDIRECT("'"&K1&"-"&L1&"'!$A$13:$AL
$200"),F$1,FALSE),0),0)

HTH
Kostis Vezerides
 
T

T. Valko

Try this...

Since Excel doesn't like strings of zeros you'd have to format these cells
as TEXT or precede the entry with an apostrophe unless the zeros are just
placeholders.

A1 = 000
A2 = 00

=ROUND(IFERROR(VLOOKUP($D196,INDIRECT("'"&A1&"-"&A2&"'!A13:AL200"),F$1,0),0),0)
 
S

Sheeloo

=INDIRECT("'"&A1&"-"&B1&"'!$A$13:$AL$200") instead of '000-00'!$A$13:$AL$200
in your formula below, iIf you want to look in A1 and B1 to construct your
sheet name.

Basically construct a string which returns the address you want and put
that inside INDIRECT...
 
T

T. Valko

=INDIRECT("'"&A1&"-"&B1&"'!$A$13:$AL$200")

To save a couple of keystrokes you can remove the $ from $A$13:$AL$200.

Since INDIRECT evaluates this as a text string that reference will never
change if the formula is copied. So:

=INDIRECT("'"&A1&"-"&B1&"'!A13:AL200")

"'!A13:AL200" is treated as an absolute reference.
 

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