如何根据行中其他位置的值计算非空单元格?

时间:2019-08-09 04:10:14

标签: google-sheets

我有一张这样的桌子:

+---+---------+----------+--------+
|   |    A    |    B     |   C    |
+---+---------+----------+--------+
| 1 | John    | Judy     | Team A |
| 2 | Brandon | Bethany  | Team B |
| 3 | Agnes   |          | Team A |
| 4 | William | Welma    | Team B |
| 5 | Tom     | Theresa  | Team B |
| 6 | Peter   |          | Team A |
+---+---------+----------+--------+

计算人数很容易:

=COUNTA(A1:B6) -> 10

我如何计算每个团队的人数?即A队是4,B队是6。

1 个答案:

答案 0 :(得分:1)

您可以将COUNTA()FILTER()结合使用以达到以下结果:

=COUNTA(FILTER(A:B, C:C="Team A")) -> 4
=COUNTA(FILTER(A:B, C:C="Team B")) -> 6