Existe-t-il une formule pour répertorier toutes les combinaisons possibles de 2 cartes de 4 cartes à jouer?
4 cartes à jouer:
A♥
A♦
A♣
A♠
Le résultat doit être de 6 combinaisons uniquement (pas 4 x 4 = 16 combinaisons):
1: A♥ A♦
2: A♥ A♣
3: A♥ A♠
4: A♦ A♣
5: A♦ A♠
6: A♣ A♦
=ARRAYFORMULA(QUERY(IF(QUERY(QUERY(SPLIT(
TRANSPOSE(SPLIT(REPT(CONCATENATE(A1:A4&CHAR(9)), COUNTA(A1:A4)), CHAR(9)))&" "&
TRANSPOSE(SPLIT(CONCATENATE(REPT(A1:A4&CHAR(9), COUNTA(A1:A4))), CHAR(9)))," "),
"where Col1 <> Col2", 0), "select Col1", 0)<
QUERY(QUERY(SPLIT(
TRANSPOSE(SPLIT(REPT(CONCATENATE(A1:A4&CHAR(9)), COUNTA(A1:A4)), CHAR(9)))&" "&
TRANSPOSE(SPLIT(CONCATENATE(REPT(A1:A4&CHAR(9), COUNTA(A1:A4))), CHAR(9)))," "),
"where Col1 <> Col2", 0), "select Col2", 0),
QUERY(SPLIT(
TRANSPOSE(SPLIT(REPT(CONCATENATE(A1:A4&CHAR(9)), COUNTA(A1:A4)), CHAR(9)))&" "&
TRANSPOSE(SPLIT(CONCATENATE(REPT(A1:A4&CHAR(9), COUNTA(A1:A4))), CHAR(9)))," "),
"where Col1 <> Col2", 0), ), "where Col1 <>''", 0))