Note: The other languages of the website are Google-translated. Back to English
Se connecter  \/ 
x
or
x
INSCRIPTION  \/ 
x

or

Comment retourner le prénom et le nom dans les cellules dans Excel?

Disons que vous obtenez une liste de noms dans une colonne, cependant, vous devez retourner le prénom et le nom de famille dans les cellules. Normalement, vous entrez dans une cellule et coupez le nom de famille, puis collez-le avant le prénom ou retapez le nom. Ce sera long et fastidieux si vous utilisez ces méthodes traditionnelles. En fait, il existe plusieurs façons simples de retourner ou d'inverser rapidement le prénom et le nom dans une seule colonne. Supposons que vous ayez une colonne de noms et que vous deviez retourner le prénom et le nom comme illustré ci-dessous:
doc flip prénoms 1

Retourner le prénom et le nom dans une colonne avec une fonction

Retourner le prénom et le nom dans une colonne avec VBA

Retournez le prénom et le nom dans une colonne avec Kutools for Excelbonne idée3

Diviser le nom complet en prénom et nom avec Kutools for Excelbonne idée3


Retourner le prénom et le nom dans une colonne avec une fonction

Nous pouvons utiliser l'une des formules d'Excel pour retourner rapidement le prénom et le nom dans une colonne avec les étapes suivantes:

 Entrez la formule =MID(A2&" "&A2,FIND(" ",A2)+1,LEN(A2)) dans une cellule vide, dit la cellule C2. Et puis faites glisser la poignée de remplissage vers les cellules pour appliquer cette formule, puis vous pouvez voir que tous les noms et prénoms ont été vénérés. Voir la capture d'écran:

doc flip prénoms 2


Retourner le prénom et le nom dans une colonne avec VBA

Vous pouvez également utiliser des macros VBA pour retourner rapidement le prénom et le nom dans une colonne.

1. Maintenez la touche Alt + F11 clés dans Excel, et il ouvre le Microsoft Visual Basic pour applications fenêtre.

2.  Cliquez insérer > Moduleet collez la macro suivante dans le Module fenêtre.

Sub FlipName()
'Updateby20131126
Dim Rng As Range
Dim WorkRng As Range
Dim Sign As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Sign = Application.InputBox("Symbol interval", xTitleId, " ", Type:=2)
For Each Rng In WorkRng
    xValue = Rng.Value
    NameList = VBA.Split(xValue, Sign)
    If UBound(NameList) = 1 Then
        Rng.Value = NameList(1) + Sign + NameList(0)
    End If
Next
End Sub

3. appuie sur le F5 clé pour exécuter cette macro. Dans le popping KutoolsforExcel boîte de dialogue, sélectionnez la plage à inverser, puis cliquez sur le OK bouton. Voir la capture d'écran:

doc flip prénoms 3

4. Dans la boîte de dialogue contextuelle suivante, entrez un symbole d'intervalle (tel qu'un espace), puis cliquez sur le bouton OK bouton. Voir la capture d'écran:

doc flip prénoms 4

5. Maintenant, le prénom et le nom de la plage sélectionnée sont inversés. Voir la capture d'écran:

doc flip prénoms 5


Retournez le prénom et le nom dans une colonne avec Kutools for Excel

Avec Kutools pour Excel's Reverse Text Order, vous pouvez rapidement inverser l'ordre du texte dans les cellules.

Kutools pour Excel: Un outil complémentaire pratique d'Excel, rend vos travaux plus faciles et plus efficaces.
  • Plus de 300 des fonctions puissantes et faciles à utiliser,Plus de 110,000 Choix des utilisateurs Excel
  • complet essai gratuit en 30 jours, Pas de carte de crédit nécessaire
  • des dizaines de fonctions en un clic pour réduire votre temps de travail sur la résolution de problèmes complexes
  • comprend des fonctions de conversion par lots, de suppression, de combinaison de feuilles / cellules, d'exprotage, d'ect, d'essayer gratuitement maintenant.

Après l'installation de Kutools for Excel, procédez comme suit:(Téléchargez gratuitement Kutools pour Excel maintenant!)

