Counting down the difference between two date using today function

bamacwby

New Member
Joined
Sep 27, 2008
Messages
44
Office Version
  1. 365
I am trying to figure out a way to countdown the months between two dates while also using the Today function. Here is the sheet that I'm trying to use for the result to show up in cell I22. I can't figure it out, I'm at a loss. Thanks for any help.


1743686391029.png
 
datedif() is a function that gives the number of complete months between 2 dates:
Book1
IJ
601.06.202410
701.06.2026-13
Sheet1
Cell Formulas
RangeFormula
J6:J7J6=(IF(I6<=TODAY(),1,-1))*DATEDIF(MIN(TODAY(),I6), MAX(TODAY(),I6),"M")

But I am not sure exactly what you want to calculate.
What do you mean by:
the months between two dates while also using the Today function
 
Upvote 0
Or Something like this,
Book1
ABCDEFGHI
221.15PHASE MAINTENANCE INSPECTION (PMI-1 & PMI-2)TM 1-1520-237-23&P, WP0348 - 035448MONTH1-Feb-261-Feb-229 months, 29 days
Sheet2
Cell Formulas
RangeFormula
I22I22=DATEDIF(TODAY(), G22, "m") & " months, " & DATEDIF(TODAY(), G22, "md") & " days"
 
Upvote 0
Just a word of warning about "MD":
The "MD" argument may result in a negative number, a zero, or an inaccurate result. If you are trying to calculate the remaining days after the last completed month
According to this page. And a workaround is shown at the bottom of the page.
 
Upvote 0
Just a word of warning about "MD":
According to this page. And a workaround is shown at the bottom of the page.
Yeah you are right, (like Feb to Mar) can cause error, I checked it.
Well, in that case OP can try this,
Book1
ABCDEFGHI
221.15PHASE MAINTENANCE INSPECTION (PMI-1 & PMI-2)TM 1-1520-237-23&P, WP0348 - 035448MONTH1-Feb-261-Feb-229 months, 29 days
Sheet2
Cell Formulas
RangeFormula
I22I22=DATEDIF(TODAY(), G22, "m") & " months, " & G22 - EDATE(TODAY(), DATEDIF(TODAY(), G22, "m")) & " days"
 
Upvote 0
Yeah you are right, (like Feb to Mar) can cause error, I checked it.
Well, in that case OP can try this,
Book1
ABCDEFGHI
221.15PHASE MAINTENANCE INSPECTION (PMI-1 & PMI-2)TM 1-1520-237-23&P, WP0348 - 035448MONTH1-Feb-261-Feb-229 months, 29 days
Sheet2
Cell Formulas
RangeFormula
I22I22=DATEDIF(TODAY(), G22, "m") & " months, " & G22 - EDATE(TODAY(), DATEDIF(TODAY(), G22, "m")) & " days"
that formula worked great for 48 months. I tried the same formula for rows 18, 19, 20 and got a number error (#NUM!) what can I do to fix this?
 
Upvote 0
that formula worked great for 48 months. I tried the same formula for rows 18, 19, 20 and got a number error (#NUM!) what can I do to fix this?
I have other rows that I put this formula in and it works fine, it's just those 3 rows.
 
Upvote 0
I have other rows that I put this formula in and it works fine, it's just those 3 rows.
Please try this,
Excel Formula:
=LET(d, G22 - TODAY(), m, DATEDIF(MIN(G22, TODAY()), MAX(G22, TODAY()), "m"), r, ABS(d - (m * 30)), m & " months, " & r & " days" & IF(d<0, " ago", ""))
 
Last edited:
Upvote 0
Please try this,
Excel Formula:
=LET(d, G22 - TODAY(), m, DATEDIF(MIN(G22, TODAY()), MAX(G22, TODAY()), "m"), r, ABS(d - (m * 30)), m & " months, " & r & " days" & IF(d<0, " ago", ""))
I guess this is wrong, Can i have those three rows with the expected result to cross check.
 
Upvote 0

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