Ga naar hoofdinhoud

Hoe initialen uit namen in Excel te extraheren?

Wanneer u klantrecords verwerkt of mail merge uitvoert, kan het handig zijn voor u om initialen van een bepaalde naam te krijgen, bijvoorbeeld HG voor Hal Greer. Dus hier introduceer ik enkele trucs om snel initialen uit de namenlijst in Excel te extraheren.

Extraheer initialen met formule in Excel

Extract initialen gebruiken Defined Function in Excel


pijl blauw rechts bel Extraheer initialen met formule in Excel

De eerste methode is het gebruik van een formule om initialen uit namen in Microsoft Excel te extraheren.

Selecteer een lege cel, bijvoorbeeld Cel C2, typ deze formule =LEFT(A2)&IF(ISNUMBER(FIND(" ",A2)),MID(A2,FIND(" ",A2)+1,1),"")&IF(ISNUMBER(FIND(" ",A2,FIND(" ",A2)+1)),MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,1),"")(A2 is de eerste cel van uw namenlijst), druk op Enter en sleep vervolgens de vulgreep om het bereik te vullen. Nu zie je dat alle initialen van elke naam uit de namenlijst zijn gehaald.


pijl blauw rechts bel Extract initialen gebruiken Defined Function in Excel

Naast de formule kunt u de gedefinieerde functie gebruiken om initialen eenvoudig uit opgegeven namen te extraheren in Microsoft Excel.

1. Selecteer een cel van de kolom die u wilt selecteren en druk op Alt + F11 om de te openen Microsoft Visual Basic voor toepassingen venster.

2. Klik in het pop-upvenster op Invoegen > Moduleen plak vervolgens de volgende VBA-code in de module.

VBA: extraheer initialen uit namen

Function FirstCharacters(pWorkRng As Range) As String
'Updateby20140514
Dim arr As Variant
Dim xValue As String
Dim OutValue As String
xValue = pWorkRng.Value
arr = VBA.Split(Trim(xValue))
For i = 0 To UBound(arr)
    OutValue = OutValue & VBA.Left(arr(i), 1) & "."
Next
FirstCharacters = OutValue
End Function

3. Sla de code op en sluit het venster, selecteer een lege cel en typ deze formule = Eerste tekens (A2), Druk dan op Enter en sleep de vulgreep om het gewenste bereik te vullen. Daarna kunt u zien dat de initialen van elke naam worden ge毛xtraheerd.

Tip: U kunt de scheidingstekens wijzigen "" van de initialen zoals je nodig hebt in de bovenstaande VBA.


Relatieve artikelen:

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 (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello,
I need to extend this code to 4 initials, but I don鈥檛 understand how to extend it.

=LEFT(A2)&IF(ISNUMBER(FIND(" ",A2)),MID(A2,FIND(" ",A2)+1,1),"")&IF(ISNUMBER(FIND(" ",A2,FIND(" ",A2)+1)),MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,1),"")

Please can you explain how to add another layer to this formula?
This comment was minimized by the moderator on the site
Hi, use the formula like this:
=LEFT(A2)&IF(ISNUMBER(FIND(" ",A2)),MID(A2,FIND(" ",A2)+1,1),"")&IF(ISNUMBER(FIND(" ",A2,FIND(" ",A2)+1)),MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,1),"")&IF(ISNUMBER(FIND(" ",A2,FIND(" ",A2)+1)),MID(A2,FIND(" ",A2,FIND(" ",A2,FIND(" ",A2)+1)+1)+1,1),"")

About the explaination, it not few words can explan. You may know what the functions in the formula is used for what destination. If you want to learn the function, you can visit this site: https://www.extendoffice.com/excel/functions.html
This comment was minimized by the moderator on the site
Thank you so much. This worked perfectly.
This comment was minimized by the moderator on the site
If u need the prefix of Mr., Ms. or Mrs. can add it in the beginning as =LEFT(A2,SEARCH(" ",A2))&
This comment was minimized by the moderator on the site
Very good formula to get the initials from a name. But if the name contains with Mr., Ms. or Mrs. then this does not work. We have to separate put this prefix first. For that you can replace the A2 with TRIM(MID(A2,SEARCH(" ",A2)+1,100)) . So the formula will be as under
=LEFT(TRIM(MID(A2,SEARCH(" ",A2)+1,100)) )&IF(ISNUMBER(FIND(" ",TRIM(MID(A2,SEARCH(" ",A2)+1,100)) )),MID(TRIM(MID(A2,SEARCH(" ",A2)+1,100)),FIND(" ",TRIM(MID(A2,SEARCH(" ",A2)+1,100)) )+1,1),"")&IF(ISNUMBER(FIND(" ",TRIM(MID(A2,SEARCH(" ",A2)+1,100)),FIND(" ",TRIM(MID(A2,SEARCH(" ",A2)+1,100)) )+1)),MID(TRIM(MID(A2,SEARCH(" ",A2)+1,100)),FIND(" ",TRIM(MID(A2,SEARCH(" ",A2)+1,100)),FIND(" ",TRIM(MID(A2,SEARCH(" ",A2)+1,100)) )+1)+1,1),"")
This comment was minimized by the moderator on the site
Thank you for this!! I had been struggling with getting initials from a last name with a space or hyphen and was able to use this formula as-is, with the addition of another IF that searched for a hyphen. A huge relief!!
This comment was minimized by the moderator on the site
I used the formula above, but if the person does not put a space between their first / last name, how do you keep that from error out?
This comment was minimized by the moderator on the site
Amazing Thank you!
This comment was minimized by the moderator on the site
hi there
I Want to sort full name in to a new format if excel cell has text character more than 25 how to show it in initials and last name
Ex 01:- name has more than 25 characters
Full Name : Mildred Dresselhaus Lene Vestergaard Hau
Show as : M.D.L Vestergaard Hau
(it may add if more initials are ther for a long name)
Ex 02:-
Full Name : Enrico Fermi
Show as : Enrico Fermi
This comment was minimized by the moderator on the site
If the text contains more than 03 words
This comment was minimized by the moderator on the site
This works!!! Thank you!
This comment was minimized by the moderator on the site
Thank you! :lol: quite useful!
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