1.  Sélectionnez la plage dans laquelle vous souhaitez inverser le prénom et le nom.

2.  Cliquez Kutools > Text > Reverse Text Order, voir capture d'écran:

doc flip prénoms 8

3. dans le Reverse Text boîte de dialogue, spécifiez un séparateur de la chaîne de texte sélectionnée à l'aide de, (dans ce cas, je sélectionne Space option) puis cliquez sur le OK bouton. Et tous les prénoms et noms de famille de la plage sélectionnée ont été inversés. Voir la capture d'écran:

doc flip prénoms 7

Notes: Vérification Skip non-text cellules pour vous empêcher d'inverser les nombres dans la plage sélectionnée.


Démo: retourner / inverser le prénom et le nom dans les cellules


Diviser le nom complet en prénom et nom avec Kutools for Excel

Après l'installation de Kutools for Excel, procédez comme suit:(Téléchargez gratuitement Kutools pour Excel maintenant!)

Si vous avez une liste de noms complets qui doivent être divisés en prénom et nom en deux colonnes séparément, comme illustré ci-dessous, vous pouvez appliquer Kutools for Excel's Split Names pour le gérer rapidement.
doc flip prénoms 9

1. Sélectionnez la liste des noms que vous souhaitez fractionner, cliquez sur Kutools > Merge & Split > Split Names.
doc flip prénoms 10

2. dans le Split Names boîte de dialogue, vérifier First name et Last name cases à cocher, si vous souhaitez diviser également le deuxième prénom, cochez Middle name. Cliquez Ok, sélectionnez une cellule pour placer les noms de division.
doc flip prénoms 11



Kutools for Excel: plus de 300 fonctions que vous devez avoir dans Excel, Essai gratuit de 30 jours à partir d'ici.


Les meilleurs outils de productivité de bureau

