I have a column. I want to check with a formula that all the cells in the column are either empty, or contain the string "OK".
It looks like the formulas MATCH() or COUNTIF() would not help because they check if any cell contain the string, and I want to check for all cells.
Basically the formula should be equivalent to:
(cell1 contains "OK" or is empty) AND
(cell2 contains "OK" or is empty) AND
(cell3 contains "OK" or is empty) AND
etc...
Answer
I use:
=IF(COUNTA(A:A)=COUNTIF(A:A,"OK"),"All OK","Some Errors")
COUNTA() returns the number of not empty cells.
The questions is equivalent to:
- all not empty cells contain "OK"
No comments:
Post a Comment