Hi there. Been a while since I have been here with a problem.
I am looking to simplify a nasty 7-nested if that selects which worksheet to look at by just looking at a cell with the worksheet name in it instead. This is for a call center schedule, so there is a worksheet tab for each day of that production week.
Here's what I have right now:
Its ugly and next week I will have to go and manually change each of the sheet names in the formula since they are hardcoded.
I have a cell J17 on the Schedule Reader tab that reports what the name of the Worksheet we need to reference is:
For example: For today it returns MON 08.16, which is the name of the tab with Today's schedule on it.
So how do I eliminate the nested ifs and get just a single IFERROR(INDEX(MATCH()MATCH())) that correctly selects the tab to look at using the info in J17?
I am looking to simplify a nasty 7-nested if that selects which worksheet to look at by just looking at a cell with the worksheet name in it instead. This is for a call center schedule, so there is a worksheet tab for each day of that production week.
Here's what I have right now:
Excel Formula:
=IFERROR(IF($B$2="Monday",INDEX('MON 08.16'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'MON 08.16'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'MON 08.16'!$C$5:$CT$5,1)-1),IF($B$2="Tuesday",INDEX('TUE 08.17'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'TUE 08.17'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'TUE 08.17'!$C$5:$CT$5,1)-1),IF($B$2="Wednesday",INDEX('WED 08.18'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'WED 08.18'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'WED 08.18'!$C$5:$CT$5,1)-1),IF($B$2="Thursday",INDEX('THU 08.19'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'THU 08.19'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'FRI 08.20'!$C$5:$CT$5,1)-1),IF($B$2="Friday",INDEX('FRI 08.20'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'FRI 08.20'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'FRI 08.20'!$C$5:$CT$5,1)-1),IF($B$2="Saturday",INDEX('SAT 08.21'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'SAT 08.21'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'SAT 08.21'!$C$5:$CT$5,1)-1),IF($B$2="Sunday",INDEX('SUN 08.22'!$C$19:$CT$59,MATCH('Schedule Reader'!A5,'SUN 08.22'!$A$19:$A$59,0),MATCH('Schedule Reader'!E$1,'SUN 08.22'!$C$5:$CT$5,1)-1),"Day of Week Error"))))))),"Off")
Its ugly and next week I will have to go and manually change each of the sheet names in the formula since they are hardcoded.
I have a cell J17 on the Schedule Reader tab that reports what the name of the Worksheet we need to reference is:
Excel Formula:
=UPPER(TEXT(B1,"ddd"))&" "&TEXT(B1,"MM")&"."&TEXT(B1,"dd")
So how do I eliminate the nested ifs and get just a single IFERROR(INDEX(MATCH()MATCH())) that correctly selects the tab to look at using the info in J17?