Indirect and vlookup - Date format worksheet name

tanvirabid3

New Member
Joined
Oct 15, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
I am trying to pull data from different sheets using the INDIRECT FUNCTION. I am trying to get the data in the sheet called “Summary”. The data is the prices of various commodities in different sheets, for example 15 July, 8 July and so on. I rename the sheets 15 July as 5. In the 15 July sheet (renamed 5), the prices are in column D. Column A has the names i.e. PTA, Copper, steel etc. Now in the summary sheet, suppose I want the data of PTA on 15 July in cell F10. I use the following INDIRECT FORMULA. The formula works correctly and perfectly in this scenario:
=VLOOKUP($A10,INDIRECT("'"&F$1&"'!$A$1:$d$200"),MATCH(F$2,INDIRECT("'"&F$1&"'!$a$1:$F$1"),0),0)
Here in cell A10 is the word Copper, cell F1 is 5, A1:D200 = data in the source sheets; Cell F2 is the date i.e. 15-July-2022; A1:F1 in the source sheets is the column titles.

However, I am trying to use INDIRECT when the sheet name is a date i.e. 15-July-2022, the formula does not work. I adjust the formula like this:
=VLOOKUP($A10,INDIRECT("'"&(("'"&TEXT(F$2,"dd-mmm-yyyy"))&"'!")&"'!$A$1:$d$200"),MATCH(F$2,INDIRECT("'"&(("'"&TEXT(F$2,"dd-mmm-yyyy"))&"'!")&"'!$a$1:$F$1"),0),0)
I get #REF!
Not sure what am I doing wrong? Would appreciate if someone can help. I have also attached the screenshot.
 

Attachments

  • Mr. Excel indirect commodities.png
    Mr. Excel indirect commodities.png
    44.4 KB · Views: 22

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
How about
Excel Formula:
=VLOOKUP($A10,INDIRECT("'"&TEXT(F$2,"dd-mmm-yyyy")&"'!$A$1:$d$200"),MATCH(F$2,INDIRECT("'"&TEXT(F$2,"dd-mmm-yyyy")&"'!$a$1:$F$1"),0),0)
 
Upvote 0
Solution
How about
Excel Formula:
=VLOOKUP($A10,INDIRECT("'"&TEXT(F$2,"dd-mmm-yyyy")&"'!$A$1:$d$200"),MATCH(F$2,INDIRECT("'"&TEXT(F$2,"dd-mmm-yyyy")&"'!$a$1:$F$1"),0),0)
Thank you. This is fantastic.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,027
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top