Home > Blockchain >  couting values of a string in a cell and return 'paired' or not 'paired'
couting values of a string in a cell and return 'paired' or not 'paired'

Time:05-09

hello i need some help to count characters within a string, if there is any repeated number, return "paired" or something. if anyone can help I would appreciate it, follow the example

enter image description here

CodePudding user response:

try:

=INDEX(IF(3=QUERY(SPLIT(UNIQUE(FLATTEN(ROW(A1:A2)&"×"&SPLIT(A1:A2; "♦♣♠"))); "×"); 
 "select count(Col1) group by Col1 label count(Col1)''"); "not paired"; "paired"))

enter image description here


update:

=INDEX(IF(3=QUERY(SPLIT(UNIQUE(FLATTEN(FILTER(ROW(A5:A), A5:A<>"")&"×"&
 SPLIT(FILTER(A5:A, A5:A<>""), "♦♣♠"))), "×"), 
 "select count(Col1) group by Col1 label count(Col1)''"), 
 "not paired", "paired"))

enter image description here

CodePudding user response:

see:

=ARRAYFORMULA(IF(F5:F="",,
 IF((MID(F5:F, 4, 1)=MID(F5:F, 1, 1)) 
    (MID(F5:F, 4, 1)=MID(F5:F, 7, 1)), 
 "1 - paired", "2 - not paired")))

enter image description here

  • Related