 # 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

This should do what you need:

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

• 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

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]

• 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

• 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?

• Re: Combine if statement with 3 different return

I didn't think it was, but according to Microsft it is only available to Office online users with the latest version of office installed. Wouldnt be be hard to recreate it in a UDF though using the Switch() syntax in VBA