B badger New Member Oct 28, 2022 #1 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.
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.
M Marcilio Member Oct 28, 2022 #2 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.
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.
p45cal Well-Known Member Oct 28, 2022 #3 Code: =BIN2DEC(SUBSTITUTE(SUBSTITUTE(CONCAT(A1:B1),"Y",0),"N",1))+1 or maybe: Code: =BIN2DEC(CONCAT(N(A1:B1="N")))+1 Last edited: Oct 28, 2022
Code: =BIN2DEC(SUBSTITUTE(SUBSTITUTE(CONCAT(A1:B1),"Y",0),"N",1))+1 or maybe: Code: =BIN2DEC(CONCAT(N(A1:B1="N")))+1
P Peter Bartholomew Well-Known Member Oct 28, 2022 #5 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.
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.