Using Worksheet Name as a variable in formula

  • Thread starter Thread starter Nano
  • Start date Start date
N

Nano

Hi guys,

I am taking a value from sheets using formula

=INDEX(Danemark!E2:E49,N10,1)

Where Danemark is the name of worksheet. I have different worksheets
with country names.

Can I use a variable (lets say column E2) instead of the name Danemark
and can choose an worksheet_name which I write in that particular
column E2.

I have tried using INDIRECT but I am not sure how to use it, kindly
help.

Thanking you in anticipation.

Best Regards,
Nano
 
Put "Danemark" (without the quotes) in E2, then you could use this:

=INDEX(INDIRECT("'"&E2&"'!E2:E49"),N10,1)

Note the use of the apostrophes to surround the sheet name in case you
have spaces in those names.

Just change the entry in E2 to select a different sheet.

Hope this helps.

Pete
 
Thanks mate, its working :)

Put "Danemark" (without the quotes) in E2, then you could use this:

=INDEX(INDIRECT("'"&E2&"'!E2:E49"),N10,1)

Note the use of the apostrophes to surround the sheet name in case you
have spaces in those names.

Just change the entry in E2 to select a different sheet.

Hope this helps.

Pete
 
Back
Top