# Indirect and vlookup - Date format worksheet name

#### tanvirabid3

##### New Member
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
44.4 KB · Views: 12

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### Fluff

##### MrExcel MVP, Moderator
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)``

#### tanvirabid3

##### New Member
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.

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
5
Views
122
Replies
18
Views
551
Replies
7
Views
162
Replies
9
Views
254
Replies
0
Views
110

1,186,743
Messages
5,959,507
Members
438,429
Latest member
Ekana99

### 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.

### Which adblocker are you using?

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

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