# 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

##### MrExcel MVP, Junior Admin
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))
(adjusted after Fluff's comment)

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

##### MrExcel MVP, Junior Admin
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,078,442
Messages
5,340,310
Members
399,367
Latest member
ahmed elsaid

### This Week's Hot Topics

• Problem with Radio Button's format control
I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
• Last Display on userform to a Listbox
[CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
• Rename and move files to a new location
Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
• Help with True/False Formula
Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
• Clear extra characters from a provided range of cells
Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
• Help with Current and highest streaks
Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...