In the attached sheet currently is calculating a 3% match for employee 401K contributions in cell F5, I need to change this calculation to a 3% match if column CYOS is 5 years or less, a 6% match if column CYOS is between 5 to 10 years, and a 9% match if column CYOS is 10 years or more Book1.xlsx
Did both occurrences of the 3% in the original formula need changing to variable rate? My suggestion did that but can easily change it so that it doesn't.
Saqib Husain
Rob, your two formulas give different values at 5 and 10.
Rob Henson
Nested IF might need tweaking to be >= rather than just >
Actually, the nested if is giving results as per the question. The vlookup is different.
Rob Henson
Maybe need some clarity from Tom as to what happens when exactly 5 or 10 years. Question says "5 or less" and "between 5 and 10" and "10 or more".
Tom Moholland
ASKER
The occurrence of us having an employee at exactly 5 or 10 years the day we run this calculation would be high unlikely, additionally it is done quarterly after the fact so I think it's relevant. Both solutions work for what I am doing thank you both
However low the probability is, there always exists the possibility that such an instance exists where this happens exactly. So you must know your criteria otherwise you might have to face some noise.
Rob Henson
If the criteria is
>0 = 3%
>5 = 6%
>10 = 9%
The original nested IF matches those criteria. For the lookup change the left hand column to
0
5.0000001
10.000001
The decimal fraction is less than 1 day 1/365 = 0.00274 so will cover the difference that one day could make to the calcs.
If the criteria is:
<5 = 3%
5 -9.999 = 6%
10+ = 9%
Original lookup table is correct, formula with >= is correct.