Home » excel » excel – If 1 or both columns has word, then enter text

excel – If 1 or both columns has word, then enter text

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am trying to create a formula that states: If either or both columns R & S on sheet ‘Jan’ have “fail” than enter a Y in column K of sheet ‘Feb’.
there are 4 possible outcomes:

- Fail, Fail
- Fail, Blank
- Blank, Fail
- Blank, Blank

I have tried several formulas, but I cannot get it to recognize all 4 scenarios.

=IF(INDEX(Jan!R:R&Jan!S:S,MATCH(A3,Jan!A:A,0),1)="fail","Y","") was the closest I’ve gotten, but it did not insert a “Y” if both cells had “fail”

What am I missing? 🙁

How to&Answers:

Based on your description, perhaps the following:

 =IF(OR(COUNTIFS(Jan!A:A,A3,Jan!R:R,"fail")>0,COUNTIFS(Jan!A:A,A3,Jan!S:S,"fail")>0),"Y","")

Answer:

Index Match Version

=IF(AND(INDEX(Jan!$R:$R,MATCH($A3,Jan!$A:$A,0))<>"fail",INDEX(Jan!$S:$S,MATCH($A3,Jan!$A:$A,0))<>"fail"),"","Y")

In this version you are checking if both columns do NOT contain “fail”. If they don’t then “”, and in all other three cases “Y”.