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
 
Originally posted by Aladin:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))=6))

would count Saturdays between A2 and B2 which house true dates with A2 <= B2.
Aladin, I think your (slick!) formula should read:

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))=7))

for Saturdays, or:

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)),2)=6))

You realize, of course, that your formula fails for dates greater than June 5, 2079! (Most of us will be dead or doddering around with canes by then, anyway. :-( ) Also, the formula I proposed above can be simplified, too; for Saturdays it becomes:

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

where B2 & C2 house Start & End dates as before.
--Tom
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
rrdonutz said:
Originally posted by Aladin:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))=6))

would count Saturdays between A2 and B2 which house true dates with A2 <= B2.
Aladin, I think your (slick!) formula should read:

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))=7))

for Saturdays...
--Tom

That's right.
 
Upvote 0
The number of weekend days in the period divided by 2 could also work I suppose...though perhaps not as accurate
Excel Formula:
=(B2-A2-(NETWORKDAYS(A2,B2)))/2
 
Upvote 0
@kcmuppet, these days you would probably use the NETWORKDAYS.INTL function (it wasn't around when Aladin posted)

Book1
BCDEF
101/01/202124/02/202187.5
Sheet1
Cell Formulas
RangeFormula
E1E1=NETWORKDAYS.INTL(B1,C1,"1111101")
F1F1=(C1-B1-(NETWORKDAYS(B1,C1)))/2
 
Upvote 0

Forum statistics

Threads
1,225,193
Messages
6,183,467
Members
453,161
Latest member
Shaner1215

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