Home > Back-end >  Excel multiple OR conditions
Excel multiple OR conditions

Time:04-09

I have three conditions which independently work but I can't get them to work together. I want it to be FALSE if any of the conditions aren't true.

No duplicates - =COUNTIF($B$2:$B$51,B2)=1

Character length bigger than 2 - LEN($B2)>2

Character length less than 256 - LEN($B2)<256

I tried this combined but it didn't work as expected:

=IF(COUNTIF($B$2:$B$51,B2)=1, TRUE, IF(LEN($B2)<256, TRUE, IF(LEN($B2)>2, TRUE, FALSE)))

Thanks

CodePudding user response:

As you want FALSE if any condition returns false, you need to use AND to check if the conditions are true. If then any of the 3 conditions returns false, so does AND then:

=AND(COUNTIF($B$2:$B$51,B2)=1,LEN($B2)>2,LEN($B2)<256)
  • Related