Passer au contenu principal

Formule Excel: extraire le prénom et le nom de l'adresse e-mail

Ce didacticiel présente les formules pour extraire le prénom et le nom d'adresses e-mail données dans des cellules séparées, comme illustré ci-dessous, également, il fournit l'exemple pour expliquer les arguments et les parties des formules.
doc extraire l'extension du nom de fichier 5

Extraire le prénom

Formule générique:

LEFT(e_address,FIND("separator",)-1)

Arguments

E_address: the email address you want to extract the first name.
Separator: the delimiter between first name and last name.

Comment fonctionne cette formule

Pour extraire le prénom de l'adresse e-mail dans la cellule B3, veuillez utiliser la formule ci-dessous:

=LEFT(B3,FIND("_",B3)-1)

Actualités Entrer clé.
doc extrait prénom email 2

Explication

FIND fonction: pour trouver la position de départ d'un caractère ou d'un texte dans une chaîne de texte donnée. La formule TROUVER ("_", B3) trouve la position du caractère «_» dans la cellule B3, renvoie 4.

LEFT fonction: extraire le texte du côté gauche de la chaîne de texte donnée en fonction de la longueur de texte donnée. Formule LEFT (B3, FIND ("_", B3) -1) peut être vu comme GAUCHE (B3,4-1), extrayez les 3 premiers caractères du texte de la cellule B3.

Extraire le nom

Formule générique

LEFT(RIGHT(e_address,LEN(e_address)-FIND("separacter",e_address)),FIND("@",RIGHT(e_address,LEN(e_address)-FIND("separator",e_address)))-1)

Argument

E_address: the email address you want to extract the first name.
Separator: the delimiter between first name and last name.

Comment fonctionne cette formule

Pour extraire le nom de famille de l'adresse e-mail dans la cellule B3, veuillez utiliser la formule ci-dessous:

=LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),FIND("@",RIGHT(B3,LEN(B3)-FIND("_",B3)))-1)

Actualités Entrer clé.
doc extrait prénom email 3

Explication

FIND fonction: pour trouver la position de départ d'un caractère ou d'un texte dans une chaîne de texte donnée.

LEN fonction: compte le nombre d'une chaîne de texte.

RIGHT fonction: pour extraire le texte du côté droit.

La formule DROITE (B3, LEN (B3) -FIND ("_", B3)) peut être vu comme:
= DROITE (B3, LEN (B3) -4)
= DROIT (B3,17)
=""

Ensuite FIND ("@", DROITE (B3, LEN (B3) -FIND ("_", B3))) peut être vu comme
=TROUVER("@","")
= "6"

LEFT fonction: extraire le texte du côté gauche de la chaîne de texte donnée en fonction de la longueur de texte donnée. La formule LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),FIND("@",RIGHT(B3,LEN(B3)-FIND("_",B3)))-1) peut être vu comme ceci:
=LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),6-1)
=GAUCHE("",5)
= "Smith"

Remarque

Si vous souhaitez extraire le prénom et le nom avec la première lettre majuscule, vous pouvez ajouter la fonction PROPER devant les formules ci-dessus, telles que:

= APPROPRIÉ (GAUCHE (B3, TROUVE ("_", B3) -1))
=PROPER(LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),FIND("@",RIGHT(B3,LEN(B3)-FIND("_",B3)))-1))
doc extrait prénom email 4

Exemple de fichier

exemple de docCliquez pour télécharger un exemple de fichier


Formules relatives


Fonctions relatives

  • Fonction DROITE
    Extraire le texte du côté droit.
  • Fonction GAUCHE
    Extraire le texte du côté gauche de la chaîne de texte.
  • Fonction LEN
    Obtenez le nombre de caractères dans le texte.
  • Fonction RECHERCHE
    Recherchez la position d'un caractère ou d'une sous-chaîne spécifique dans la chaîne de texte donnée.
  • Fonction FIND
    Rechercher une chaîne dans une autre chaîne

Les meilleurs outils de productivité de bureau

Kutools for Excel - vous aide à vous démarquer de la foule

🤖 Aide à l'IA Kutools: Révolutionner l'analyse des données en s'appuyant sur : Exécution intelligente   |  Générer du code  |  Créer des formules personnalisées  |  Analyser les données et générer des graphiques  |  Invoquer les fonctions Kutools...
Caractéristiques populaires: Rechercher, mettre en évidence ou identifier les doublons  |  Supprimer les lignes vides  |  Combinez des colonnes ou des cellules sans perdre de données  |  Tour sans formule 
Super VRecherche: Plusieurs critères  |  Valeur multiple  |  Sur plusieurs feuilles  |  Recherche floue
Av. La liste déroulante: Liste déroulante facile  |  Liste déroulante dépendante  |  Liste déroulante à sélection multiple
Gestionnaire de colonnes: Ajouter un nombre spécifique de colonnes  |  Déplacer les colonnes  |  Basculer l'état de visibilité des colonnes masquées  Comparer les colonnes à Sélectionnez des cellules identiques et différentes 
Caractéristiques en vedette: Mise au point de la grille  |  Voir Design  |  Grande barre de formule  |  Gestionnaire de classeurs et de feuilles | Centre de ressources (Texte automatique)  |  Sélecteur de date  |  Combiner des feuilles de travail  |  Crypter/déchiffrer les cellules  |  Envoyer des e-mails par liste  |  Super filtre  |  Filtre spécial (filtre gras/italique/barré...) ...
Les 15 meilleurs ensembles d'outils12 Texte Outils (Ajouter du texte, Supprimer les caractères ...)  |  50+ Graphique Types (Diagramme de Gantt ...)  |  40+ Pratique Formules (Calculer l'âge en fonction de l'anniversaire ...)  |  19 Insertion Outils (Insérer le code QR, Insérer une image à partir du chemin ...)  |  12 Conversion Outils (Nombres en mots, Conversion des devises ...)  |  7 Fusionner et fractionner Outils (Lignes de combinaison avancées, Diviser les cellules Excel ...)  |  ... et plus

Kutools pour Excel possède plus de 300 fonctionnalités, Assurez-vous que ce dont vous avez besoin est à portée de clic...

Description


Onglet Office - Activer la lecture et l'édition par onglets dans Microsoft Office (y compris Excel)

  • Une seconde pour basculer entre des dizaines de documents ouverts!
  • Réduisez chaque jour des centaines de clics de souris, dites adieu à la souris.
  • Augmente votre productivité de 50% lors de l'affichage et de l'édition de plusieurs documents.
  • Apporte des onglets efficaces à Office (y compris Excel), tout comme Chrome, Edge et Firefox.
Comments (5)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
<body><table border="1" cellspacing="0" cellpadding="4">
  <tbody style="font-family:sans-serif">
    <tr bgcolor="#999999" style="color:#ffffff;">
      <td>Email Address</td>
      <td>First Name</td>
      <td>Last Name</td>
      <td>Domain</td>
      <td>Separator</td>
    </tr>
    <tr>
      <td></td>
      <td>Jane</td>
      <td>Doe</td>
      <td>abc.com</td>
      <td>“_”</td>
    </tr>
    <tr bgcolor="#eeeeee">
      <td></td>
      <td>John</td>
      <td>Smith</td>
      <td>cbs.com</td>
      <td>“.”</td>
    </tr>
    <tr>
      <td></td>
      <td>G</td>
      <td>Jones</td>
      <td>nbc.com</td>
      <td>none</td>
    </tr>
  </tbody>
This comment was minimized by the moderator on the site
<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style id="email_address_parser_18438_Styles">
<!--
col
	{mso-width-source:auto;}

 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
.MsoChpDefault
	{font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
-->
</style>

</head>

<body lang=EN-US link="#0563C1" vlink="#954F72" style='word-wrap:break-word'>

<div class=WordSection1>

<p class=MsoNormal style='margin:0in'><span style='font-family:"Times New Roman",serif;
color:windowtext'>&nbsp;&nbsp; </span></p>

<!--The following information was generated by Microsoft Excel's Publish as Web
Page wizard.--><!--If the same item is republished from Excel, all information between the DIV
tags will be replaced.--><!-----------------------------><!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD --><!----------------------------->

<div align=center>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=659
 style='width:494.0pt;border-collapse:collapse'>
 <col width=148 span=2 style='mso-width-source:userset;mso-width-alt:4736;
 width:111pt'><col width=99 style='mso-width-source:userset;mso-width-alt:3157;width:74pt'><col width=96 style='mso-width-source:userset;mso-width-alt:3072;width:72pt'><col width=77 style='mso-width-source:userset;mso-width-alt:2474;width:58pt'><col width=91 style='mso-width-source:userset;mso-width-alt:2901;width:68pt'>
 <tr style='height:16.0pt'>
  <td width=148 nowrap valign=bottom style='width:111.0pt;border:solid #C9C9C9 1.0pt;
  border-right:none;background:#A5A5A5;padding:.75pt .75pt 0in .75pt;
  height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><b><span style='color:white'>Subscriber
  Key</span></b></p>
  </td>
  <td width=148 nowrap valign=bottom style='width:111.0pt;border-top:solid #C9C9C9 1.0pt;
  border-left:none;border-bottom:solid #C9C9C9 1.0pt;border-right:none;
  background:#A5A5A5;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><b><span style='color:white'>Email
  Address</span></b></p>
  </td>
  <td width=99 nowrap valign=bottom style='width:74.0pt;border-top:solid #C9C9C9 1.0pt;
  border-left:none;border-bottom:solid #C9C9C9 1.0pt;border-right:none;
  background:#A5A5A5;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><b><span style='color:white'>First Name</span></b></p>
  </td>
  <td width=96 nowrap valign=bottom style='width:1.0in;border-top:solid #C9C9C9 1.0pt;
  border-left:none;border-bottom:solid #C9C9C9 1.0pt;border-right:none;
  background:#A5A5A5;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><b><span style='color:white'>Last Name</span></b></p>
  </td>
  <td width=77 nowrap valign=bottom style='width:58.0pt;border-top:solid #C9C9C9 1.0pt;
  border-left:none;border-bottom:solid #C9C9C9 1.0pt;border-right:none;
  background:#A5A5A5;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><b><span style='color:white'>Domain</span></b></p>
  </td>
  <td width=91 nowrap valign=bottom style='width:68.0pt;border:solid #C9C9C9 1.0pt;
  border-left:none;background:#A5A5A5;padding:.75pt .75pt 0in .75pt;height:
  16.0pt'>
  <p class=MsoNormal style='margin:0in'><b><span style='color:white'>Separator</span></b></p>
  </td>
 </tr>
 <tr style='height:16.0pt'>
  <td nowrap valign=bottom style='border-top:none;border-left:solid #C9C9C9 1.0pt;
  border-bottom:solid #C9C9C9 1.0pt;border-right:none;background:#EDEDED;
  padding:.75pt .75pt 0in .75pt;height:16.0pt;box-sizing: border-box'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'></span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>Jane</span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt;box-sizing: border-box'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>Doe</span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>abc.com</span></p>
  </td>
  <td nowrap valign=bottom style='border-top:none;border-left:none;border-bottom:
  solid #C9C9C9 1.0pt;border-right:solid #C9C9C9 1.0pt;background:#EDEDED;
  padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>“_”</span></p>
  </td>
 </tr>
 <tr style='height:16.0pt'>
  <td nowrap valign=bottom style='border-top:none;border-left:solid #C9C9C9 1.0pt;
  border-bottom:solid #C9C9C9 1.0pt;border-right:none;padding:.75pt .75pt 0in .75pt;
  height:16.0pt;box-sizing: border-box'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'></span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>John</span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt;box-sizing: border-box'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>Smith</span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>cbs.com</span></p>
  </td>
  <td nowrap valign=bottom style='border-top:none;border-left:none;border-bottom:
  solid #C9C9C9 1.0pt;border-right:solid #C9C9C9 1.0pt;padding:.75pt .75pt 0in .75pt;
  height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>‘,”</span></p>
  </td>
 </tr>
 <tr style='height:16.0pt'>
  <td nowrap valign=bottom style='border-top:none;border-left:solid #C9C9C9 1.0pt;
  border-bottom:solid #C9C9C9 1.0pt;border-right:none;background:#EDEDED;
  padding:.75pt .75pt 0in .75pt;height:16.0pt;box-sizing: border-box'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'></span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>G</span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>Jones</span></p>
  </td>
  <td nowrap valign=bottom style='border:none;border-bottom:solid #C9C9C9 1.0pt;
  background:#EDEDED;padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>nbc.com</span></p>
  </td>
  <td nowrap valign=bottom style='border-top:none;border-left:none;border-bottom:
  solid #C9C9C9 1.0pt;border-right:solid #C9C9C9 1.0pt;background:#EDEDED;
  padding:.75pt .75pt 0in .75pt;height:16.0pt'>
  <p class=MsoNormal style='margin:0in'><span style='color:#A6A6A6'>none</span></p>
  </td>
 </tr>
 <tr>
  <td width=148 nowrap valign=bottom style='width:111.0pt;padding:.75pt .75pt 0in .75pt'></td>
  <td width=148 nowrap valign=bottom style='width:111.0pt;padding:.75pt .75pt 0in .75pt'></td>
  <td width=99 nowrap valign=bottom style='width:74.0pt;padding:.75pt .75pt 0in .75pt'></td>
  <td width=96 nowrap valign=bottom style='width:1.0in;padding:.75pt .75pt 0in .75pt'></td>
  <td width=77 nowrap valign=bottom style='width:58.0pt;padding:.75pt .75pt 0in .75pt'></td>
  <td width=91 nowrap valign=bottom style='width:68.0pt;padding:.75pt .75pt 0in .75pt'></td>
 </tr>
</table>

</div>

<p class=MsoNormal style='margin:0in'><span style='font-family:"Times New Roman",serif;
color:windowtext'>&nbsp;</span></p>

<!-----------------------------><!--END OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD--><!-----------------------------></div>

</body>

</html>
This comment was minimized by the moderator on the site
This supports any separator by simply adding or replacing the MIN array. It also proper cases the name:

** First Name **

=PROPER(
    LEFT(
        LEFT(
            [@[Email Address]],
            FIND(
                "@",
                [@[Email Address]]
            ) - 1
        ),
        MIN(
            IFERROR(
                FIND(
                    {
                     ".",
                     "_"
                    },
                    LEFT(
                        [@[Email Address]],
                        FIND(
                            "@",
                            [@[Email Address]]
                        ) - 1
                    )
                ),
                ""
            )
        ) - 1
    )
)


** Last Name **

=PROPER(
    RIGHT(
        LEFT(
            [@[Email Address]],
            FIND(
                "@",
                [@[Email Address]]
            ) - 1
        ),
        LEN(
            LEFT(
                [@[Email Address]],
                FIND(
                    "@",
                    [@[Email Address]]
                ) - 1
            )
        ) -
        MIN(
            IFERROR(
                FIND(
                    {".","_"},
                    LEFT(
                        [@[Email Address]],
                        FIND(
                            "@",
                            [@[Email Address]]
                        ) - 1
                    )
                ),
                ""
            )
        )
    )
)
This comment was minimized by the moderator on the site
I realized using the @ within the command also helped but did not isolate the first and last name where applicable.
=PROPER(LEFT(A4,FIND("@",A4)-1))

I will keep researching and hopefully be able to fine tune better

Thank you very much for this article.
Rated 5 out of 5
This comment was minimized by the moderator on the site
Thank you very much for this article. I have another question regarding these formula.
- Say I have these scenarios - I want to separate FNAME & LNAME from this email
With this command =PROPER(LEFT(A4,FIND("_",A4)-1)); I will be able to produce Ann Bee, but this sign "__ must be changed to "." ,

How do I fix this when this happens say I have - this previous command will produce abee@yahoo as the first name when I am looking to achieve Abee....please can you help.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations