Forum Discussion
CamilleER
Dec 09, 2022Copper Contributor
Number of days in a month - between two dates
Hi ! I need some help to easily calculate a number of days in a particular way. For example: I have a period, let's say from 17/11/2022 to 18/12/2022. I would like to know how many days there is...
mathetes
Dec 09, 2022Gold Contributor
I have no doubt that there's a more elegant way to do it, but here's a formula that will work for any given date, telling you how many days are left in the month of that given date.
So enter the date 11/17/22 in cell A1
and in some other cell enter this formula
=DATE(YEAR(A1),MONTH(A1)+1,1)-A1
If you're curious, this finds the first day of the next month--in this case 12/1/22--and subtracts the date in A1 from that date, to yield 14.