Hopefully an easy IF question

  • Thread starter Thread starter Lostguy
  • Start date Start date
L

Lostguy

Hello!

Getting wrapped around this and can't make it work:

If A1="Yes", then D1="A".

If B1="Yes", then D1="B"

If C1="Yes", then D1="C".

I come up with a mess of IF's and OR's, but nothing I do makes D1
toggle.

(Ideally, only one of A1-C1 will be "Yes", but in selecting, a user
could have A1 and B1 both yes which will try to make D1 an "A" and a
"B" at the same time.....bad.)

Can this be done with formulas?

Thanks for the help!

VR/

Lost
 
Does this do what you want...

D1: =IF(A1="Yes","A","")&IF(B1="Yes","B","")&IF(C1="Yes","C","")

Rick
 
Try this:

=IF(COUNTIF(A1:C1,"yes"),INDEX({"A","B","C"},MATCH("yes",A1:C1,0)),"")

If more than one cell contains "Yes" the formula will return the letter
correspnding to the leftmost instance of "Yes".
 
If that is what the OP wants, here is another possibility...

=IF(A1&B1&C1="","",MID("ABC",MATCH("yes",A1:C1,0),1))

Rick
 
Yep! And you also liked this approach when I posted it for the ordinal
suffix thread we both participated in back around Christmas time too... same
underlying concept, different arguments.

Rick
 
Lostguy said:
Hello!

Getting wrapped around this and can't make it work:

If A1="Yes", then D1="A".

If B1="Yes", then D1="B"

If C1="Yes", then D1="C".
[...]

Another - strange - way...
=CHOOSE(SUMPRODUCT((A1:C1="Yes")*{1,2,3}),"A","B","AB","AC","BC","ABC")

Bruno
 
And yet another way:
=IF(COUNTIF(A1:C1,"yes")>1,"Too many
yeses!",IF(A1="Yes","A",IF(B1="Yes","B",IF(C1="Yes","C","You need at least 1
Yes!"))))
 
Yes, I remember it well. We came up with a "killer" solution. I have it
stashed in my formula library.
 
Why dont you try this:

Type this in cell D1

=if(A1="Yes","A",if(b1="Yes","B",if(c1="Yes","C","")))

Mike
 
Back
Top