Home » excel » How to use logical operator on range of cells in Excel (#VALUE error message)

How to use logical operator on range of cells in Excel (#VALUE error message)

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a range of cells that I want to oversee whether it is within specs or out of specs.

I try using the single cell to evaluate and so far so good. It should evaluate whether the cell are within values of 10 and 15, if it is within PASS, else FAIL.

=IF(OR(A2<10,A2>15),"FAIL","OK")

When I try with range itself (A2:Z2) , it also couldn’t work as it shown #VALUE error message.

=IF(OR(A2:Z2<10,A2:Z2>15),"FAIL","OK")

I try with Name Range itself, “Ctrl+F3” (I named it TEST) , it comes out with same results

=IF(OR(TEST<10,TEST>15),"FAIL","OK")

May I know if there are any ways I can evaluate the whole range ?

How to&Answers:

Please try:

=IF(COUNTIF(A2:Z2,"<10")+COUNTIF(A2:Z2,">15")>0,"FAIL","OK")

but ensure all of A2:Z2 is populated with a numeric, even if merely 0.