Excel and Google Sheets how-to
Split a full name into first and last name
Your list has "Ana Lopez" in one cell and you need Ana and Lopez in two. Two short formulas find the space and split there.
| A | B | C | |
|---|---|---|---|
| 1 | Full name | First | Last |
| 2 | Ana Lopez | Ana | Lopez |
| 3 | Raj Patel | Raj | Patel |
| 4 | Kim Nguyen | Kim | Nguyen |
| 5 | Lee Brown | Lee | Brown |
| 6 | Sam Ortiz | Sam | Ortiz |
Sample data. Full names in A, the formulas in B2 and C2 are copied down.
The first name
Click the first cell under First (B2) and type:
=LEFT(A2,FIND(" ",A2)-1)B2 shows Ana. Copy it down and every row gets its own first name.
- FIND(" ",A2) gives the position of the first space, 4 in "Ana Lopez".
- -1 stops just before the space.
- LEFT takes that many letters from the start: 3, so Ana.
The last name
In C2, take everything after the space:
=MID(A2,FIND(" ",A2)+1,100)C2 shows Lopez. The 100 means "up to 100 characters", more than any name needs. The same result with RIGHT: =RIGHT(A2,LEN(A2)-FIND(" ",A2)) also gives Lopez.
Names with a middle name
For "Raj K Patel" the first name formula still gives Raj, but the MID formula gives "K Patel", because it takes everything after the first space. To get only the last word:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))The result is Patel. SUBSTITUTE swaps each space for 100 spaces, RIGHT takes the last 100 characters (the last word plus padding), and TRIM removes the padding.
A "Last, First" list
When names look like "Lopez, Ana", split at the comma instead. First name:
=TRIM(MID(A2,FIND(",",A2)+1,100))gives Ana (TRIM drops the space after the comma). Last name:
=LEFT(A2,FIND(",",A2)-1)gives Lopez.
A one word name gives #VALUE!
A name like "Cher" has no space, so FIND fails and the first name formula shows #VALUE!. IFERROR shows the whole name instead:
=IFERROR(LEFT(A2,FIND(" ",A2)-1),A2)Cher now shows Cher, and two word names work as before.
Extra spaces
A space before the name makes the first name come out empty, because the first space is at the very start. Wrap A2 in TRIM, which removes spaces at the ends and turns double spaces into single ones:
=LEFT(TRIM(A2),FIND(" ",TRIM(A2))-1)" Kim Nguyen " gives Kim, and =MID(TRIM(A2),FIND(" ",TRIM(A2))+1,100) gives Nguyen.
Without formulas
Leave empty columns to the right of the names first, because the split fills the next columns. In Excel: Data > Text to Columns, choose Delimited, then tick Space. In Google Sheets: Data > Split text to columns. The result is plain text, so it does not update when a name changes; the formulas do. LEFT, MID, FIND, TRIM, SUBSTITUTE, REPT and IFERROR work in every current version of Excel and in Google Sheets.
Templates with the math already done
Rather skip the formulas? These templates come with every formula built and checked, plus a filled-in sample.
- Attendance TrackerA whole school year for up to 40 students with a year summary.
- Teacher GradebookScores in, overall percent, letter grade and missing work out, for up to 40 students.
- Employee Schedule TemplatePlan your team's shifts week by week with shift codes or times.
More how-tos
- Find a price by its code with XLOOKUPType a product code, get its price back from your price list. One formula, no helper columns.
- Total each category with SUMIFSAdd up all the Fuel, all the Office, all the Meals: one formula per category, and more rules when you need them.
- Check two conditions at once with IF and ANDFree shipping only when the order is 50 or more and ships in Canada: one IF, one AND, done.
- Add leading zeros to numbersType 00021 and Excel or Google Sheets shows 21, because to them it is just the number 21. Here is how to get the zeros back, and keep them.
- Fix #DIV/0! in an averageAn average of nothing is a division by zero, so AVERAGE shows #DIV/0! until the first number arrives. One IF fixes it.
- Count rows that meet two conditions with COUNTIFSHow many of Ana's deals were 500 or more? COUNTIFS answers it in one cell, and takes as many rules as you need.
- Calculate percentage changeSales went from 400 to 500. That is a 25% increase, and one short formula works it out for every row.
- Calculate years of service from a start dateAna started on 15 March 2019. How many full years has she worked? DATEDIF counts them, and the same formula works out an age from a date of birth.
- Combine first and last name into one cellFirst names in one column, last names in the next, and you need "Ana Lopez" in one cell. The & sign joins them.
- Find duplicates in a list with COUNTIFA mailing list where some people signed up twice. One formula shows how many times each email appears, so the repeats stand out.
- Free pricing calculatorsPrice a job from your real costs and margin. No sign up.






