Help Needed - How can you count number of days that falls on a specific month based on range of date

Occasional Contributor



Good day. I hope everyone is doing well during this time.


I need help if someone can show or suggest how I can count the number of days that falls on a specific month based on a range of dates, please see example table of the result that I am aiming;



Based on the table above, I need a formula or way how it will count the number of days that fall between January 2020 - December 2020 between the range stated in Column A (Start Date) and Column B (End Date).


I have attached the excel file I created hopefully someone can help me.


Thank you to all and apologies if ever I was not able to explain my issue clearly.





2 Replies

@ian_122282 Played around with your examples and came up with a perhaps not very elegant, but working solution. Note, I used a helper column D. It also allocates total duration to more than two months, if applicable. See attached.


@Riny_van_Eekelen thanks for providing a working solution.
This gives me now some idea of how this work and I'll try to make some improvements.