Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 68
Default Counting Days of Week in Date Ranges

In Col A I have a series of start dates and in Col B a series of end dates.

In cell D2 I am trying to calculate the number of Mondays in total across
the date ranges so something like
=INT((B3-WEEKDAY(B3+1-2)-A3+8)/7)+INT((B4-WEEKDAY(B4+1-2)-A4+8)/7)+INT((B5-WEEKDAY(B5+1-2)-A5+8)/7)

This formula works OK, as do others, where I actually have 3 date ranges but
sometimes there are more or less ranges so I need a formula (preferably not
an array formula) that doesn't return an error if say there are only dates in
1 or 2 rows. As this is part of a much bigger piece of work I can't change
the formula to suit the number of date ranges.

Any ideas would be appreciated.

Many thanks

Kewa
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Counting Days of Week in Date Ranges

Use a column of formulas, one for each row, of the form

=IF(B3<"",INT((B3-WEEKDAY(B3+1-2)-A3+8)/7),"")

and then sum those....

HTH,
Bernie
MS Excel MVP


"nospaminlich" wrote in message
...
In Col A I have a series of start dates and in Col B a series of end dates.

In cell D2 I am trying to calculate the number of Mondays in total across
the date ranges so something like
=INT((B3-WEEKDAY(B3+1-2)-A3+8)/7)+INT((B4-WEEKDAY(B4+1-2)-A4+8)/7)+INT((B5-WEEKDAY(B5+1-2)-A5+8)/7)

This formula works OK, as do others, where I actually have 3 date ranges but
sometimes there are more or less ranges so I need a formula (preferably not
an array formula) that doesn't return an error if say there are only dates in
1 or 2 rows. As this is part of a much bigger piece of work I can't change
the formula to suit the number of date ranges.

Any ideas would be appreciated.

Many thanks

Kewa



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting 45 days from a certain date Sanjeev Raghavan[_2_] Excel Discussion (Misc queries) 2 April 5th 08 03:54 AM
Re Change 5 week days to 7 days in this formula pano Excel Worksheet Functions 7 February 1st 07 04:20 PM
5 days week date (mon to fri) chiuinggum Excel Worksheet Functions 1 June 11th 06 01:21 AM
Counting Cells with certain date ranges as values audreyglennette Excel Worksheet Functions 12 May 4th 06 12:21 AM
I need week number in excell from a date, first week must be mini. jPeich Excel Discussion (Misc queries) 4 January 5th 05 01:21 AM


All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"