Formula for Sorting numbers and letters in single cell

Rift_tide

New Member
Joined
Sep 6, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have one cell lets say cell A1 that contains a string of IDs separated by a comma, some IDs contain letters. ie: 1, 8s, 40h, 12, 6k, etc...
I'm looking for a way to get cell A2 to read: 1, 6k, 8s, 12, 40h ... It'd also be great to remove duplicates.
I've been wracking my brain the last couple days trying to come up with a formula that would do this but have come up empty.
The letter is always at the end and is preceded by either one or two numbers.
Any help would be appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Is this what you are after?

23 12 03.xlsm
AB
11, 40x, 40h, 8s, 40h, 12, 6k, 40h, 11, 6k, 8s, 12, 40h, 40x
Sort in cell
Cell Formulas
RangeFormula
B1B1=LET(b,TEXTSPLIT(A1,", "),n,1+ISNUMBER(-MID(b,2,1)),TEXTJOIN(", ",,UNIQUE(SORTBY(b,TEXT(LEFT(b,n),"00")&MID(b,1+n,99)),1)))
 
Upvote 0
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

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