OR syntax

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I want to insert 1 in a cell if the value in another cell matches one or
more of 5 other cells. I have tried =IF(OR(C20=C5,D5,E5,F5,G5),1,"-") but
does not seem to work. Is this syntax is incorrect?

May be there is a better way to do this? Your help will be much
appreciated.
 
Try it this way:

=IF(OR(C20=C5,C20=D5,C20=E5,C20=F5,C20=G5),1,"-")

Hope this helps.

Pete
 
Maybe...

=if(isnumber(match(c2,c5:g5,0)),1,"-")
or
=if(countif(c5:g5,c20)>0,1,"-")
 
Back
Top