Calculate Negative Dates

erinm2022

New Member
Joined
Mar 8, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I'm using the DATEDIF function to show total years and months between two dates: =DATEDIF(I7,K7,"y")&" years, "&DATEDIF(I7,K7,"ym")&" months"

I then want to calculate the remaining years and months from the report date. I've done this by adding a column of report date and using the same function: =DATEDIF(L7,K7,"y")&" years, "&DATEDIF(L7,K7,"ym")&" months"

Problem is when it calculates negatively, I receive the #NUM! error. I do want to show the negative calculation to show how overdue it is.

Thanks in advance.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Welcome to the Board!

Problem is when it calculates negatively, I receive the #NUM! error. I do want to show the negative calculation to show how overdue it is.
Flip around the order of columns K and L in your DATEDIF calculations to get a positive value.
Since you are building a string by concatenating these all together, you can add the negative (or whatever else you want) right in the formula, i.e.
="-" & DATEDIF(K7,L7,"y") & " years, " & DATEDIF(K7,L7,"ym") & " months"
 
Upvote 0
Hi Erinm2022
Excel wont every display a negitive date, it will always be either ######## or #NUM! error
I would have an anchor year and work out the difference from there
Excel Formula:
=DATEDIF(1/1/1900,K7,"y")-DATEDIF(1/1/1900,I7,"y")&" years, "&DATEDIF(1/1/1900,K7,"ym")-DATEDIF(1/1/1900,I7,"ym")&" months"
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,717
Members
449,332
Latest member
nokoloina

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