Hello all, I have a formula that works fine as it is now, but my company went and changed the criteria so I need to add more levels to this formula. Basically, in Cell M1 is the hire date and Cell M2 is the status which is always Part Time or Full Time. Right now the formula uses the date as a number to calculate the number of vacation hours earned (I.E. if they've been there more than 15 years and they're full time they it calculates 200 hours).
But I'm needing to add another level where if they where hired before April 30th of the current year they get 80 hours, if hired between May 1st and August 31st they get 40 hours and after September 1st they get 0. The formula below works fine but I'm not sure how to add the extra checks into the IF statement.
Note: The formula is all written as one line in the excel FX box, I just broke it into single lines cause I thought it would be easier to read.
Any help is greatly appreciated.
But I'm needing to add another level where if they where hired before April 30th of the current year they get 80 hours, if hired between May 1st and August 31st they get 40 hours and after September 1st they get 0. The formula below works fine but I'm not sure how to add the extra checks into the IF statement.
Note: The formula is all written as one line in the excel FX box, I just broke it into single lines cause I thought it would be easier to read.
Any help is greatly appreciated.
Code:
=IF(ISBLANK(M1),0,
IF(AND(M2="Part Time",M1<(TODAY()-5475)),137,
IF(AND(M2="Part Time",M1<(TODAY()-2555)),104,
IF(AND(M2="Part Time",M1<(TODAY()-1825)),80,
IF(AND(M2="Part Time",M1<(TODAY()-1)),48,
IF(AND(M2="Full Time",M1<(TODAY()-5475)),200,
IF(AND(M2="Full Time",M1<(TODAY()-2555)),160,
IF(AND(M2="Full Time",M1<(TODAY()-1825)),120,
IF(AND(M2="Full Time",M1<(TODAY()-1)),80,0
)))))))))
'or the correct way:
=IF(ISBLANK(M1),0,IF(AND(M2="Part Time",M1<(TODAY()-5475)),137,IF(AND(M2="Part Time",M1<(TODAY()-2555)),104,IF(AND(M2="Part Time",M1<(TODAY()-1825)),80,IF(AND(M2="Part Time",M1<(TODAY()-1)),48,IF(AND(M2="Full Time",M1<(TODAY()-5475)),200,IF(AND(M2="Full Time",M1<(TODAY()-2555)),160,IF(AND(M2="Full Time",M1<(TODAY()-1825)),120,IF(AND(M2="Full Time",M1<(TODAY()-1)),80,0)))))))))