Count Public Holidays that falls on a Saturday

cloud2828

New Member
Joined
Jul 16, 2019
Messages
43
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
Joined
Aug 1, 2002
Messages
51,479
Office Version
365
Platform
Windows
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
Joined
Aug 28, 2016
Messages
489
Office Version
365, 2013
Platform
Windows
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
Joined
Jun 12, 2014
Messages
32,206
Office Version
365
Platform
Windows
Maybe
=SUMPRODUCT(--(WEEKDAY(A2:A32,2)=7))
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,206
Office Version
365
Platform
Windows
@JustynaMK
That will only count the 7th day of the month, not sundays.
 

JustynaMK

Active Member
Joined
Aug 28, 2016
Messages
489
Office Version
365, 2013
Platform
Windows
@Fluff, oops, that was silly! Thanks, I'll adjust my formula now.
 
Last edited:

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,479
Office Version
365
Platform
Windows
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
Joined
Jun 12, 2014
Messages
32,206
Office Version
365
Platform
Windows
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
Joined
Jul 16, 2019
Messages
43
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
Joined
Jun 12, 2014
Messages
32,206
Office Version
365
Platform
Windows
Glad we could help & thanks for the feedback
 

Forum statistics

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

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top