Colum(s)中单元格值的IF和OR组合

时间:2016-05-11 23:33:46

标签: excel excel-vba if-statement vba

在单元格Q49中,我有:=IF(COUNTIF(W5:W35,"OK")=ROWS(W5:W35),"GOOD","WARNING!")

现在,它适用于一列,但我想添加更多"列" (例如,添加X5:X35Y5:Y35

那应该让excel寻找" OK"在指定的列中。 这就是我尝试但它没有用的:

=IF(COUNTIF(W5:W35,X5:X35,Y5:Y35,"OK")=ROWS(W5:W35,X5:X35,Y5:Y35),"GOOD","WARNING!")

1 个答案:

答案 0 :(得分:0)

分隔列检查并使用“AND”

=IF(AND(COUNTIF(W5:W35,"OK")=ROWS(W5:W35),COUNTIF(X5:X35,"OK")=ROWS(X5:X35),COUNTIF(Y5:Y35,"OK")=ROWS(Y5:Y35)),"GOOD","WARNING!")