Home > Net >  Excel if or not returning expected result
Excel if or not returning expected result

Time:11-13

My spreadsheet looks like this, where each cell contains a formula bringing the value from another sheet:

N         O   ...  R     S     T      U
Process   Loc      U1    U2    U3     IsValid
Bestly    20       8     20    20     Invalid

Where the formula in U:

=IF(OR(O51=R51,O51=S51,O51=T51),"Valid","Invalid")

It should have returned Valid, since 20 is in both columns S and T. Is there something wrong with the formula that I need to fix to get it to return Valid when it finds the value in O in at least one column?

Thanks! This is Excel in Office 16.

CodePudding user response:

As per my comment:

Looks valid to me. Are you sure these are all numeric values without funny characters? Another way would be to use:

=IF(COUNTIF(R51:T51,O51),"valid","invalid")
  • Related