Gå til hovedindhold

Hvordan sorterer man alfanumeriske data i Excel?

Hvis du har en liste over data, der er blandet med både tal og tekststrenge, når du sorterer disse kolonnedata normalt i Excel, sorteres alle de rene tal øverst og de blandede tekststrenge nederst. Men dit nødvendige resultat som det sidst viste skærmbillede. Denne artikel giver en nyttig metode, som du kan bruge til at sortere alfanumeriske data i Excel, så du kan opnå de ønskede resultater.

Sorter alfanumeriske data med formel hjælper kolonne

Oprindelige data   Normalt sortere resultatet   dit ønskede sorteringsresultat
doc sorterer alfanumerisk 1 2 doc sorterer alfanumerisk 2 2 doc sorterer alfanumerisk 3

pil blå højre boble Sorter alfanumeriske data med formel hjælper kolonne

I Excel kan du oprette en formelhjælpekolonne og derefter sortere dataene efter denne nye kolonne. Gør som følger:

1. Indtast denne formel = TEKST (A2, "###") ind i en tom celle udover dine data, for eksempel B2, se skærmbillede:

doc sorterer alfanumerisk 4

2. Træk derefter fyldhåndtaget ned til de celler, som du vil anvende denne formel, se skærmbillede:

doc sorterer alfanumerisk 5

3. Og sorter derefter dataene efter denne nye kolonne, vælg den hjælpekolonne, du oprettede, og klik derefter på data > Sort, og vælg i det pop op-meddelelsesfelt Udvid markeringen, se skærmbilleder:

doc sorterer alfanumerisk 6 2 doc sorterer alfanumerisk 7

4. og klik Sort knappen for at åbne Sort dialog under Kolonne sektion, skal du vælge Hjælpesøjle navn, som du vil sortere efter og bruge Værdier under Sorter til sektion, og vælg derefter sorteringsrækkefølgen, som du vil, se skærmbillede:

doc sorterer alfanumerisk 8

5. Og klik derefter på OK, i dialogboksen Sorter advarsel, der vises, skal du vælge Sorter numre og numre, der er gemt som tekst separat, se skærmbillede:

doc sorterer alfanumerisk 9

6. Klik derefter på OK knappen, kan du se, dataene er sorteret efter dit behov.

doc sorterer alfanumerisk 10

7. Endelig kan du slette indholdet i hjælpekolonnen efter behov.

Bedste kontorproduktivitetsværktøjer

🤖 Kutools AI Aide: Revolutionér dataanalyse baseret på: Intelligent udførelse   |  Generer kode  |  Opret brugerdefinerede formler  |  Analyser data og generer diagrammer  |  Aktiver Kutools funktioner...
Populære funktioner: Find, fremhæv eller identificer dubletter   |  Slet tomme rækker   |  Kombiner kolonner eller celler uden at miste data   |   Runde uden formel ...
Super opslag: VLookup med flere kriterier    Multiple Value VLookup  |   VOpslag på tværs af flere ark   |   Fuzzy Lookup ....
Avanceret rulleliste: Opret hurtigt rulleliste   |  Afhængig rulleliste   |  Multivælg rulleliste ....
Column Manager: Tilføj et bestemt antal kolonner  |  Flyt kolonner  |  Skift synlighedsstatus for skjulte kolonner  |  Sammenlign områder og kolonner ...
Fremhævede funktioner: Grid fokus   |  Designvisning   |   Stor Formel Bar    Arbejdsbog & Ark Manager   |  Ressourcebibliotek (Autotekst)   |  Datovælger   |  Kombiner regneark   |  Krypter/Dekrypter celler    Send e-mails efter liste   |  Superfilter   |   Specielt filter (filter fed/kursiv/gennemstreget...) ...
Top 15 værktøjssæt12 tekst Værktøjer (tilføje tekst, Fjern tegn, ...)   |   50 + Chart Typer (Gantt kort, ...)   |   40+ Praktisk formler (Beregn alder baseret på fødselsdag, ...)   |   19 Indsættelse Værktøjer (Indsæt QR-kode, Indsæt billede fra sti, ...)   |   12 Konvertering Værktøjer (Tal til ord, Valutaomregning, ...)   |   7 Flet og del Værktøjer (Avancerede kombinere rækker, Opdel celler, ...)   |   ... og mere

Overlad dine Excel-færdigheder med Kutools til Excel, og oplev effektivitet som aldrig før. Kutools til Excel tilbyder over 300 avancerede funktioner for at øge produktiviteten og spare tid.  Klik her for at få den funktion, du har mest brug for...

Beskrivelse


