If statement 谷歌表单中的Countifs带有各种';不同于';同一行中的条件添加+;1值
我试图计算通过谷歌表单提供的谷歌表单中同一行中与某些特定条件不同的所有值,但最终计数显示为“1” 我计算的行对应于一个具有“其他”选项的多项选择题,因此用户可以输入其他值,我正在尝试计算行中“其他”值的数量 我尝试了正常计数和couldif,但当你使用a时,如果你想检查B2:B范围(B1是标题),它最终会计数到无穷大,所以我使用了以下结构:If statement 谷歌表单中的Countifs带有各种';不同于';同一行中的条件添加+;1值,if-statement,google-sheets,countif,google-sheets-formula,google-sheets-query,If Statement,Google Sheets,Countif,Google Sheets Formula,Google Sheets Query,我试图计算通过谷歌表单提供的谷歌表单中同一行中与某些特定条件不同的所有值,但最终计数显示为“1” 我计算的行对应于一个具有“其他”选项的多项选择题,因此用户可以输入其他值,我正在尝试计算行中“其他”值的数量 我尝试了正常计数和couldif,但当你使用a时,如果你想检查B2:B范围(B1是标题),它最终会计数到无穷大,所以我使用了以下结构: =COUNTIFS(query('FORMS RESPONSES'!B2:B,"<>TYPE A"), query('FORMS RESPON
=COUNTIFS(query('FORMS RESPONSES'!B2:B,"<>TYPE A"),
query('FORMS RESPONSES'!B2:B,"<>TYPE B"),
query('FORMS RESPONSES'!B2:B,"<>TYPE C"),
query('FORMS RESPONSES'!B2:B,"<>TYPE D"),
query('FORMS RESPONSES'!B2:B,"<>TYPE E"),
)
=COUNTIFS(查询('FORMS RESPONSES'!B2:B,“类型A”),
查询('FORMS RESPONSES'!B2:B,“类型B”),
查询('FORMS RESPONSES'!B2:B,“类型C”),
查询('FORMS RESPONSES'!B2:B,“类型D”),
查询('FORMS RESPONSES'!B2:B,“类型E”),
)
假设feed对A、B、C有1个响应,而对D、E没有响应,以及其他2个具有随机值的条目,答案应该是=2,但它只给我=1
我有这个:
=COUNTIFS(
query(datos!B2:B,"<>PC Tipo 1 (HP)")
,query(datos!B2:B,"<>PC Tipo 2 (Lenovo)")
,query(datos!B2:B,"<>PC Tipo 3 (Dell)")
,query(datos!B2:B,"<>Laptop Tipo 1 (Lenovo)")
,query(datos!B2:B,"<>Laptop Tipo 2 (Thinkpad)")
,query(datos!B2:B,"<>Tel Cel.")
)
=COUNTIFS(
查询(datos!B2:B,“PC Tipo 1(HP)”)
,查询(datos!B2:B,“PC Tipo 2(联想)”)
,查询(datos!B2:B,“PC Tipo 3(戴尔)”)
,查询(datos!B2:B,“笔记本电脑Tipo 1(联想)”)
,查询(datos!B2:B,“笔记本电脑Tipo 2(Thinkpad)”)
,查询(datos!B2:B,“电话号码”)
)
VG:
B2:B的示例数据输入为:
- 电脑Tipo 1(HP)
- 电脑Tipo 2(联想)
- PC Tipo 3(戴尔)
- 笔记本电脑Tipo 1(联想)
- 服务器HP
- 放映机
所以总共有6个条目,其中2个是我试图统计的“其他”类型(服务器HP和投影仪)。但是结果给了我
=1
作为一个错误计数,您得到了1
。这样做:
=COUNTA(QUERY(datos!B2:B, "where not B contains 'PC Tipo 1 (HP)'
and not B contains 'PC Tipo 2 (Lenovo)'
and not B contains 'PC Tipo 3 (Dell)'
and not B contains 'Laptop Tipo 1 (Lenovo)'
and not B contains 'Laptop Tipo 2 (Thinkpad)'
and not B contains 'Tel Cel.'", 0))
=ARRAYFORMULA(COUNTA(datos!B2:B)-
SUM(COUNTIF(datos!B2:B, {"PC Tipo 1 (HP)",
"PC Tipo 2 (Lenovo)",
"PC Tipo 3 (Dell)",
"Laptop Tipo 1 (Lenovo)",
"Laptop Tipo 2 (Thinkpad)",
"Tel Cel."})))
您将得到
1
作为一个错误计数。这样做:
=COUNTA(QUERY(datos!B2:B, "where not B contains 'PC Tipo 1 (HP)'
and not B contains 'PC Tipo 2 (Lenovo)'
and not B contains 'PC Tipo 3 (Dell)'
and not B contains 'Laptop Tipo 1 (Lenovo)'
and not B contains 'Laptop Tipo 2 (Thinkpad)'
and not B contains 'Tel Cel.'", 0))
=ARRAYFORMULA(COUNTA(datos!B2:B)-
SUM(COUNTIF(datos!B2:B, {"PC Tipo 1 (HP)",
"PC Tipo 2 (Lenovo)",
"PC Tipo 3 (Dell)",
"Laptop Tipo 1 (Lenovo)",
"Laptop Tipo 2 (Thinkpad)",
"Tel Cel."})))
或者您可以这样做:
=COUNTA(QUERY(datos!B2:B, "where not B contains 'PC Tipo 1 (HP)'
and not B contains 'PC Tipo 2 (Lenovo)'
and not B contains 'PC Tipo 3 (Dell)'
and not B contains 'Laptop Tipo 1 (Lenovo)'
and not B contains 'Laptop Tipo 2 (Thinkpad)'
and not B contains 'Tel Cel.'", 0))
=ARRAYFORMULA(COUNTA(datos!B2:B)-
SUM(COUNTIF(datos!B2:B, {"PC Tipo 1 (HP)",
"PC Tipo 2 (Lenovo)",
"PC Tipo 3 (Dell)",
"Laptop Tipo 1 (Lenovo)",
"Laptop Tipo 2 (Thinkpad)",
"Tel Cel."})))
或者您可以这样做:
=COUNTA(QUERY(datos!B2:B, "where not B contains 'PC Tipo 1 (HP)'
and not B contains 'PC Tipo 2 (Lenovo)'
and not B contains 'PC Tipo 3 (Dell)'
and not B contains 'Laptop Tipo 1 (Lenovo)'
and not B contains 'Laptop Tipo 2 (Thinkpad)'
and not B contains 'Tel Cel.'", 0))
=ARRAYFORMULA(COUNTA(datos!B2:B)-
SUM(COUNTIF(datos!B2:B, {"PC Tipo 1 (HP)",
"PC Tipo 2 (Lenovo)",
"PC Tipo 3 (Dell)",
"Laptop Tipo 1 (Lenovo)",
"Laptop Tipo 2 (Thinkpad)",
"Tel Cel."})))
(我只是通过重新发布答案来补充答案,而没有“删除”的“T.Y.”)
两个答案都很好。使用哪一个取决于您需要结果的位置。因为我不需要第一行或第二行的答案(像c20一样),所以我选择这个版本:
=COUNTA(QUERY(datos!B2:B, "where not B contains 'PC Tipo 1 (HP)'
and not B contains 'PC Tipo 2 (Lenovo)'
and not B contains 'PC Tipo 3 (Dell)'
and not B contains 'Laptop Tipo 1 (Lenovo)'
and not B contains 'Laptop Tipo 2 (Thinkpad)'
and not B contains 'Tel Cel.'", 0))
如果您需要将其放在第一行并添加到标题中,那么另一个答案会更合适(如果您需要它在收到来自谷歌表单的新答复时自动显示在列表中。如果有人需要知道如何做,我使用了以下方法:
={"Other responses"; ARRAYFORMULA(IF(LEN(A2:A),
(COUNTA(datos_equipos!B2:B)-
SUM(COUNTIF(datos_equipos!B2:B,
{"Escritorio - PC Tipo 1 (HP)",
"Escritorio - PC Tipo 2 (Lenovo)",
"Escritorio - PC Tipo 3 (Dell)",
"Laptop Tipo 1 (Lenovo)",
"Laptop Tipo 2 (Thinkpad)",
"Telefono Cel." }))) ,""))}
(我只是通过重新发布答案来补充答案,没有“删除的T.Y.”
两个答案都很好。使用哪一个取决于你需要结果的位置。因为我不需要第一行或第二行的答案(像c20一样),所以我使用以下版本:
=COUNTA(QUERY(datos!B2:B, "where not B contains 'PC Tipo 1 (HP)'
and not B contains 'PC Tipo 2 (Lenovo)'
and not B contains 'PC Tipo 3 (Dell)'
and not B contains 'Laptop Tipo 1 (Lenovo)'
and not B contains 'Laptop Tipo 2 (Thinkpad)'
and not B contains 'Tel Cel.'", 0))
如果您需要将其放在第一行并添加到标题中,那么另一个答案会更合适(如果您需要它在收到来自谷歌表单的新答复时自动显示在列表中。如果有人需要知道如何做,我使用了以下方法:
={"Other responses"; ARRAYFORMULA(IF(LEN(A2:A),
(COUNTA(datos_equipos!B2:B)-
SUM(COUNTIF(datos_equipos!B2:B,
{"Escritorio - PC Tipo 1 (HP)",
"Escritorio - PC Tipo 2 (Lenovo)",
"Escritorio - PC Tipo 3 (Dell)",
"Laptop Tipo 1 (Lenovo)",
"Laptop Tipo 2 (Thinkpad)",
"Telefono Cel." }))) ,""))}