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.
Cell Formulas | ||
---|---|---|
Range | Formula | |
J6:J7 | J6 | =(IF(I6<=TODAY(),1,-1))*DATEDIF(MIN(TODAY(),I6), MAX(TODAY(),I6),"M") |
the months between two dates while also using the Today function
Book1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
22 | 1.15 | PHASE MAINTENANCE INSPECTION (PMI-1 & PMI-2) | TM 1-1520-237-23&P, WP0348 - 0354 | 48 | MONTH | 1-Feb-26 | 1-Feb-22 | 9 months, 29 days | |||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I22 | I22 | =DATEDIF(TODAY(), G22, "m") & " months, " & DATEDIF(TODAY(), G22, "md") & " days" |
According to this page. And a workaround is shown at the bottom of the page.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
Yeah you are right, (like Feb to Mar) can cause error, I checked it.Just a word of warning about "MD":
According to this page. And a workaround is shown at the bottom of the page.
Book1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
22 | 1.15 | PHASE MAINTENANCE INSPECTION (PMI-1 & PMI-2) | TM 1-1520-237-23&P, WP0348 - 0354 | 48 | MONTH | 1-Feb-26 | 1-Feb-22 | 9 months, 29 days | |||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I22 | I22 | =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?Yeah you are right, (like Feb to Mar) can cause error, I checked it.
Well, in that case OP can try this,
Book1
A B C D E F G H I 22 1.15 PHASE MAINTENANCE INSPECTION (PMI-1 & PMI-2) TM 1-1520-237-23&P, WP0348 - 0354 48 MONTH 1-Feb-26 1-Feb-22 9 months, 29 days Sheet2
Cell Formulas Range Formula I22 I22 =DATEDIF(TODAY(), G22, "m") & " months, " & G22 - EDATE(TODAY(), DATEDIF(TODAY(), G22, "m")) & " days"
I have other rows that I put this formula in and it works fine, it's just those 3 rows.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?
Please try this,I have other rows that I put this formula in and it works fine, it's just those 3 rows.
=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.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", ""))
they are rows 18-20I guess this is wrong, Can i have those three rows with the expected result to cross check.