DATEIF formula that makes errors and negatives 0

RayKIII

New Member
Joined
Feb 6, 2014
Messages
37
I am trying to create a formula that will give me the days between two dates. If that date is negative I would like for it to just show 0. If one of the dates is missing, instead of giving an error I would like for it to give a -. I have tried the ifferror and max formula options but I can't seem to get them to work together.

When I use =IFERROR(T3-O3,0) it shows the negative days if the one cell does not contain a date.

When I use =MAX(0,T6-O6) it gives the #VALUE! when one of the fields does not contain a date.

Is there a way to combine these two or another way to go?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Do columns T or O have a formula that returns ""
 
Upvote 0
The Max formula would not give an error if the cells were empty.
 
Upvote 0

Attachments

  • MAX.PNG
    MAX.PNG
    29.1 KB · Views: 6
Upvote 0
That's because you have text in col O, which you failed to mention. ;)
Try
Excel Formula:
=MAX(0,IFERROR(T6-O6,0))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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