Kutools for Excel résout la plupart de vos problèmes et augmente votre productivité de 80%

  • Réutilisation: Insérer rapidement formules complexes, graphiques et tout ce que vous avez utilisé auparavant; Crypter les cellules avec mot de passe; Créer une liste de diffusion et envoyer des e-mails ...
  • Barre Super Formula (modifiez facilement plusieurs lignes de texte et de formule); Disposition de lecture (lire et modifier facilement un grand nombre de cellules); Coller dans la plage filtrée...
  • Fusionner les cellules / lignes / colonnes sans perdre de données; Contenu des cellules divisées; Combiner des lignes / colonnes en double... Empêcher les cellules en double; Comparer les gammes...
  • Sélectionnez Dupliquer ou Unique Lignes; Sélectionnez les lignes vides (toutes les cellules sont vides); Super Find et Fuzzy Find dans de nombreux classeurs; Sélection aléatoire ...
  • Copie exacte Plusieurs cellules sans changer la référence de formule; Créer automatiquement des références à plusieurs feuilles; Insérer des puces, Cases à cocher et plus encore ...
  • Extrait du texte, Ajouter du texte, Supprimer par position, Supprimer l'espace; Créer et imprimer des sous-totaux de pagination; Conversion entre le contenu et les commentaires des cellules...
  • Super filtre (enregistrer et appliquer des schémas de filtrage à d'autres feuilles); Tri avancé par mois / semaine / jour, fréquence et plus; Filtre spécial par gras, italique ...
  • Combiner des classeurs et des feuilles de travail; Fusionner les tableaux en fonction des colonnes clés; Diviser les données en plusieurs feuilles; Conversion par lots xls, xlsx et PDF...
  • Plus de 300 fonctionnalités puissantes. Prend en charge Office / Excel 2007-2019 et 365. Prend en charge toutes les langues. Déploiement facile dans votre entreprise ou organisation. Essai gratuit de 30 jours. Garantie de remboursement de 60 jours.
onglet kte 201905

Office Tab apporte une interface à onglets à Office et simplifie considérablement votre travail

  • Activer l'édition et la lecture par onglets dans Word, Excel, PowerPoint, Publisher, Access, Visio et Project.
  • Ouvrez et créez plusieurs documents dans de nouveaux onglets de la même fenêtre, plutôt que dans de nouvelles fenêtres.
  • Augmente votre productivité de 50% et réduit des centaines de clics de souris chaque jour!
bas de cabine
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Evelyn · 1 years ago
    Thank you sooo very much! You made work easier for me!
  • To post as a guest, your comment is unpublished.
    mribbon9 · 2 years ago
    =MID(A2&", "&A2,FIND(" ",A2)+1,LEN(A2)+1)

    where the name is on the A2 cell
    • To post as a guest, your comment is unpublished.
      Mary · 1 years ago
      You saved my life!!! Thank you. None of the others worked. This is exactly what I needed.
  • To post as a guest, your comment is unpublished.
    mribbon9 · 2 years ago
    =MID(O4&", "&O4,FIND(" ",O4)+1,LEN(O4)+1)
  • To post as a guest, your comment is unpublished.
    Mike · 3 years ago
    okay. can someone say this in english because I have no clue what you guys are talking about
  • To post as a guest, your comment is unpublished.
    John · 3 years ago
    Try this to add a comma: =MID(A2&", "&A2,FIND(" ",A2)+1,LEN(A2)+1)
    • To post as a guest, your comment is unpublished.
      savvy · 11 months ago
      THANK YOU literally I've been trying to figure out the comma thing for like an hour. Thank you!
  • To post as a guest, your comment is unpublished.
    Jill · 3 years ago
    What if I need to insert a comma between the last and first name?
  • To post as a guest, your comment is unpublished.
    Ted · 4 years ago
    What if there is a comma separating the 2 names? Is there a way to eliminate it? Now the names look like

    Arthur Lange,

    Eric Norris,

    etc etc

    • To post as a guest, your comment is unpublished.
      Guest · 2 years ago
      Try this to remove a comma: =MID(A2&" "&A2,FIND(", ",A2)+1,LEN(A2)+1)
    • To post as a guest, your comment is unpublished.
      Kody · 4 years ago
      Have you tried Ctrl+F, Select Replace, Find "," and leave replace with blank.
      • To post as a guest, your comment is unpublished.
        Brittany · 4 years ago
        When I try that, it pops up with this error message "There's a problem with this formula. Not trying to type a formula? When the first character is an equal (=) or minus (-) sign, Excel thinks it's a formula: you type: =1+1, cell shows: 2. To get around this, type an apostrophe (') first: you type: '=1+1, cell shows =1+1.
        • To post as a guest, your comment is unpublished.
          Ric · 4 years ago
          I think you are changing the formula. Try copying and pasting the values to a new cell then do the find/replace.
    • To post as a guest, your comment is unpublished.
      Kaity · 4 years ago
      I want to know this too!
  • To post as a guest, your comment is unpublished.
    Danny · 4 years ago
    Correction. What if i have four names? What's the formula?
    Last name - first name - middle1 - middle2
  • To post as a guest, your comment is unpublished.
    Danny · 4 years ago
    If you have middle name how do you flip the last name? Example below.
    Last name - first name - middle name
    • To post as a guest, your comment is unpublished.
      Arev · 4 years ago
      Instead of +1, change the plus factor to two numbers greater than the middle name. This has worked for me.

      Arev
  • To post as a guest, your comment is unpublished.
    Mary · 5 years ago
    THANKS!!!!! This formula just saved me a bunch of time. I am sure I will use it again and again.
  • To post as a guest, your comment is unpublished.
    Jam Smith · 5 years ago
    Please help I need a formula to flip Alexa Victoria G. Garcia to Garcia, Alexa Victoria G.

    Please help :) Thank you
  • To post as a guest, your comment is unpublished.
    Dr. Demento · 6 years ago
    A suggestion - In an effort to encourage good programming practices (Option Explicit), please dim all variables.
  • To post as a guest, your comment is unpublished.
    Raj · 6 years ago
    I would like excel updates
  • To post as a guest, your comment is unpublished.
    Sureshkumar · 6 years ago
    Hello,

    How to reverse the name in the format Lastname,Firstname to Firstname Lastname

    Lets say Paul,John = John Paul
    • To post as a guest, your comment is unpublished.
      Mike Gagne · 6 years ago
      Switching around the last, first is actually a little easier because we have that comma to help us. Assume that the name is in cell A1 and the formula used is:

      TRIM(RIGHT(A1,LEN($A1)-FIND(",",A1,1)))&" "&TRIM(LEFT(A1,FIND(",",A1,1)-1))

      I put the TRIM command on both the first and last names to ensure that we are only going to have the single space between the two. Probably doesn't need the TRIM on the last name, but you never know if a space may be the first character of the cell or if there may be a space preceding the comma.
  • To post as a guest, your comment is unpublished.
    Lea Carol Glennon · 7 years ago
    The first formula worked fine (once I got rid of the middle names). But now I want to alphabetize and it won't do it.......because there's a formula in the cells?
    • To post as a guest, your comment is unpublished.
      heyliddle · 7 years ago
      So there's a long, drawn out way that you can change the format of Lastname, Firstname Middle to Firstname Middlename Lastname.

      Assume that Lastname, Firstname Middle is in Cell A1.

      Highlight the cell/column that Lastname, Firstname Middlename(s) is in. Click Data tab->Text to Columns. Chose "Delimited" Next-> click all that apply in checklist and double click the line between Firstname and Secondname to remove it, Next-> Finish. Now Lastname is still in A1, and Firstname Middlename in B2.

      In a new cell (let's say C1) use the forumla =Concatenate(B1," ",A1) and the name will now read as " Firstname Middlename Lastname" (note the space at the start).

      I another cell (let's say D1) use =TRIM(C1) to remove the space.

      And you're done! I'm sure there is a much easier process, but that's what works for me.

      Cheers!
  • To post as a guest, your comment is unpublished.
    Sciguy · 7 years ago
    Thanks - worked well and saved me a lot of time!
  • To post as a guest, your comment is unpublished.
    DiGi · 7 years ago
    The Macro worked for me. Thanks!
  • To post as a guest, your comment is unpublished.
    vivek · 7 years ago
    I want 20140115 to 15012014
  • To post as a guest, your comment is unpublished.
    CJC · 7 years ago
    I understand what each part of the formula does (MID, FIND, and LEN), but I don't understand why it's actually flipping the names. Can someone please explain that to me?
    • To post as a guest, your comment is unpublished.
      Mike Gagne · 7 years ago
      Sadly, the original formula doesn't work correctly if the name includes a middle initial or middle name. So, "Jim R Green" gets you "R Green Jim" when you really want "Green Jim R".

      The formula to allow for that to happen is:
      =MID(A1&" "&A1,IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)+1),LEN(A1))

      What I've done with the original formula is just add a test to see if the original name contains more than 1 space and if so, begin my mid function with the second space. Note that it's still not perfect because it doesn't take into account "Jr.", "Sr." or "III", etc. being after the last name, but it's better.

      An additional thing to keep in mind is if your data isn't 100% clean and contains leading or trailing spaces, like "Jim R Green ", you'll need to use the TRIM command to clean it up. If you don't, it will throw off the count of spaces and give you a "#value!" error. Use this to ensure no leading or trailing spaces affect your results:

      =MID(TRIM(A1)&" "&TRIM(A1),IF(LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))=1,FIND(" ",TRIM(A1))+1,FIND(" ",TRIM(A1),FIND(" ",TRIM(A1))+1)+1),LEN(TRIM(A1)))

      You can also alter the formula to include the comma between the last and first names, as in "Green, Jim R", by using this:

      =MID(TRIM(A1)&", "&TRIM(A1),IF(LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))=1,FIND(" ",TRIM(A1))+1,FIND(" ",TRIM(A1),FIND(" ",TRIM(A1))+1)+1),LEN(TRIM(A1))+1)

      Hope that helps out some!
      • To post as a guest, your comment is unpublished.
        William · 4 years ago
        [quote name="Mike Gagne"]Sadly, the original formula doesn't work correctly if the name includes a middle initial or middle name. So, "Jim R Green" gets you "R Green Jim" when you really want "Green Jim R".

        The formula to allow for that to happen is:
        =MID(A1&" "&A1,IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)+1),LEN(A1))

        What I've done with the original formula is just add a test to see if the original name contains more than 1 space and if so, begin my mid function with the second space. Note that it's still not perfect because it doesn't take into account "Jr.", "Sr." or "III", etc. being after the last name, but it's better.

        An additional thing to keep in mind is if your data isn't 100% clean and contains leading or trailing spaces, like "Jim R Green ", you'll need to use the TRIM command to clean it up. If you don't, it will throw off the count of spaces and give you a "#value!" error. Use this to ensure no leading or trailing spaces affect your results:

        =MID(TRIM(A1)&" "&TRIM(A1),IF(LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))=1,FIND(" ",TRIM(A1))+1,FIND(" ",TRIM(A1),FIND(" ",TRIM(A1))+1)+1),LEN(TRIM(A1)))

        You can also alter the formula to include the comma between the last and first names, as in "Green, Jim R", by using this:

        =MID(TRIM(A1)&", "&TRIM(A1),IF(LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))=1,FIND(" ",TRIM(A1))+1,FIND(" ",TRIM(A1),FIND(" ",TRIM(A1))+1)+1),LEN(TRIM(A1))+1)

        Hope that helps out some![/quote]

        can you help me with this problem?

        the original
        14D-E13111-00
        and i want it to be
        E13111-14D-00

        Thank you so very much...
      • To post as a guest, your comment is unpublished.
        Prashant Kulkarni · 6 years ago
        Thanks Mike Gagne its helps me lot. i have big data base of full name i have to sort it by last name first. its give me very big help on that work. thank you again.
        :lol:
      • To post as a guest, your comment is unpublished.
        Joel · 7 years ago
        Please help

        What if multiple First name or surname

        Example

        Nick Van Exel
        should appear as VanExel, Nick

        Luis Alfred D. Chua
        should appear as Chua, Luis D.
        Chua, Alfred D.

        Jason D. Lee-Parks
        should appear as LeeParks, Jason D.
      • To post as a guest, your comment is unpublished.
        JS · 7 years ago
        While the original formula doesn't work for multiple first names or first name + middle name initials (the aforementioned Jim R. Green, or Lee Harvey Oswald, for example), it does work correctly for multi-part surnames, e.g. James Van Der Beek -> Van Der Beek James. If you have one or two instances of people with both multiple first names or middle names combined with a multi-part surname, you're probably best off handling those manually. Or trimming away the extra middle names, or saving the first names and last names in separate columns to begin with, then hiding those columns and combining them however you want for display.
        • To post as a guest, your comment is unpublished.
          Mike Gagne · 7 years ago
          That's a really good catch JS, one example that I hadn't thought of testing.

          There is another work around that could be done to help with this issue and that is to use a non-breaking space to separate multi-part last names. You may have seen &NBSP used in HTML code. You can insert a non-breaking space into your cell by holding the ALT key and typing the numbers "0160" using the keypad.

          I tried it and it works great.
    • To post as a guest, your comment is unpublished.
      Mike Gagne · 7 years ago
      [quote name="CJC"]I understand what each part of the formula does (MID, FIND, and LEN), but I don't understand why it's actually flipping the names. Can someone please explain that to me?[/quote]

      Here's the formula being used:
      MID(A1&" "&A1,FIND(" ",A1)+1,LEN(A1))

      The Mid function has these components:
      Mid("text to use", where to start, num of chars to select)

      It works by taking the contents of A1 and putting two copies of it together separated by a space (i.e. A1&" "&A1 = "Jim Green Jim Green".)

      The next step then skips the first word (i.e. Find(" ", A1)+1 = "Jim ", so in net effect leaves you with "Green Jim Green" to work with.)

      The final step selects the length of the orginal string (i.e. Len("Jim Green") = 9) from the remaining portion of the concatenated string less the first name (i.e. "Green Jim Green")

      Hopefully that makes sense.
  • To post as a guest, your comment is unpublished.
    Raymond · 8 years ago
    The first formula works perfectly.
  • To post as a guest, your comment is unpublished.
    Stacy · 8 years ago
    None of this Works, except for what this person is selling