具有匹配和嵌套 ifs 的数组公式
Array formula with Match and nested ifs
到目前为止,我已经使用它在一列上创建了一个结果(公式存在于 X 列):
=ArrayFormula(iferror(if(match($O:$O,'SheetB!C:C,0),"Sent","")))
效果很好,简单的技巧,因为我向 SheetB 添加了更多数据!C:C 我一直在
上获取更新
现在我无法尝试嵌套 'if' 来检查另一列,如果第一列没有给出结果的话:
=ArrayFormula(iferror(if(match($O:$O,'SheetB'!C:C,0),"Sent",if(match($P:$P,'SheetB'!C:C,0),"Sent","Not Sent")))
这张图有什么问题吗?
这个更简单的公式:
=ArrayFormula(iferror(if(match($O:$P,SheetB!C:C,0),"Sent","Not")))
在 2 列中给出结果:
Sent
Sent
Sent
Sent
Sent
Sent
如果您喜欢单列输出,请尝试使用更重的公式:
=ArrayFormula(if(iferror(if(match($O:$O,SheetB!C:C,0),1,0))+iferror(if(match($P:$P,SheetB!C:C,0),1,0))>0,"Sent",""))
到目前为止,我已经使用它在一列上创建了一个结果(公式存在于 X 列):
=ArrayFormula(iferror(if(match($O:$O,'SheetB!C:C,0),"Sent","")))
效果很好,简单的技巧,因为我向 SheetB 添加了更多数据!C:C 我一直在
上获取更新现在我无法尝试嵌套 'if' 来检查另一列,如果第一列没有给出结果的话:
=ArrayFormula(iferror(if(match($O:$O,'SheetB'!C:C,0),"Sent",if(match($P:$P,'SheetB'!C:C,0),"Sent","Not Sent")))
这张图有什么问题吗?
这个更简单的公式:
=ArrayFormula(iferror(if(match($O:$P,SheetB!C:C,0),"Sent","Not")))
在 2 列中给出结果:
Sent
Sent
Sent
Sent
Sent
Sent
如果您喜欢单列输出,请尝试使用更重的公式:
=ArrayFormula(if(iferror(if(match($O:$O,SheetB!C:C,0),1,0))+iferror(if(match($P:$P,SheetB!C:C,0),1,0))>0,"Sent",""))