ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 56 · Text search

Get the last name in Excel

The last name is everything after the space. Count the whole name with LEN, find the space with FIND, and take the difference from the right with RIGHT.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Count characters with LEN
  • Take the last name with RIGHT

How it works

The last name is LEN(A2) − FIND(" ",A2) characters long.

So =RIGHT(A2,B2-C2) takes the last name, where B2 is the length and C2 is the space position.

Formulas at a glance

=LEN(A2)length
=FIND(" ",A2)space
=RIGHT(A2,B2-C2)last name

Example

Write the formula to count the characters in Maya's name.

ABCD
1Full nameLengthSpace atLast name
2Maya Chen
3Luis Ortega
4Priya Natarajan
5Ben Ito

Click B2 and type =LEN(A2), then press Enter.

The answer is 9.

When to use it

  • Splitting full names into last names
  • Sorting a list by last name
  • Building "Last, First" directories

Common mistakes

  • Off by oneLength minus the space position gives exactly the last name.
  • Middle namesThis method takes everything after the first space.
  • Extra spacesUse TRIM first so the count is right.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

Get the last name in Excel: how it works, with examples · ExcelUnpack