arrays - Multiple conditions in an array
问题描述
I'm having this problem where, when referencing more than a condition in a range, it "doesn't run", the cell is just blank. The expected process for the first condition, for example, was to check if, in the same row, A2:A="1"
and B2:B="2"
, if both of these conditions where true, in the same row, it would return sucess1
.
I'm using Google Sheets, but I think that this might also apply to Excel.
Code
=ARRAYFORMULA(IFS(
AND(A2:A="1", B2:B="2"), "sucess1",
AND(A2:A="3", B2:B="4"), "sucess2",
TRUE,))
解决方案
arrayformula 不支持AND
and OR
。所以:
=ARRAYFORMULA(IF((A2:A=1)*(B2:B=2), "sucess1",
IF((A2:A=3)*(B2:B=4), "sucess2", )))
推荐阅读
- google-apps-script - 多列中的 Google 表格日期戳
- aws-lambda - 由于错误 AccessDeniedException(Lambda 别名作为 Cognito 触发器),AWS Cogntio 用户池引发 PreSignUp 调用失败
- mysql - Claculation Billing 金额和收到的金额
- mysql - 如何在mysql中获取用户阅读了多少章
- json - 使用 jq 从没有密钥的 API 中提取数据
- swift - TVOS - SearchBar:如何显示加载指示器
- gson - 当我使用 Gson 将映射输出到 json 时,字符串中 unicode 的双反斜杠
- swift - 调用 AWS API - Swift 中的签名、身份验证标头
- amazon-web-services - 使用策略将 amazon s3 存储桶上的文件类型限制为特定文件夹
- javascript - 如何在 Firebase 存储中获取用户详细信息?