Hoppa till huvudinnehåll

Hur delar jag text med mellanslag / komma / avgränsare i Excel?

Om du har en kolumnlista med data och du vill dela upp dem i flera kolumner med en specifik avgränsare precis som nedanstående skärmdumpar, hur kan du dela dem i Excel? Kanske tänker vissa användare bara på funktionen Text to Column, men nu kommer jag inte bara att presentera Text to Column-funktionen utan också en VBA-kod för dig.


Dela textsträngar i flera kolumner efter mellanslag / komma / avgränsare med funktionen Text till kolumner

Text till kolumner-funktionen är mycket användbar för att dela en lista till flera kolumner i Excel. Den här metoden talar om hur man delar upp data med angiven avgränsare med funktionen Text till kolumn i Excel. Gör så här:

1. Välj den kolumnlista som du vill dela med avgränsare och klicka på Data > Text till kolumner. Se skärmdump:

2. Sedan a Konvertera text till kolumner dialogrutan dyker upp och kontrollera avgränsad alternativet och klicka på Nästa knapp. Se skärmdump:

3. I dialogrutan Öppna guiden Konvertera till text till kolumner - Steg 2 av 3, kontrollera avgränsaren som du behöver för att dela upp data med.

Anmärkningar: Om du behöver dela din textsträng med en särskild avgränsare, vänligen kontrollera Övriga och skriv sedan avgränsaren i följande ruta.

4. klick Finish. Nu kan du se att kolumnlistan i valet har delats upp i flera kolumner av den angivna avgränsaren.

Extrahera siffror (eller text) endast från en cell / kolumn till olika kolumner / rader

Kutools för Excel förbättrar dess Dela celler verktyg och stöd för att batch-extrahera alla texttecken eller nummer från en cell / kolumn i två kolumner / rader.



Kutools för Excel - Superladda Excel med över 300 viktiga verktyg. Njut av en fullfjädrad 30-dagars GRATIS provperiod utan behov av kreditkort! Hämta den nu

Dela textsträngar i flera rader / kolumner efter mellanslag / komma / avgränsare med Kutools för Excel

Ovanstående metod kan bara dela textsträngar i flera kolumner. Denna metod kommer att introducera Kutools för Excel Dela celler verktyget för att enkelt dela upp textsträngar i flera rader eller kolumner med angiven avgränsare i Excel.

Kutools för Excel - Fullpackad med över 300 viktiga verktyg för Excel. Njut av en fullfjädrad 30-dagars GRATIS provperiod utan behov av kreditkort! Ladda ner nu!

1. Välj det intervall du vill dela textsträngar (i vårt fall väljer vi intervallet A1: A9) och klicka Kutools > text > Dela celler.
doc delad text 01

2. I dialogrutan Öppna delade celler, kontrollera Dela till rader alternativ eller Dela upp till kolumner alternativ som du behöver i Typ avsnitt, ange sedan en avgränsare i Ange en separator avsnittet och klicka på Ok knapp. Se skärmdump ovan:

Nu dyker en annan dialogruta uppdelade celler fram, välj den första cellen i destinationsområdet och klicka på OK knapp.
doc delade text till rader kolumner 10

Kutools för Excel - Superladda Excel med över 300 viktiga verktyg. Njut av en fullfjädrad 30-dagars GRATIS provperiod utan behov av kreditkort! Hämta den nu


Demo: Dela textsträngar i flera rader / kolumner efter mellanslag / komma / avgränsare


Kutools för Excel: Över 300 praktiska verktyg till hands! Börja din 30-dagars gratis provperiod utan funktionsbegränsningar idag. Ladda ner nu!


Relativa artiklar:

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
Comments (29)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi
I have a string like a, b,c,d,,a,d,e,f,a,b,f... etc. I want to replace a value of 'd' which having a Position of 7th after delimiter. Can you suggest how to find a position after delimiter and replace exact Position value.
This comment was minimized by the moderator on the site
Hi, Kanchan, here is a code you can try:
Sub changeText()
    Dim xSplit, xStr As String
    Dim xPos As Integer
    Dim xArr As Variant
    Dim xRng, xSetRng As Range
    On Error Resume Next
    Set xRng = Application.InputBox("Select the cell you want to extract:", "Kutools for Excel", , , , , , 8)
    xSplit = Application.InputBox("Type the delimiter:", "Kutools for Excel", , , , , , 2)
    xPos = Application.InputBox("Type nth delimiter:", "Kutools for Excel", , , , , , 1)
    xStr = Application.InputBox("Type the string or character you want to replace with:", "Kutools for Excel", , , , , , 2)
    Set xSetRng = Application.InputBox("Select the cell to place result:", "Kutools for Excel", , , , , , 8)
    xArr = Split(xRng.Text, xSplit)
    xArr(xPos) = xStr
    xSetRng.Value = Join(xArr, ",")
