Counting number of Saturdays between two dates

Steve_C

New Member
Joined
Aug 27, 2003
Messages
29
Hi fellas,

If I have two dates in different cells (say start date in B1, and end date in C1) what formula do i type in D1 to count the number of saturdays included in the period.

Thanks in advance for any help, sorry if its a bit basic.

Steve
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
This assumes that you want to include Saturdays if start or end date is a Sat

Using chitosunday's on these dates returns 3, which I think is incorrect.
Book1
BCDE
303/08/2003
422/08/2003
52
Sheet1
 
Upvote 0
Please disreguard my previous report which i use b2 instead of b1, this is the correct one
=INT((+C1-B1)/7)+IF(WEEKDAY(B1)+MOD(C1-B1,7)>=7,1,0)
 
Upvote 0
Example from http://www.cpearson.com/excel/DateTimeWS.htm

Number Of Mondays In Period

If you need to return the number of Monday's (or any other day) that occur within an interval between two dates, use the following Array Formula:

=SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=C2,1,0))

This formula assumes the following:
A2 contains the beginning date of the interval
B2 contains the ending date of the interval
C2 contains the day-of-week number (1=Sunday, 2=Monday,...,7=Saturday)

HTH
 
Upvote 0
Using Iridiums formula does not give the right answer all the time (not sure mine did either), this one does (I think)!
Count Days Between Dates.xls
ABCD
2Day6
3Start01/08/20035
4End15/08/20035
5
6Gaz2
7
8Iridium3
Sheet1


Regards
Gaz
 
Upvote 0
Found mine doesn't work all the time either?
Try this one
=(((B4-B3)+((WEEKDAY(B3,2)-WEEKDAY(B4,2))))/7)+IF(WEEKDAY(B3,2)<B2,1,0)+IF(WEEKDAY(B4,2)<B2,-1,0)
 
Upvote 0
The formula in cell D2 is:

=INT((C2+7-A2)/7)-INT((B2+7-A2)/7)+INT(WEEKDAY(B2+7-A2)/7)

which is slightly shorter than C. Pearson's ARRAY formula that gives the same results:

=SUM(IF(WEEKDAY(B2-1+ROW(INDIRECT("1:"&TRUNC(C2-B2)+1)))=A2,1,0))

Both formulas rely on 1=Sunday, 2=Monday, etc.

--Tom
MrExcel82403.xls
ABCDE
1DayStartEndCountSum
2101/08/0331/08/035
3201/08/0331/08/034
4301/08/0331/08/034
5401/08/0331/08/034
6501/08/0331/08/034
7601/08/0331/08/035
8701/08/0331/08/03531
9101/08/0315/08/032
10201/08/0315/08/032
11301/08/0315/08/032
12401/08/0315/08/032
13501/08/0315/08/032
14601/08/0315/08/033
15701/08/0315/08/03215
16101/10/0303/10/030
17201/10/0303/10/030
18301/10/0303/10/030
19401/10/0303/10/031
20501/10/0303/10/031
21601/10/0303/10/031
22701/10/0303/10/0303
Sheet6
 
Upvote 0
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))=6))

would count Saturdays between A2 and B2 which house true dates with A2 <= B2.
 
Upvote 0

Forum statistics

Threads
1,225,138
Messages
6,183,087
Members
453,146
Latest member
Lacey D

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