I have a month, let's say:
April 2014
I have a date range, let's say:
2014-04-20 - 2015-05-13
How can I calculate the number of days in that date range that are also in the specified month?
I have a month, let's say:
April 2014
I have a date range, let's say:
2014-04-20 - 2015-05-13
How can I calculate the number of days in that date range that are also in the specified month?
Which cells are all those dates in?
Suggest you post a sample workbook.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
I take it that you mean the number of days within the range of dates specified.
If the start date is in A1 and the end date is in B1, in C1 enter:
Formula:
Please Login or Register to view this content.
In D1 enter:
Formula:
Please Login or Register to view this content.
If there are more than 2 consecutive months involved then this becomes more complicated.
<---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.Ron W
Please see attached file.
In C2 format cell as Custom "mmm-yyy"
=IF(ROWS($C$2:C2)>DATEDIF($A$2,$B$2,"M")+2,"",IF(EOMONTH($A$2,ROWS($A$2:A2)-1)>$B$2,$B$2,EOMONTH($A$2,ROWS($A$2:A2)-1)))
In D2
=IF(C2="","",DATEDIF($A$2,$B$2,"d")-DATEDIF(C2,$C$15,"D")-SUM($D$1:D1))
Format cell as General
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Thank you for the feedback!
Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks