SpreadsheetFormulas
intermediateMIDFINDLEFT

Swap Last Name, First Name into First Last

An export lists people as "Last, First" — "Torres, Ana" — but your mail merge, CRM, or report needs the natural "Ana Torres" order.

Quick formula
=MID(A2,FIND(",",A2)+2,99)&" "&LEFT(A2,FIND(",",A2)-1)
Sample input
1Name (Last, First)
2Torres, Ana
3Okafor, Ben
4Lim, Cara
Result
1Name (Last, First)First Last
2Torres, AnaAna Torres
3Okafor, BenBen Okafor
4Lim, CaraCara Lim

Excel & Google Sheets

=MID(A2,FIND(",",A2)+2,99)&" "&LEFT(A2,FIND(",",A2)-1)

This formula works in both Excel and Google Sheets.

How it works

The comma's position, found once by FIND, splits the cell into two halves. MID starts 2 characters after the comma — skipping the comma itself and the space that follows — and the 99 just means "take everything to the end" (any number longer than the name works). LEFT takes the characters before the comma: the position minus 1 excludes the comma itself. The & operator glues the two halves back together with a space between them, so "Torres, Ana" becomes "Ana Torres". Once the formulas are filled down, copy the column and Paste Special → Values to replace the originals.

FIND(",",A2)
Position of the comma — the pivot point. In "Torres, Ana" it's 7.
MID(A2,…+2,99)
The first name: starts after the comma and its trailing space, takes up to 99 characters.
&" "&
Joins the two pieces with a single space.
LEFT(A2,…-1)
The last name: everything before the comma.

When to use it

Use it on HR exports, payroll files, and directory dumps that arrive "Last, First" when your template, badge printer, or email tool expects "First Last."

Common mistakes

  • The export has no space after the comma.

    "Torres,Ana" with the +2 chops the A off. Use +1 instead, or make it robust either way: =TRIM(MID(A2,FIND(",",A2)+1,99))&" "&LEFT(A2,FIND(",",A2)-1).

  • Some rows have no comma at all.

    FIND returns #VALUE! on "Ana Torres" rows that are already correct. Guard them: =IFERROR(MID(A2,FIND(",",A2)+2,99)&" "&LEFT(A2,FIND(",",A2)-1),A2).

  • Deleting the original column while the formulas still point at it.

    The results turn to #REF!. Convert the formula column to plain text first with Copy → Paste Special → Values.

Did this formula help?

Engine-verified against the sample data aboveDownload the proof sheet (.xlsx)Last reviewed 2026-07-09