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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

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