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 only in november. (result 14 days, because "day 17" is included).

Do you know a way or formula which can calculate that ? 

Thanks for your support, 


2 Replies



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



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.



suppose we enter the date 17/11/2022 in cell A2. Enter below formula in cell B2.


Make sure you set the format of cell B2 as Number with 0 decimal places.