Ga naar hoofdinhoud

Hoe extraheer ik tekst voor / na de tweede spatie of komma in Excel? 

In Excel kan de functie Tekst naar kolommen u helpen om elke tekst uit de ene cel in afzonderlijke cellen te extraheren door middel van een spatie, komma of andere scheidingstekens, maar heeft u ooit geprobeerd de tekst voor of na de tweede spatie of komma uit een cel te extraheren? in Excel zoals volgend screenshot getoond? In dit artikel zal ik enkele methoden bespreken om met deze taak om te gaan.

doc-extract vóór tweede spatie 1

Extraheer tekst vóór de tweede spatie of komma met formule

Extraheer tekst na de tweede spatie of komma met formule


pijl blauw rechts bel Extraheer tekst vóór de tweede spatie of komma met formule

Pas de volgende formule toe om de tekst vóór de tweede spatie te krijgen:

Voer deze formule in: = ALS (ISFOUT (FIND ("", A2, FIND ("", A2,1) +1)), A2, LEFT (A2, FIND ("", A2, FIND ("", A2,1) +1 ))) in een lege cel waar u het resultaat wilt vinden, C2, bijvoorbeeld, en sleep vervolgens de vulgreep omlaag naar de cellen waarin u deze formule wilt hebben, en alle tekst voordat de tweede spatie uit elke cel is geëxtraheerd, zie screenshot:

doc-extract vóór tweede spatie 2

Note: Als u de tekst vóór de tweede komma of andere scheidingstekens wilt extraheren, vervangt u de spatie in de formule door komma's of andere scheidingstekens. Zoals: =IF(ISERROR(FIND(",",A2,FIND(",",A2,1)+1)),A2,LEFT(A2,FIND(",",A2,FIND(",",A2,1)+1))).


pijl blauw rechts bel Extraheer tekst na de tweede spatie of komma met formule

Om de tekst na de tweede spatie terug te geven, kan de volgende formule u helpen.

Voer deze formule in: = MID (A2, FIND ("", A2, FIND ("", A2) +1) +1,256) in een lege cel om het resultaat te lokaliseren en sleep vervolgens de vulgreep naar de cellen om deze formule te vullen, en alle tekst nadat de tweede spatie in één keer is geëxtraheerd, zie screenshot:

doc-extract vóór tweede spatie 3

Opmerking: Als u de tekst na de tweede komma of andere scheidingstekens wilt extraheren, hoeft u alleen de spatie te vervangen door komma's of andere scheidingstekens in de formule. Zoals: = MID (A2, FIND (",", A2, FIND (",", A2) +1) +1,256).

Beste Office-productiviteitstools

🤖 Kutools AI-assistent: Een revolutie teweegbrengen in de data-analyse op basis van: Intelligente uitvoering   |  Genereer code  |  Aangepaste formules maken  |  Analyseer gegevens en genereer grafieken  |  Roep Kutools-functies aan...
Populaire functies: Zoek, markeer of identificeer duplicaten   |  Verwijder lege rijen   |  Combineer kolommen of cellen zonder gegevens te verliezen   |   Ronde zonder formule ...
Super opzoeken: Meerdere criteria VLookup    VLookup met meerdere waarden  |   VOpzoeken over meerdere bladen   |   Fuzzy opzoeken ....
Geavanceerde vervolgkeuzelijst: Maak snel een vervolgkeuzelijst   |  Afhankelijke vervolgkeuzelijst   |  Multi-select vervolgkeuzelijst ....
Kolom Beheerder: Voeg een specifiek aantal kolommen toe  |  Kolommen verplaatsen  |  Schakel de zichtbaarheidsstatus van verborgen kolommen in  |  Vergelijk bereiken en kolommen ...
Uitgelichte functies: Raster focus   |  Ontwerpweergave   |   Grote formulebalk    Werkmap- en bladbeheer   |  resource Library (Auto-tekst)   |  Datumkiezer   |  Combineer werkbladen   |  Cellen coderen/decoderen    Stuur e-mails per lijst   |  Super filter   |   Speciaal filter (filter vet/cursief/doorhalen...) ...
Top 15 gereedschapsets12 Tekst Tools (toe te voegen tekst, Tekens verwijderen, ...)   |   50+ tabel Types (Gantt Chart, ...)   |   40+ Praktisch Formules (Bereken leeftijd op basis van verjaardag, ...)   |   19 Invoeging Tools (QR-code invoegen, Afbeelding invoegen vanaf pad, ...)   |   12 Camper ombouw Tools (Getallen naar woorden, Currency Conversion, ...)   |   7 Samenvoegen en splitsen Tools (Geavanceerd Combineer rijen, Gespleten cellen, ...)   |   ... en meer

Geef uw Excel-vaardigheden een boost met Kutools voor Excel en ervaar efficiëntie als nooit tevoren. Kutools voor Excel biedt meer dan 300 geavanceerde functies om de productiviteit te verhogen en tijd te besparen.  Klik hier om de functie te krijgen die u het meest nodig heeft...

Omschrijving


Office-tabblad Brengt een interface met tabbladen naar Office en maakt uw werk veel gemakkelijker

  • Schakel bewerken en lezen met tabbladen in Word, Excel, PowerPoint in, Publisher, Access, Visio en Project.
  • Open en maak meerdere documenten in nieuwe tabbladen van hetzelfde venster in plaats van in nieuwe vensters.
  • Verhoogt uw productiviteit met 50% en vermindert honderden muisklikken voor u elke dag!
