Dynamic sheet name doesn't work

xsmurf

Board Regular
Joined
Feb 24, 2007
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have the following code, and I am pretty sure it is correct.
Code:
=IFERROR(INDEX(INDIRECT("'" & $G$1 & "'!$B$4:$B$265"), SMALL(IF((INDEX(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"), 0, MATCH($B$3, INDIRECT("'" & $G$1 & "'!$I$3:$PH$3"), 0))<>"")*(INDEX(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"), 0, MATCH($B$3, INDIRECT("'" & $G$1 & "'!$I$3:$PH$3"), 0))<>"R")*(INDEX(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"), 0, MATCH($B$3, INDIRECT("'" & $G$1 & "'!$I$3:$PH$3"), 0))<>"C")*(INDEX(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"), 0, MATCH($B$3, INDIRECT("'" & $G$1 & "'!$I$3:$PH$3"), 0))<>"H")*(INDEX(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"), 0, MATCH($B$3, INDIRECT("'" & $G$1 & "'!$I$3:$PH$3"), 0))<>"F"), ROW(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"))-ROW(INDIRECT("'" & $G$1 & "'!$I$4")+1), ROW(1:1))), "")

Unfortunately excel does not accept the formula and says "something is wrong with the formula"
I can't see to figure out what the problem is.
Maybe it has to do that I use a reference to a cell to get the sheetname?

Cell G1 has the following code
Code:
="Vacations " &YEAR(B1)
Cell B2 has the following code
Code:
=TODAY()-WEEKDAY(TODAY(),2)+1

Hope some one can assist mey, thank you in advance.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
As you have 365 why not use the filter function
Excel Formula:
=LET(a,INDEX(INDIRECT("'" & $G$1 & "'!$I$4:$PH$265"), 0, MATCH($B$3, INDIRECT("'" & $G$1 & "'!$I$3:$PH$3"), 0)),FILTER(INDIRECT("'" & $G$1 & "'!$B$4:$B$265"), (a<>"")*(a<>"R")*(a<>"C")*(a<>"H")*(a<>"F"),""))
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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