← All how-to recipes

How to extract the last name from a full name

✓ Verified in LibreOffice 25.8.7.3

Pull just the last name out of a 'First Last' text string.

The formula

AppFormulaNotes
Excel=MID(A2,FIND(" ",A2)+1,LEN(A2))Start one character after the space and take the rest.
Google Sheets=MID(A2,FIND(" ",A2)+1,LEN(A2))Identical. TEXTAFTER(A2," ") also works in newer versions.
LibreOffice Calc=MID(A2,FIND(" ",A2)+1,LEN(A2))Identical.

How it works

FIND(" ",A2)+1 is the position just after the first space; MID takes from there through the end of the string (LEN as a safe length). For 'Jane Doe' it returns 'Doe'. Note this returns everything after the first space, so 'Jane Van Doe' would give 'Van Doe'.

Verified, not just documented

We ran =MID(A2,FIND(" ",A2)+1,LEN(A2)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Doe — exactly the expected result. Every formula here is confirmed by actually executing it.