【发布时间】:2021-02-22 19:13:51
【问题描述】:
对于这个问题,我知道可以通过=query("some code")使用SQL,这种方式完全有效,但如果有更简单的方式更好。
我想在 Google 电子表格中统计所有禁用的帐户,但每个 account_id 只计算一次
account_status account_id
disabled: 22/02/2021 3
disabled: 15/02/2021 3
disabled: 17/02/2021 4
disabled: 22/02/2021 4
active: 22/02/2021 5
active: 22/02/2021 5
active: 04/02/2021 6
active: 22/02/2021 6
active: 22/02/2021 7
active: 22/02/2021 7
active: 05/02/2021 7
active: 22/02/2021 8
active: 22/02/2021 8
active: 22/02/2021 9
active: 22/02/2021 9
在这种特定情况下,我有 2 个 ID 分别为 4 和 3 的帐户,总共 4 行,但我希望计数的结果是禁用的帐户数,在这种情况下为 2
我尝试了失败:
=COUNTIFS('mysheet'!S2:S, "active")
=COUNTUNIQUEIFS('mysheet'!S2:S, 'mysheet'!C2:C,"disabled")
【问题讨论】:
标签: sql google-sheets spreadsheet counting countif