Dominic
Dominic

Reputation: 164

Excel - If condition with three values

I would like to check three cells, and if the first two are "Yes" then put text in a specific cell, and if all three are "Yes" then different text in that specific cell.

Example:

Yes | Yes | No  | "Sort of Working"
Yes | Yes | Yes | "Working
No  | No  | Yes | "Not working"

Basically, if all three say Yes then it is "Working" if not, then it is "Not working" by using a formula

Thank you

Upvotes: 2

Views: 7718

Answers (2)

user4039065
user4039065

Reputation:

Three cells would be about my limit on stacking conditions within an AND function. Any more and I would perform a conditional count (COUNTIF function) and compare the number.

=IF(COUNTIF(A1:A3, "Yes")=3, "Working", "Not Working")

Alternate:

=LOOKUP(COUNTIF(A1:A3, "Yes"), {0,1,2,3}, {"Not Working","Not Working","Sort of Working","Working"})
=IFERROR(CHOOSE(COUNTIF(A1:A3, "yes")-1, "Sort of Working","Working"), "Not Working")

Upvotes: 2

Mr. Llama
Mr. Llama

Reputation: 20899

You can nest AND() inside of IF().

=IF( AND(A1="Yes", A2="Yes", A3="Yes"), "Working", "Not Working" )

Upvotes: 0

Related Questions