Home > Software design >  If statement reference multiple cells with strings
If statement reference multiple cells with strings

Time:07-05

I have equation If(A1=c1:c10),1,0)). The cell range C1:C10 are cells that each contain an individual string (so cell c1 = 'word1', c2 = 'word2' etc. I want to see if A1 matches any of these. This equation doesn't work for strings, so was hoping to get some pointers on this.

CodePudding user response:

Try below formula-

=IF(ISNUMBER(MATCH(A1,$C$1:$C$10,0)),1,0)

enter image description here

CodePudding user response:

enter image description here

I want to see if A1 matches any of these

You can count how many times the word in cell A1 appears in range C1:C10. IF the count is zero, it means there is no match, else there is 1 or more matches. Just use COUNTIF combined with IF in cell B1:

=IF(COUNTIF($C$1:$C$10;A1)=0;0;1)
  • Related