LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default WeekDay count between dates

On Fri, 25 Apr 2008 07:13:05 -0700, Andy
wrote:

I have a number of records and each has a field of start and end dates. What
I need to work out is how I can count for each day of the week, how many days
are included in this date range (excluding the last date).

i.e.

Start: 01/04/2008
End: 12/04/2008.

Monday = 1
Tuesday = 2
Wednesday = 2
Thursday = 2
Friday = 2
Saturday = 1
Sunday = 1


In general:

=INT((A2-WEEKDAY(A2+1-DOW)-A1+8)/7)

where DOW = 1 for Sunday; 2 for Monday; etc.

This formula assumes the starting date (A1) and ending date (A2) are both to be
considered. In your example, however, you are not counting the Last Date (you
only have one Saturday -- 05/04/2008; and you are not counting 12/04/2008). So
you will need to modify the formula slightly so as not to include that last
date, by subtracting one from each occurrence of A2:

=INT(($A$2-1-WEEKDAY($A$2-C1)-$A$1+8)/7)

--ron
 
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
prompt for weekday and distribute the dates in columns deepika :excel help[_2_] Excel Discussion (Misc queries) 6 February 4th 08 11:06 AM
count weekday()=1 dribler2 Excel Worksheet Functions 13 December 30th 06 01:25 PM
WEEKDAY() function: display TEXT not numeric weekday tom Excel Discussion (Misc queries) 3 November 21st 06 04:32 PM
How can I calculate dates and skip a specific weekday? Excelman Excel Discussion (Misc queries) 6 September 6th 06 02:47 AM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM


All times are GMT +1. The time now is 12:38 AM.

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"