Function: indirect to call other Worksheet names ad a date in mmmm-yyyy format

Miki2

New Member
Joined
Apr 22, 2015
Messages
10
Hello,
I've looked for other reply regarding the use of this function. I tried many possible solutions but they don't work.

I have a dynamic Sheet (named as previous month, i.e. March-2015) and I need to do a vlookup with the previous sheet (e.i. February-2015).

I tried this function:
=VLOOKUP(B2;INDIRECT("$O$4"&"!B:B");1;0) - where O4 report the name February-2015. It doesn't work with Date (if I put Sheet2 instead, it works).

I also tried this function:
=VLOOKUP(B2;INDIRECT("'"&$O$4&"'!B:B");1;0) but it doesn't work either.

I'm looking for any possible way to make a vlookup with previous month (always in position 3 on the file).

Thank you!
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I think Andrew is onto the actual problem..

But It's worth nothing that in this formula
=VLOOKUP(B2;INDIRECT("$O$4"&"!B:B");1;0)
If your intention is to use the contents of the cell O4 as the name of the sheet, then O4 should NOT be in quote marks.
With $O$4 in quote marks, it will be looking for a sheet literally named "$O$4"

That should be
=VLOOKUP(B2;INDIRECT($O$4&"!B:B");1;0)
 
Upvote 0
I think Andrew is onto the actual problem..

But It's worth nothing that in this formula

If your intention is to use the contents of the cell O4 as the name of the sheet, then O4 should NOT be in quote marks.
With $O$4 in quote marks, it will be looking for a sheet literally named "$O$4"

That should be
=VLOOKUP(B2;INDIRECT($O$4&"!B:B");1;0)

Hello and thank you for your answer.
I've just put the formula in excel and returns #REF! :(
 
Upvote 0
Since ISNUMBER(O4) returned TRUE
That means it actually contains a DATE, but custom cell formatting made it show as FEBRUARY-2015

Try
=VLOOKUP(B2;INDIRECT(TEXT($O$4,"mmmm-yyyy")&"!B:B");1;0)
 
Upvote 0
Since ISNUMBER(O4) returned TRUE
That means it actually contains a DATE, but custom cell formatting made it show as FEBRUARY-2015

Try
=VLOOKUP(B2;INDIRECT(TEXT($O$4,"mmmm-yyyy")&"!B:B");1;0)

I also tried this earlier... because text returns me the right name... but if I use indirect, it doesn't work anymore and give me back #REF! too.

Are there any other possible way to do it?
 
Upvote 0

Forum statistics

Threads
1,216,124
Messages
6,128,987
Members
449,480
Latest member
yesitisasport

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