Need a way to determine the # of Saturdays in a month

G

Guest

Hi all,
I need to determine the # of Saturdays in a given month. Can anyone help?
 
G

Guest

Try this:-

=SUM(IF(WEEKDAY(A1-1+ROW(INDIRECT("1:"&TRUNC(B1-A1)+1)))=C1,1,0))

A1= Start date
B1 = End date
C1 = day of week you want 1=Sun - 7 = Sat
It's an array so Ctrl+Shift+enter

Mike
 
G

Guest

Thats it! Thanks Mike.
--
Thanks.
Chuck M.


Mike H said:
Try this:-

=SUM(IF(WEEKDAY(A1-1+ROW(INDIRECT("1:"&TRUNC(B1-A1)+1)))=C1,1,0))

A1= Start date
B1 = End date
C1 = day of week you want 1=Sun - 7 = Sat
It's an array so Ctrl+Shift+enter

Mike
 
D

Don Guillett

try this where a1 contains any date in the month desired
=SUMPRODUCT(--(WEEKDAY(A1-1+ROW($A$1:INDEX(A:A,DAY(EOMONTH(A1,0)))))=7))
or start date in a1 and end date in a2
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(a1&":"&a2)))=7))
 
T

T. Valko

Another one:

A1 = any date in the month of interest

=4+(DAY(A1-DAY(A1)+35)<WEEKDAY(A1-DAY(A1)-DOW))

Where DOW = Monday = 1 to Sunday = 7
 

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