Comments (28)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, I want to extract each values after underscore. How do I do that. I am familiar with delimiter, but want to learn the formula to do that.

Brush_25mm_Orange_Skid_110cm
Polish_25mm_Orange_Toast_100cm
Car_25mm_White_Tyre_120cm
Paint_25mm_Red_Reflective_95cm
This comment was minimized by the moderator on the site
Edit - I see this was already addressed by Dave - thank you sir! skyyang can you please edit the incorrect solution to "Extract Text Before The Second Delimiter" with the correct equation logic?
This comment was minimized by the moderator on the site
Hello There

I have a scenario in 4 types as below in a excel chart

Type 1 : FX01865-CWB-22F
Type 2 : CD30250-AJX-2D-AB
Type 3 : DF10250-MUR-JH-B
Type 4 : YZ00250-MDS-4T-BHR

To all cases, I want to extract only the BOLD TEXT as an answer in the adjacent cells

Please help share formula

ThanksSaran

This comment was minimized by the moderator on the site
I have the text like this
LAXMI RANI DELHI DELHI CG012054567IN CA
so, I want the text to be arranged in excel like this
LAXMI RANI(1st cell ) DELHI(2nd cell) DELHI (3rd cell) CG012054567IN (4th cell) CA(5th cell)
This comment was minimized by the moderator on the site
Hi, rangaih,To deal with your problem, first, you can split your cell values based on space by using the Text to Columns feature, after spliting the text strings, you just need to combine the fisrt two cell values as you need.Please try, thank you!
This comment was minimized by the moderator on the site
Hi, I have a long string in a single cell and want to extract all the information after each Product ID. Product ID: 686, Product Qty: 1, Product SKU: RUB 100, Product Name: Emu Oil Rub 100g, Product Weight: 0.2000, Product Variation Details: |Product ID: 691, Product Qty: 1, Product SKU: MOIST 100, Product Name: Emu Oil Moisturiser 100g, Product Weight: 0.1900, Product Variation Details: , |Product ID: 705, Product Qty: 3, Product SKU: WASH 250, Product Name: Natural Hand & Body Wash with Emu Oil 250ml, Product Weight: 0.4000, Product Variation Details: I need the quantity in one cell and the product name in another cell for each of the products after Product ID. Can you help?
This comment was minimized by the moderator on the site
In my scenario There are three “-“ and sometimes one “-“
before second “-“ text should be enter
if in cell only one “-“ it should be blank

e.g As-01-14-32 answers like thisAs-01

e.g As-01 answer Blank cell

what will be farmula?
This comment was minimized by the moderator on the site
Hello, Bil,
To solve your problem, please apply the below formula:
=IFERROR(LEFT(A1,FIND("#",SUBSTITUTE(A1,"-","#",2))-1),"")
Please try it, thank you!
This comment was minimized by the moderator on the site
Hi
I need help if i want to extract anything after first comma and before last comma.
"Flat 135 Nevendon Road, Sally,Wickford, SS12 0NL"

Column A = Flat 135 Nevendon Road
Column B = Sally,Wickford
Columns C = SS12 0NL
This comment was minimized by the moderator on the site
Hello, Jayaswal,
To solve your porblem, please apply the following formulas:
First part--Cell B1: =LEFT(A1,FIND(",",A1,1)-1)
Second part--Cell C1: =MID(A1,FIND(",",A1)+1,LOOKUP(1,0/(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)=","),ROW(INDIRECT("1:"&LEN(A1))))-FIND(",",A1)-1)
Third part--Cell D1: =MID(A1,FIND("=",SUBSTITUTE(A1,",","=",LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))+1,256)

Pleasr try, hope it can help you!
This comment was minimized by the moderator on the site
It’s working, thanks
This comment was minimized by the moderator on the site
One more thing
after third”-“all text should remain even 1 or 10 otherwise blank
e.g A-01-12-As answer As
e.g A-01-12-Asty answer Asty
e.g A-01 answer blank
This comment was minimized by the moderator on the site
Hi,
May be the below formula can solve your task, please try:
=IFERROR(TRIM(MID(A1,FIND("#",SUBSTITUTE(A1,"-","#",3))+1,255)),"")
This comment was minimized by the moderator on the site
Fine thanks
This comment was minimized by the moderator on the site
How can I extract Text 1 and Text 2 from a string like Text 1_Text 2_Text 3_Text 4
This comment was minimized by the moderator on the site
how do I do this from right to left. Basically, want to extract last two words.
This comment was minimized by the moderator on the site
Hi, demo,
To extract and return the last two words from text strings, please apply the below formula:
=IF((LEN(A1)-LEN(SUBSTITUTE(A1," ","")))<2,A1,RIGHT(A1,LEN(A1)-FIND("/",SUBSTITUTE(A1," ","/",(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1)))))

Please try, hope it can help you!
This comment was minimized by the moderator on the site
THANK YOU!!!
This comment was minimized by the moderator on the site
Is there a way to extract various pieces of this string? 123ABC.01.02.03.04 ---- for example, to pull the 123ABC, and then in the next column pull 123ABC.01, and then 123ABC.01.02, then 123ABC.01.02.03, and so on.
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