FormulaCraft

How to swap first and last name in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=MID(A2,FIND(" ",A2)+1,100)&", "&LEFT(A2,FIND(" ",A2)-1)

Verified example

Computed by a real spreadsheet engine on the sample data below.

Full Name
Alice Johnson
Bob Smith
Carol White
David Brown

=MID(A2,FIND(" ",A2)+1,100)&", "&LEFT(A2,FIND(" ",A2)-1)Johnson, Alice

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Locate the space position with FIND(" ",A2).
  2. 2Extract the first name with =LEFT(A2,FIND(" ",A2)-1).
  3. 3Extract the last name with =MID(A2,FIND(" ",A2)+1,100) — 100 is generous enough for any last name.
  4. 4Combine in Last, First order: =MID(A2,FIND(" ",A2)+1,100)&", "&LEFT(A2,FIND(" ",A2)-1).
  5. 5If names can have a middle name or initial, decide whether the last name is always the final word and adjust accordingly.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What if the name is already in 'Last, First' format?

Use FIND(",",A2) to detect the comma and branch with IF to handle both formats, or standardize input before processing.

Does this handle names with a suffix like Jr. or III?

Not automatically — suffixes after the last name will be included in the 'last name' portion. You'll need additional logic to strip suffixes if that's required.

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: