i have this : 2S 5D [AC KH 2S QS JS] in cell b2 for Google Sheets

dabielcrbyton

New Member
Joined
May 28, 2017
Messages
39
abcde
a1
a22S 5D [AC KH 2S QS JS]2 5 [A K 2 Q J]2 5[2 J Q K A ]
a3

please MY FRIENDS

i have this : 2S 5D [AC KH 2S QS JS]
in cell b2 ( it is the cards i have in poker)

i need function in c2 that will do that :
2 5 [A K 2 Q J]
(delete the 4 shape of every card in poker S,D,H,C)



also i need in d2 function that will do that :
2 5
it will set the cards by order from the low card
to the highest cards in poker
by order before the Parenthesis [ ]
FROM in c2


also i need in e2 function that will do that :
[2 J Q K A ]
it will set the cards by order from the low card
to the highest cards in poker
by order inside the Parenthesis [ ]
FROM in c2

the order on card in poker is :
A : IS THE highest CARD
K
q
J
10
9
8
7
6
5
4
3
2 : IS THE LOWEST CARD
 
Last edited by a moderator:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
If your version of Excel has TEXTJOIN function the following formulas should work.

PQ Date Transform.xlsm
ABCDE
1
210S 2D [AC KH 10S QS JS]10 2 [A K 10 Q J]2 10[10 J Q K A]
Sheet6
Cell Formulas
RangeFormula
C2C2=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"C",""),"D",""),"H",""),"S","")
D2D2=TEXTJOIN(" ",1,SUBSTITUTE(MID("23456789XJQKA",SMALL(FIND(MID(SUBSTITUTE(C2,"10","X"),{1,3},1),"23456789XJQKA"),{1,2}),1),"X","10"))
E2E2="[" & SUBSTITUTE(TEXTJOIN(" ",1,MID("23456789XJQKA",SMALL(FIND(MID(SUBSTITUTE(MID(C2,FIND("[",C2),20),"10","X"),{2,4,6,8,10},1),"23456789XJQKA"),{1,2,3,4,5}),1)),"X","10") & "]"
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Could we have another 4 or 5 varied sample rows and the expected results?
 
Last edited:
Upvote 0
If your version of Excel has TEXTJOIN function the following formulas should work.
I have asked for more sample data to confirm if it is possible, but if the sections can vary in size I think your formulas will fail.

Assuming Microsoft 365 or Excel 2019 is available, this is my suggestion.

21 08 03.xlsm
ABCDE
1
22S 5D [AC KH 2S QS JS]2 5 [A K 2 Q J]2 5[2 J Q K A]
32S KC 5D [AC KH QS JS]2 K 5 [A K Q J]2 5 K[J Q K A]
42S KC QD [AC 9H 4C JS]2 K Q [A 9 4 J]2 Q K[4 9 J A]
52S 10C 5D [AC KH QS JS]2 10 5 [A K Q J]2 5 10[J Q K A]
65D [KS 3D AC JD 3H JC]5 [K 3 A J 3 J]5[3 3 J J K A]
Sort Cards
Cell Formulas
RangeFormula
C2:C6C2=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"C",""),"D",""),"H",""),"S","")
D2:D6D2=SUBSTITUTE(SUBSTITUTE(TEXTJOIN(" ",1,SORT(FILTERXML("<p><c>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(C2,FIND("[",C2)-2),"A","ZA"),"K","YK")," ","</c><c>")&"</c></p>","//c"))),"Z",""),"Y","")
E2:E6E2="["&SUBSTITUTE(SUBSTITUTE(TEXTJOIN(" ",1,SORT(FILTERXML("<p><c>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(REPLACE(LEFT(C2,LEN(C2)-1),1,FIND("[",C2),""),"A","ZA"),"K","YK")," ","</c><c>")&"</c></p>","//c"))),"Z",""),"Y","")&"]"
 
Upvote 0
It looks like it might be modelling Texas Holdem which would always be two personal cards and 5 shared cards. If that's the case I think my formulas should work
 
Upvote 0
If your version of Excel has TEXTJOIN function the following formulas should work.

PQ Date Transform.xlsm
ABCDE
1
210S 2D [AC KH 10S QS JS]10 2 [A K 10 Q J]2 10[10 J Q K A]
Sheet6
Cell Formulas
RangeFormula
C2C2=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"C",""),"D",""),"H",""),"S","")
D2D2=TEXTJOIN(" ",1,SUBSTITUTE(MID("23456789XJQKA",SMALL(FIND(MID(SUBSTITUTE(C2,"10","X"),{1,3},1),"23456789XJQKA"),{1,2}),1),"X","10"))
E2E2="[" & SUBSTITUTE(TEXTJOIN(" ",1,MID("23456789XJQKA",SMALL(FIND(MID(SUBSTITUTE(MID(C2,FIND("[",C2),20),"10","X"),{2,4,6,8,10},1),"23456789XJQKA"),{1,2,3,4,5}),1)),"X","10") & "]"


no
my friend
i use google doc
i the C the function work amazing
but in the D
and in E
the function do not work



can you help me fix it
please
 
Upvote 0
Upvote 0
I have deleted your new thread as it is a duplicate of this one. I told you that I had moved the thread for you.
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,853
Members
452,675
Latest member
duongtruc1610

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top