COUNTIF基于星期几

问题描述 投票:0回答:2

我还有日期栏...

dates

我想在此列中计算星期六(或一周中的其他日期)的数量。一个解决方案是两个创建一个带有工作日编号的额外列,然后在该列上运行一个COUNTIF公式,例如...

A Solution

但是我不想创建一个新列。我该怎么办?

google-sheets filter google-sheets-formula countif weekday
2个回答
1
投票

尝试以下公式:

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

然后:

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

0
投票

您不需要额外的列,只需要:

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

enter image description here


或更短:

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

0

© www.soinside.com 2019 - 2024. All rights reserved.