Generating a DATEDIF value of "0" when the EndDate is in the past and then using in IF formula

08730000000BrGM

New Member
Joined
Feb 21, 2019
Messages
17
Hello!

I am trying to use a DATEDIF formula to calculate a number that is then used to in an IF formula to generate a score. The issues is that for some of the DATEDIF calculations the EndDate is before the StartDate. When this happens, I have the formula generate a "0". I then use the outcome of the DATEDIF for an IF formula but when the outcome is "O" the IF formula doesn't work properly.

(DATEDIF Formula) =IF(AI5="","NO ONBOARDING DATA",(IFERROR(DATEDIF(T5,AI5,"d"),"0")))

(IF Formula) =IFERROR(IF(AJ5="","0.00",IF(AJ5<=7,"0.05",IF(AJ5<=14,"0.04",IF(AJ5<=21,"0.03",IF(AJ5<=365,"0.01",IF(AJ5>365,"0.00")))))),"0")

Why won't the "0" be considered in the IF(AJ5<=7,"0.05"??? How can I fix this so that all situations where the EndDate is in the past, the IF formula results in "0.05"?

Thank you! :)
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
in the IFERROR () you have "0" - thats a text zero
change to just 0
(DATEDIF Formula) =IF(AI5="","NO ONBOARDING DATA",(IFERROR(DATEDIF(T5,AI5,"d"),0)))
Now the zero is a number and NOT text
again here
=IFERROR(IF(AJ5="","0.00",IF(AJ5<=7,"0.05",IF(AJ5<=14,"0.04",IF(AJ5<=21,"0.03",IF(AJ5<=365,"0.01",IF(AJ5>365,"0.00")))))),"0")
you have "" inverted commas around a number - remove them ,
 
Upvote 0

Forum statistics

Threads
1,214,635
Messages
6,120,660
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top