• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

IF/AND/OR Statement

badger

New Member
Trying to set up a formula to return the following.

A B C
Y Y 1
Y N 2
N Y 3
N N 4

What would be the formula be in C1 to return any of the combinations above.
Thanks in advance.
 
badger, Good morning.

Is this kind of formula that are you looking for?

C1 --> =IF(AND(A1<>"";B1<>""); IF(A1="Y"; IF(B1="Y"; 1; 2); IF(B1="N"; 3; 4)); "")

Use the separator symbol as your operational system: " ; " or " , "

Please, tell us, if this solves your rquestion.

I hope it helps.
 
Code:
=BIN2DEC(SUBSTITUTE(SUBSTITUTE(CONCAT(A1:B1),"Y",0),"N",1))+1
or maybe:
Code:
=BIN2DEC(CONCAT(N(A1:B1="N")))+1
 
Last edited:
I haven't the remotest idea what this is about or why one can't simply type in the 12 values but
Code:
= LET(
      YN, {"Y","N"},
      k,  SEQUENCE(4,,0),
      c₁, INDEX(YN, 1+QUOTIENT(k,2)),
      c₂, INDEX(YN, 1+MOD(k,2)),
      HSTACK(c₁, c₂, k+1)
   )
gives the cartesian produce of {"Y","N"} and the row index.
 
Back
Top