Inserting a formula that returns the number of days left in a month
Insert the following formula into a cell:
DATEDIF(TODAY(),EOMONTH(A1,-1),"D")
So, if today's date is March 9, 2025, the formula returns 22.
MacBook Air 13″, macOS 15.3
Insert the following formula into a cell:
DATEDIF(TODAY(),EOMONTH(A1,-1),"D")
So, if today's date is March 9, 2025, the formula returns 22.
MacBook Air 13″, macOS 15.3
Are you sure your formula works?
If A1 is March 9, 2025 then EOMONTH(A1,-1) gives you February 28 not March 31 and DATEDIF will give an error because the first date is later than the second. You need to change the -1 to a 0.
Your formula uses TODAY() in part of it and a reference to cell A1 in another part. The formula (after changing the -1 to a 0) will give you the correct answer as long as A1 is in the same month as TODAY, but not otherwise. Why not use A1 in both places or TODAY() in both places?
=DATEDIF(TODAY(),EOMONTH(TODAY(),0),"D")
Are you sure your formula works?
If A1 is March 9, 2025 then EOMONTH(A1,-1) gives you February 28 not March 31 and DATEDIF will give an error because the first date is later than the second. You need to change the -1 to a 0.
Your formula uses TODAY() in part of it and a reference to cell A1 in another part. The formula (after changing the -1 to a 0) will give you the correct answer as long as A1 is in the same month as TODAY, but not otherwise. Why not use A1 in both places or TODAY() in both places?
=DATEDIF(TODAY(),EOMONTH(TODAY(),0),"D")
This returns this number of days left in the current month.
=DAY(EOMONTH(TODAY(),0))−DAY(TODAY())
Yes, BADUNIT, yours is the correct one. After experimenting with mine, I ended up using what turned out to be the same as yours:
DATEDIF(TODAY(),EOMONTH A1,0),"D")
This returns the integer 22 on the 9th of March.
Thanks
Thanks, I'll give it a try in the morning. I am the author of the other formula and it works. I'll look at this one too just for curiosity's sake.
Pierre Blais
Or use xtzws's formula
I'm Pierre Blais and not EnaChaCha. We somewhat got confused. I'm the author of the last formula, same as BADUNIT's.
Inserting a formula that returns the number of days left in a month