# Nested If and TODAY() in One Formula

1. ## Nested If and TODAY() in One Formula

Hello. I have to make a formula with a nested if function using either a date given in the cell or today's date if a cell is blank.

=IF(B5<>"",IF(B5-A5<=14,"Fast",IF(B5<>"",IF(B5-A5<=45,"Regular",IF(B5<>"",IF(B5-A5<=90,"Slow",IF(B5<>"",IF(B5-A5>91,"Problem"),IF(TODAY()-A5<=15,"Fast",IF(TODAY()-A5<=45,"Average",IF(TODAY()-A5<=90,"Slow",IF(TODAY()-A5>91,"Problem")))))))))))

In cell b is either a blank cell or the given date. In cell A is the date it was made.
I cannot figure out the problem in the formula, however, as it is coming up false for the days which cell B was blank when it should be using today's date.
Any help would be appreciated. Thank you.  Register To Reply

2. ## Re: Nested If and TODAY() in One Formula

welcome to the forum. since your formula doesn't work, you ought to tell us how the logic goes. what should be the answers in column c? and i noticed if B5 is not equals to blank, then <=14 is fast? but if it's blank, <=15 is fast? if it's really two different values, maybe:
=IF(B5="",LOOKUP(TODAY()-A5,{0,15,46,91},{"Fast","Regular","Slow","Problem"}),LOOKUP(B5-A5,{0,14,46,91},{"Fast","Regular","Slow","Problem"}))

if both are supposed to be <=15, then
=LOOKUP(IF(B5="",TODAY(),B5)-A5,{0,15,46,91},{"Fast","Regular","Slow","Problem"})  Register To Reply

3. ## Re: Nested If and TODAY() in One Formula

Hi,

I have modified your initial formula as following, please check if it works:

=IF(B5<>"",IF(B5-A5<=14,"Fast",IF(B5-A5<=45,"Regular",IF(B5-A5<=90,"Slow",IF(B5-A5>91,"Problem")))),(IF(TODAY()-A5<=15,"Fast",IF(TODAY()-A5<=45,"Average",IF(TODAY()-A5<=90,"Slow",IF(TODAY()-A5>91,"Problem"))))))  Register To Reply

4. ## Re: Nested If and TODAY() in One Formula

Thank you for the greeting and your response.
It should have been <=15, not less than <=14 so what was a typo by me.
In cell C, if the date after the subtraction is 15 or less days, it should be "fast", 16-45 for "regular" and so on.
Your Formula works for the correct result so thank you.
However, is your formula using "nested if"? And if not, is there a way to get the same results using nested if along with using the today function?
Thank you.  Register To Reply

5. ## Re: Nested If and TODAY() in One Formula

does this work ?
=IF(B5<>"", IF(B5-A5<=14,"Fast", IF(B5-A5<=45,"Regular", IF(B5-A5<=90,"Slow", IF(B5-A5>91,"Problem", "not in range" )))),IF(TODAY()-A5<=15,"Fast", IF(TODAY()-A5<=45,"Average",IF(TODAY()-A5<=90,"Slow",IF(TODAY()-A5>91,"Problem", "not in range")))))  Register To Reply

6. ## Re: Nested If and TODAY() in One Formula

This formula works perfectly and is "nested if". Thank you cbatrody! Also, thank you etaf for your response and once again you Beni for your initial response.  Register To Reply