Count Public Holidays that falls on a Saturday

cloud2828

New Member
I have a list of public holidays and I would like to know how I could count the ones that fall on a satuday.

Joe4

Assuming that what you have are valid dates, then an easy way would be to insert a column next to each that returns the weekday of each one, i.e.
Code:
``=WEEKDAY(A1)``
(and copy down for all rows)

Then use the COUNTIF function to count all the records where that value is 7, i.e.
Code:
``=COUNTIF(B1:B20,7)``

Last edited:

JustynaMK

Active Member
Alternative solution - assuming that a list of your public holidays is in cells A1:A10:

Code:
``=SUMPRODUCT(--(WEEKDAY(\$A\$1:\$A\$10,2)=7))``

Last edited:

Fluff

MrExcel MVP, Moderator
Maybe
=SUMPRODUCT(--(WEEKDAY(A2:A32,2)=7))

Fluff

MrExcel MVP, Moderator
@JustynaMK
That will only count the 7th day of the month, not sundays.

JustynaMK

Active Member
@Fluff, oops, that was silly! Thanks, I'll adjust my formula now.

Last edited:

Joe4

Maybe
=SUMPRODUCT(--(WEEKDAY(A2:A32,2)=7))
Funny, I tried something like that initially, and it didn't appear to work. So I tried again, and now it does. I must have had a typo initially.

However, there is one issue with your formula. If you choose "2" for your second argument, then Saturday returns 6, not 7.
That argument is optional, and if you leave it off and go with the default, Saturday is 7.

So it should be:
=SUMPRODUCT(--(WEEKDAY(A2:A32,2)=6))
or simply:
=SUMPRODUCT(--(WEEKDAY(A2:A32)=7))

Last edited:

Fluff

MrExcel MVP, Moderator
You're quite right Joe
For some reason I was reading it as counting Sundays, not Saturdays.
So either
=SUMPRODUCT(--(WEEKDAY(A2:A32,2)=6))
or
=SUMPRODUCT(--(WEEKDAY(A2:A32)=7))

cloud2828

New Member
Thank you all for the responses! I shall try these.

Edit: Thank you all, I saw where my problem lied, I was trying to use COUNTIF.

Last edited:

Fluff

MrExcel MVP, Moderator
Glad we could help & thanks for the feedback

1,081,981
Messages
5,362,533
Members
400,679
Latest member
alecalec202

This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...