SpreadsheetFormulas
beginnerMIDFINDTEXTAFTERREGEXEXTRACT

Extract the Last Name from a Full Name

A column holds full names like "Ana Torres" and you need just the last names — to sort a roster alphabetically, match against HR records, or fill a separate surname field.

Quick formula
=MID(A2,FIND(" ",A2)+1,100)
Sample input
1Full Name
2Ana Torres
3Ben Okafor
4Cara Lim
Result
1Full NameLast Name
2Ana TorresTorres
3Ben OkaforOkafor
4Cara LimLim

Excel & Google Sheets

=TEXTAFTER(A2," ")

How it works

The universal version works everywhere: FIND locates the first space, and MID grabs everything starting one character after it — the 100 is just "plenty of characters," so the rest of the name comes through. In Excel 365, TEXTAFTER(A2," ") reads more naturally and does the same thing. Google Sheets' REGEXEXTRACT(A2,"\S+$") behaves slightly differently: it grabs only the final word. That matters for multi-word surnames — "Ana de la Cruz" gives "de la Cruz" with MID or TEXTAFTER, but only "Cruz" with the regex. Pick the behavior that matches your data.

FIND(" ",A2)
Finds the position of the first space — in "Ana Torres" that's 4.
+1
Steps forward one character so the space itself is skipped.
MID(A2, …, 100)
Returns up to 100 characters from that point: "Torres". 100 is simply "more than enough".

When to use it

Use this to sort contact lists by surname, split imported names into separate columns, or match people against a system that stores last names on their own. Pair it with extract-first-name to fully split a name column.

Common mistakes

  • Single-word names return #VALUE!.

    FIND fails when there's no space. Guard it: =IFERROR(MID(A2,FIND(" ",A2)+1,100),A2) returns the whole name instead.

  • Multi-word surnames come back wrong.

    "Ana de la Cruz" yields "de la Cruz" with MID or TEXTAFTER but only "Cruz" with REGEXEXTRACT(A2,"\S+$"). Decide which your data needs — there's no formula that reliably knows where a compound surname starts.

  • Middle names end up in the result.

    The MID version returns everything after the FIRST space, so "Mary Jane Watson" gives "Jane Watson". To get only the final word in Excel 365, use =TEXTAFTER(A2," ",-1), which splits at the LAST space.

Did this formula help?

Engine-verified against the sample data aboveLast reviewed 2026-07-08