helpneeded2
Board Regular
- Joined
- Jun 25, 2021
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
I have a table, that consists of a data related to several years. Each year has its own sheet of data. The sheet for each year, is just the name of the sheet. I have assigned a named ranged to the data in sheet and referenced is "table_YEAR", where-in the 2016 worksheet, the named range is "table_2016".
Now, in my main worksheet, I have a column listing the years from 2016 to 2020, and a row at the bottom labeled "Lifetime", which links to data in a worksheet called "Lifetime".
What I would like to do, is include in my VLOOKUP the ability to reference the appropriate sheet based on the value in the year column.
Example table:
Ideally I want to structure the lookup as follows -- this would be the formula in B2 and would be copied down and across unto C and all other following columns: =vlookup(customerNumber,INDIRECT("table_"&A1),2,0)
However when I try to do this I get an error, which I believe is due to me likely using indirect incorrectly?
Could someone please advise if it is possible to include an indirect reference in a lookup, when I am trying to combine a cell value with text.
Thank you.
Now, in my main worksheet, I have a column listing the years from 2016 to 2020, and a row at the bottom labeled "Lifetime", which links to data in a worksheet called "Lifetime".
What I would like to do, is include in my VLOOKUP the ability to reference the appropriate sheet based on the value in the year column.
Example table:
A | B | C | ||||
1 | 2016 | data 1 | data 2 | |||
2 | 2017 | data 1 | data 2 | |||
3 | 2018 | data 1 | data 2 | |||
4 | 2019 | data 1 | data 2 | |||
5 | 2020 | data 1 | data 2 | |||
6 | Lifetime | data 1 | data 2 |
Ideally I want to structure the lookup as follows -- this would be the formula in B2 and would be copied down and across unto C and all other following columns: =vlookup(customerNumber,INDIRECT("table_"&A1),2,0)
However when I try to do this I get an error, which I believe is due to me likely using indirect incorrectly?
Could someone please advise if it is possible to include an indirect reference in a lookup, when I am trying to combine a cell value with text.
Thank you.