Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Number of Specific Day within Dates

On Jun 29, 6:51*am, Abdul wrote:
Hi,

Is there a way to find how many Day (eg. wednesdays) within a a date
range?

Like how many Wednesdays (any given Day) falling between June 1, 2009
Till June 21, 2009

Thanks,


Let's say that you have a sheet set up like this, A2 shows your start
date, B2 shows your end date, and C2 though I2 will have the count of
Sundays through Saturdays, try this formula in C2 through I2:

=FLOOR(($B2-$A2+1)/7,1)+IF(($B2-$A2+1)/7FLOOR(($B2-$A2+1)/7,1),IF
(WEEKDAY($B2)=WEEKDAY($A2),IF(AND(WEEKDAY($B2)=C OLUMN()-2,COLUMN
()-2=WEEKDAY($A2)),1,0),IF(OR(AND(COLUMN()-2<=WEEKDAY($A2),COLUMN
()-2<=WEEKDAY($B2)),AND(COLUMN()-2=WEEKDAY($A2),COLUMN()-2=WEEKDAY
($B2))),1,0)),0)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Number of Specific Day within Dates

On Thu, 2 Jul 2009 07:24:17 -0700 (PDT), zxcv wrote:

On Jun 29, 6:51*am, Abdul wrote:
Hi,

Is there a way to find how many Day (eg. wednesdays) within a a date
range?

Like how many Wednesdays (any given Day) falling between June 1, 2009
Till June 21, 2009

Thanks,


Let's say that you have a sheet set up like this, A2 shows your start
date, B2 shows your end date, and C2 though I2 will have the count of
Sundays through Saturdays, try this formula in C2 through I2:

=FLOOR(($B2-$A2+1)/7,1)+IF(($B2-$A2+1)/7FLOOR(($B2-$A2+1)/7,1),IF
(WEEKDAY($B2)=WEEKDAY($A2),IF(AND(WEEKDAY($B2)= COLUMN()-2,COLUMN
()-2=WEEKDAY($A2)),1,0),IF(OR(AND(COLUMN()-2<=WEEKDAY($A2),COLUMN
()-2<=WEEKDAY($B2)),AND(COLUMN()-2=WEEKDAY($A2),COLUMN()-2=WEEKDAY
($B2))),1,0)),0)


Tagging on here because I don't see the original post. But a simpler formula:

The number of DOW (1= Sunday, 2 = Monday, ..., 7 = Saturday) between a start
date (A1) and an end date (A2) is :

=INT((A2-WEEKDAY(A2+1-DOW)-A1+8)/7)
--ron
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Number of Specific Day within Dates

On Jul 2, 3:08*pm, Ron Rosenfeld wrote:
On Thu, 2 Jul 2009 07:24:17 -0700 (PDT), zxcv wrote:
On Jun 29, 6:51*am, Abdul wrote:
Hi,


Is there a way to find how many Day (eg. wednesdays) within a a date
range?


Like how many Wednesdays (any given Day) falling between June 1, 2009
Till June 21, 2009


Thanks,


Let's say that you have a sheet set up like this, A2 shows your start
date, B2 shows your end date, and C2 though I2 will have the count of
Sundays through Saturdays, try this formula in C2 through I2:


=FLOOR(($B2-$A2+1)/7,1)+IF(($B2-$A2+1)/7FLOOR(($B2-$A2+1)/7,1),IF
(WEEKDAY($B2)=WEEKDAY($A2),IF(AND(WEEKDAY($B2)= COLUMN()-2,COLUMN
()-2=WEEKDAY($A2)),1,0),IF(OR(AND(COLUMN()-2<=WEEKDAY($A2),COLUMN
()-2<=WEEKDAY($B2)),AND(COLUMN()-2=WEEKDAY($A2),COLUMN()-2=WEEKDAY
($B2))),1,0)),0)


Tagging on here because I don't see the original post. *But a simpler formula:

The number of DOW (1= Sunday, 2 = Monday, ..., 7 = Saturday) between a start
date (A1) and an end date (A2) is :

=INT((A2-WEEKDAY(A2+1-DOW)-A1+8)/7)
--ron- Hide quoted text -

- Show quoted text -


Thanks. That was much better.
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
Number of Specific Day within Dates Shane Devenshire[_2_] Excel Worksheet Functions 0 June 30th 09 07:59 PM
Number of Specific Day within Dates Teethless mama Excel Worksheet Functions 0 June 30th 09 07:30 PM
Number of Specific Day within Dates Alan McQ via OfficeKB.com Excel Worksheet Functions 0 June 30th 09 07:19 PM
Excel - count the number of records between two specific dates. DK Excel Worksheet Functions 4 May 21st 08 03:08 PM
Determining the number of specific days between two dates in Excel jon s Excel Worksheet Functions 9 March 21st 05 09:13 PM


All times are GMT +1. The time now is 07:01 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"