I have two dates, how do I count the number of days in a particular month?

VladaRonzak

New Member
Joined
Jan 16, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
My data has a start start in Col A and an End date in Col B, how do, for example, count how many days are in January (or any month based on a selection criteria) between the two dates?

Start date End date Formula
12/12/22 21/01/23 = 21
12/12/22 03/03/23 = 31
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
If dates were 1/10/2022 and 2/28/2022 then perhaps
=IF(B14-B13>31,31,B14-B13)

where 31 is the number of days in January. To be more flexible you'd need to know the number of days in the month in question.
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,287
Members
448,562
Latest member
Flashbond

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top