Mr. J
Mr. J

Reputation: 1839

COUNTIF Based on Day of Week

I have a column of dates as so...

dates

I want to count the number of Saturdays (or any other day of the week), in this column. One solution would be two create an extra column with the weekday number in it, and then run a COUNTIF formula over that column, such as...

A Solution

But I would prefer to not create a new column. How can I do this?

Upvotes: 2

Views: 3640

Answers (2)

player0
player0

Reputation: 1

you don't need extra column, just:

=INDEX(COUNTIFS(WEEKDAY(A:A), 7, A:A, "<>"))

enter image description here


or shorter:

=COUNTA(FILTER(A:A, WEEKDAY(A:A)=7))

0

Upvotes: 0

Kishan
Kishan

Reputation: 1810

Try the following formula:

=filter(text(A:A,"dddd"),len(A:A))

and then:

=countif(filter(text(A:A,"dddd"),len(A:A)),"Sunday")

Upvotes: 2

Related Questions