End Sub

Hope it can help you.
This comment was minimized by the moderator on the site
hi ,

i have flat file which having delimiter so i want to read the value of passing position having before and after delimiter. is there any way to get these vale
This comment was minimized by the moderator on the site
Hi, I do not understand your problem clearly. If you want to get the values before and after a specific delimiter separately, the both of methods mentioned in this tutorial can help you, you just need to change the delimiter to your need, and follow the steps to finish. Or you can give me more details about your problem for me to get it clearly.
This comment was minimized by the moderator on the site
Thank you This Saved my time !
This comment was minimized by the moderator on the site
thanks so much, this really made my life easier!
This comment was minimized by the moderator on the site
How do we split kyzwell5konfgwell3k into columns. I need only the on has to be selected as delimit and separate into two words.
This comment was minimized by the moderator on the site
Hi Sunny,
The Text to Columns (Excel built-in feature) supports to split a cell to columns by a given character, and the Split Cells feature of Kutools for Excel also supports to split cells by one character.
If you need to split cells by a string of characters, you’d better apply a VBA macro.
This comment was minimized by the moderator on the site
This just shows how horrible excel is...how about a SPLIT function?? Duh...
This comment was minimized by the moderator on the site
Hi Bob,
Kutools for Excel has released this feature – Split Cells. This feature can not only split cells by all kinds of delimiters to columns, but also split cells to rows. What’s more, it supports to split number and text from selected cells too.
This comment was minimized by the moderator on the site
Ok, so here is a problem I am stuck on that I cannot seem to resolve. I am looking to break up a long string of text with the following requirements:
1) Text can only be broken up at a space (not in the middle of a word)
2) The total length for each parsed cell must be as close to 40 characters as it can get using the space rule above.

For example, this comes in a single cell: "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief". In this example, I would expect the formula to break up this text into 4 cells:

It was the best of times, it was the
worst of times, it was the age of
wisdom, it was the age of foolishness,
it was the epoch of belief

I keep getting wrapped around the axle trying to use a combo of left,mid,right and search/find formulas, but not only is it very inelegant, but as soon as I run into a non-unique word, my find formula breaks down.
This comment was minimized by the moderator on the site
Thanks. It is really helpful.
This comment was minimized by the moderator on the site
Hello, How do i separete a long sentence into columns like


12534_MK_EC0102-Kanyuambora_OUTA 172.22.118.13 255.255.255.192 172.22.118.1. I need the process of separating to columns of: Site ID 12534_MK_EC0102; Site Name Kanyuambora_OUTA;IP 172.22.118; Mask 255.255.255; Gateway 172.22.118.1. Kindly assist.
This comment was minimized by the moderator on the site
Hi Cosmas,
How do you want to split the lone sentences by? In your example, you can split the sentence by the delimiter “_” or “;” or “.”
Just try them as you need!
This comment was minimized by the moderator on the site
You can use the FIND and LEN commands to separate fields, for example :
A1: 12534_MK_EC0102-Kanyuambora_OUTA 172.22.118.13 255.255.255.192 172.22.118.1.
B1: =FIND(" ",$A$1) B2: =FIND(" ",$A$1,B1+1) B3: "Fill Down From B2"
C1: =LEFT($A$1,B1) C2: =RIGHT(LEFT($A$1,B2),B2-B1) C3: "Fill Down From C2"
This comment was minimized by the moderator on the site
Hi Cosmas,
You can apply the Text to Columns feature on the Data tab in Excel Ribbon. In the Wizard, please set both delimiters of space and custom delimiters -, and it will split your long cell content to desired columns.
This comment was minimized by the moderator on the site
Thank you so much for posting this, it's really very helpful at times.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations