Number of Saturdays within a range of dates

R

Ruben

What, if any, formula can I use to count the number of Saturdays between 2
dates?
Thanks!
 
D

DazzaData

This is a tricky blighter, heres my answer

part a part b part c
part d
=INT((1+G23-G22)/7)+
IF(WEEKDAY(1+G23-7*INT((G23-G22)/7))<=MOD((1+G23-G22),7),1,0)

g23 is end date, g22 is old date

Explanation

part a works out the number of whole weeks in the date range, they are
assumed to be inclusive dates which is why I add 1

part c finds out, working backwards from the end date the number of whole
weeks we found a, what day of the week we get to.

Part d establishes how many days we had left over in part a

Part b, the if, compares the day of the week we worked back to against the
number of days left over to see if we can include another saturday

QED :)
 
V

vezerid

What, if any, formula can I use to count the number of Saturdays between 2
dates?
Thanks!

Start date in D1, End date in D2:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(D1&":"&D2)))=7))

HTH
Kostis Vezerides
 
P

Peo Sjoblom

start date in A1 and end date in A2

=SUMPRODUCT(N(WEEKDAY(ROW(INDIRECT(A1&":"&A2)),2)=6))
 
D

Daniel.M

Hi Ruben,

With
A1=Start Date and
A2=End Date,

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

Regards,

Daniel M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top