Search code examples
excelif-statementnestedstatements

Error in a nested IF statement


I am trying to pull the daily schedule for each person on my team at work from another tab that has their schedule for the month so I can see who's working that day next to other stats I need to track for each person. To do this I am trying to write a nested IF statement but it isn't working and I can't figure out what I am doing wrong.

What I have so far:

=IF(AQ1="1-May",IF(AQ1="2-May",IF(AQ1="3-May",IF(AQ1="4-May",IF(AQ1="5-May",Schedules!B5,Schedules!D5,Schedules!F5,Schedules!H5),Schedules!J5),"")

But I just keep getting:

"You have too many arguments for this function"

And I haven't even added all the arguments I need yet (there will be 14 in total).

I know I am probably doing something very wrong, I just can't figure out what, any help would be greatly appreciated.


Solution

  • You forgot to close the parentheses in the correct order:

    =IF(AQ1="1-May",IF(AQ1="2-May",IF(AQ1="3-May",IF(AQ1="4-May",IF(AQ1="5-May",Schedules!B5,Schedules!D5),Schedules!F5),Schedules!H5),Schedules!J5),"")