Combine if statement with 3 different return

  • Trying to combine below statement, appreciate assistance...


    IF(OR(C5="",I5=""),"",IF(OR(WEEKDAY(C5)=7,WEEKDAY(C5)=1),"",IF(I5="F",7,5)))
    IF(OR(C5="",I5=""),"",IF(AND(WEEKDAY(C5)<>7,WEEKDAY(C5)<>1),"",IF(I5="F",7,6)))


    A part timer work on weekday (Mon - Fri) will be pay 5 and 6 on weekend (Sat and Sun), whereas a full timer will be pay 7 either weekend or weekday.

  • Re: Combine if statement with 3 different return


    Quote from S O;771542

    This should do what you need:


    =IF(OR(C5="",I5=""),"",IF(I5="F",7,SWITCH(WEEKDAY(C5),7,6,1,6,5)))


    The result return with "#NAME?"

  • Re: Combine if statement with 3 different return


    Quote from S O;771565

    The formula is tested and worked fine, it must be the data. Of course, that can't be confirmed without seeing an example.


    [sw]*[/sw]


    Attached is the file.

    Files

    • Book1.xlsx

      (9.83 kB, downloaded 83 times, last: )
  • Re: Combine if statement with 3 different return


    Quote from S O;771542

    This should do what you need:


    =IF(OR(C5="",I5=""),"",IF(I5="F",7,SWITCH(WEEKDAY(C5),7,6,1,6,5)))


    Is SWITCH a new 2016 function?