Fanen Office bringer en grænseflade til et kontor med Office, og gør dit arbejde meget lettere

  • Aktiver redigering og læsning af faner i Word, Excel, PowerPoint, Publisher, Access, Visio og Project.
  • Åbn og opret flere dokumenter i nye faner i det samme vindue snarere end i nye vinduer.
  • Øger din produktivitet med 50 % og reducerer hundredvis af museklik for dig hver dag!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The stock symbol for TrueCar Inc is "TRUE". When I sort the column containing the stock symbols, TRUE falls out of place at the end of the list. The cell is formatted as text. I am assuming that it is because "TRUE" has special meaning in Excel. Right now I am removing the "E", sorting the column so the row falls in the right place and then adding the E after the sort. Any ideas on a better approach?  
This comment was minimized by the moderator on the site
Hi, I have a similar sorting requirement, but with a unique problem ....
I have a range of Stock data which I need to sort in Category order.
The Range includes prices and one column has formulas.
The Category numbers range from 1 1a 1b etc to 32e.
I have continuously tried using a helper column with the formula =TEXT(K3,"###") - with K3 being the first Row in the Category column.
I select the helper column (N) and click Data - Sort - Expand the selection, but get no further as the "expansion" always selects from Row 40 - even if I select just a few rows in the helper column.
Why is this, and how can I sort my data correctly ?
Looking forward to a solution ....
Thanks.
Patrick.
This comment was minimized by the moderator on the site
Thanks for the tip on using a "helper column", but here's my question:

Is there a way to get the "related " columns to "tag along" with the sort precipitated by the helper column?

For example, column A contains a mixed-string product code that I can now sort into sequence using the "helper column" technique but, attached to that same product code are product descriptions, dimensions and other characteristics (some of which are also mixed-string in nature) in several other columns, and I need those to follow the "helper column" sort.

Any suggestions?

Much appreciated!

Lorne
This comment was minimized by the moderator on the site
I only see 1 method. Top of the article mentions that we will see 2 methods.
This comment was minimized by the moderator on the site
Hello, val,
Thank you for your comment, it is my mistake, I have deleted the second method from this article, and now, I have updated the article.

Thank you once more!
This comment was minimized by the moderator on the site
Trying to sort Alphanumeric with text. It is a fairly large list but below is an example. I can't strip the off the letter in a different column and sort by that because I have matching numbers that should come before them. I also can't really add a column to sort by and then hide that column - or delete it because I am constantly sorting the data. Any ideas? Will there be some formula? My current list: ---- What I want it to look like: 1 ---- 1 2 ---- 2 3 ---- 3 4 ---- 4 A1 ---- A1 A10 ---- A2 A100 ---- A3 A2 ---- A4 A20 ---- A5 A200 ---- A6 A3 ---- A7 A4 ---- A8 A5 ---- A9 A6 ---- A10 A60 ---- A20 A7 ---- A60 A8 ---- A100 A9 ---- A200
This comment was minimized by the moderator on the site
The easiest way I can think is to split the column into the Alpha part ("A") and the numeric part ("1") and then sort first by alpha then by numeric.
Your original 1,2,3,4 would need to stay in the alpha column to sort properly .

N.B. this might be a bit more difficult to achieve when the alpha part (the "A") is not a consistent length in your data. But definitely still possible.
This comment was minimized by the moderator on the site
I am running in the same problem. I have 1200 part numbers that I need to sort the way it's shown above but excel will put V15 after V1 if V14 is absent. I need V14 to appear after V9 or V8, where ever the part number ends.
This comment was minimized by the moderator on the site
Trying to sort Alphanumeric with text. It is a fairly large list but below is an example. I can't strip the off the letter in a different column and sort by that because I have matching numbers that should come before them. I also can't really add a column to sort by and then hide that column - or delete it because I am constantly sorting the data. Any ideas? My current list: ---- What I want it to look like: 1 ---- 1 2 ---- 2 3 ---- 3 4 ---- 4 A1 ---- A1 A10 ---- A2 A100 ---- A3 A2 ---- A4 A20 ---- A5 A200 ---- A6 A3 ---- A7 A4 ---- A8 A5 ---- A9 A6 ---- A10 A60 ---- A20 A7 ---- A60 A8 ---- A100 A9 ---- A200
This comment was minimized by the moderator on the site
When I do this, the column sorts by individual character and I don't get the right order. For instance, if I have the following data: A1: 1 A2: 2 A3: 1a1 A4: 12 A5: 1a2 I want them to be sorted like this: A1: 1 A2: 1a1 A3: 1a2 A4: 2 A5: 12 Just sorting the column normally I end up with this: A1: 1 A2: 2 A3: 12 A4: 1a1 A5: 1a2 Where the numbers are sorted correctly and then the alphanumeric values are sorted correctly, but the two are not sorted together. When I use the method in the article, I end up with this: A1: 1 A2: 12 A3: 1a1 A4: 1a2 A5: 2 Where the numeric and alphanumeric data are sorted together but incorrectly (12 should come after 2). Why is this happening?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations