Salt la conținutul principal

Formula Excel: extrageți numele și prenumele din adresa de e-mail

Acest tutorial introduce formulele pentru a extrage prenumele și prenumele din adresele de e-mail date în celule separate, așa cum este prezentat mai jos, de asemenea, oferă un exemplu pentru a explica argumentele și părțile formulelor.
extragere doc extragere din numele fișierului 5

Extrageți prenumele

Formula generică:

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

Argumente

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

Cum funcționează această formulă

Pentru a extrage prenumele din adresa de e-mail din celula B3, utilizați formula de mai jos:

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

Anunturi Intrați cheie.
doc extragere prenume e-mail 2

Explicație

FIND funcţie: pentru a găsi poziția de început a unui caracter sau text într-un șir de text dat. Formula GĂSEȘTE („_”, B3) găsește poziția caracterului „_” în celula B3, returnează 4.

LEFT funcţie: extrage text din partea stângă a șirului de text dat pe baza lungimii textului dat. Formula LEFT (B3, FIND ("_", B3) -1) poate fi văzut ca STÂNGA (B3,4-1), extrageți primele 3 caractere din textul din celula B3.

Extrageți numele de familie

Formula generică

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.

Cum funcționează această formulă

Pentru a extrage numele de familie din adresa de e-mail din celula B3, utilizați formula de mai jos:

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

Anunturi Intrați cheie.
doc extragere prenume e-mail 3

Explicație

FIND funcţie: pentru a găsi poziția de început a unui caracter sau text într-un șir de text dat.

LEN funcţie: numără numărul unui șir de text.

RIGHT funcţie: pentru a extrage text din partea dreaptă.

Formula DREAPTA (B3, LEN (B3) -FIND ("_", B3)) poate fi văzut ca:
= DREAPTA (B3, LEN (B3) -4)
= DREAPTA (B3,17)
=""

"Atunci FIND ("@", DREAPTA (B3, LEN (B3) -FIND ("_", B3))) poate fi văzut ca
=FIND("@","")
= "6"

LEFT funcţie: extrage text din partea stângă a șirului de text dat pe baza lungimii textului dat. Formula LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),FIND("@",RIGHT(B3,LEN(B3)-FIND("_",B3)))-1) pot fi văzute ca acestea:
=LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),6-1)
=STÂNGA("",5)
= "Smith"

Observație

Dacă doriți să extrageți numele și prenumele cu majusculele primei litere, puteți adăuga funcția PROPER în fața formulelor de mai sus, cum ar fi:

= PROPER (STÂNGA (B3, FIND ("_", B3) -1))
=PROPER(LEFT(RIGHT(B3,LEN(B3)-FIND("_",B3)),FIND("@",RIGHT(B3,LEN(B3)-FIND("_",B3)))-1))
doc extragere prenume e-mail 4

Fișier exemplu

eșantion docFaceți clic pentru a descărca fișierul eșantion


Formule relative


Funcții relative


Cele mai bune instrumente de productivitate Office

Kutools pentru Excel - Vă ajută să vă distingeți de mulțime

🤖 Kutools AI Aide: Revoluționați analiza datelor pe baza: Execuție inteligentă   |  Generați codul  |  Creați formule personalizate  |  Analizați datele și generați diagrame  |  Invocați funcțiile Kutools...
Caracteristici populare: Găsiți, evidențiați sau identificați duplicatele  |  Ștergeți rândurile goale  |  Combinați coloane sau celule fără a pierde date  |  Rundă fără Formula ...
Super VLookup: Criterii multiple  |  Valoare multiplă  |  Pe mai multe foi  |  Căutare fuzzy...
Adv. Lista verticală: Lista drop-down ușoară  |  Listă drop-down dependentă  |  Listă derulantă cu selectare multiplă...
Manager de coloane: Adăugați un număr specific de coloane  |  Mutați coloanele  |  Comutați starea vizibilității coloanelor ascunse  Comparați coloanele cu Selectați aceleași și diferite celule ...
Caracteristici prezentate: Focus pe grilă  |  Vedere de proiectare  |  Big Formula Bar  |  Manager registru de lucru și foi | Biblioteca de resurse (Text automat)  |  Data Picker  |  Combinați foi de lucru  |  Criptare/Decriptare celule  |  Trimiteți e-mailuri după listă  |  Super Filtru  |  Filtru special (filtrează bold/italic/barat...) ...
Top 15 seturi de instrumente12 Text Instrumente (Adăuga text, Eliminați caractere ...)  |  50+ Diagramă Tipuri de (Gantt Chart ...)  |  40+ Practic Formule (Calculați vârsta pe baza zilei de naștere ...)  |  19 inserare Instrumente (Introduceți codul QR, Inserați imaginea din cale ...)  |  12 Convertire Instrumente (Numere la cuvinte, conversie valutara ...)  |  7 Merge & Split Instrumente (Rânduri combinate avansate, Împărțiți celule Excel ...)  |  ... și altele

Kutools pentru Excel se mândrește cu peste 300 de caracteristici, Asigurați-vă că ceea ce aveți nevoie este la doar un clic distanță...

Descriere


Fila Office - Activați lectura și editarea cu file în Microsoft Office (includeți Excel)

  • O secundă pentru a comuta între zeci de documente deschise!
  • Reduceți sute de clicuri de mouse pentru dvs. în fiecare zi, spuneți adio de la mâna mouse-ului.
  • Vă crește productivitatea cu 50% atunci când vizualizați și editați mai multe documente.
  • Aduce file eficiente la Office (inclusiv Excel), la fel ca Chrome, Edge și 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