Split Full Name Columns into First and Last Name

Tested prompts for split full name into first and last name excel compared across 5 leading AI models.

BEST BY JUDGE SCORE Claude Haiku 4.5 9/10

You have a column of full names in Excel and you need them split into First Name and Last Name. Maybe it's a contact list for mail merge, a CRM import that requires separate fields, or a signup sheet where someone typed 'Jane Smith' into one cell and now the downstream system won't accept it. Whatever the reason, you need a reliable way to split thousands of names without cleaning each one by hand.

Excel gives you a few built-in options (Text to Columns, Flash Fill, LEFT/RIGHT/FIND formulas, Power Query), but each one breaks the moment your data gets messy. Middle names, suffixes like 'Jr.', compound surnames like 'Van Der Berg', titles like 'Dr.', and single-name entries all trip up the standard approaches. That's where an AI prompt handles what formulas can't.

This page shows you the exact prompt to use, tested across GPT-4, Claude, Gemini, and Llama, with a comparison of how each model handles edge cases. Copy the prompt, paste your name column, and get a clean two-column output ready to drop back into your spreadsheet.

When to use this

Use an AI prompt for splitting names when your data has inconsistent formatting, edge cases, or cultural name variations that trip up Excel's Text to Columns. It's also the fastest option if you don't want to write nested formulas or set up Power Query. For clean, uniform data like 'First Last' with no exceptions, native Excel tools are fine.

  • Your list mixes formats: 'John Smith', 'Mary Ann O'Brien', 'Dr. Robert Chen Jr.'
  • You have multi-word surnames like 'de la Cruz' or 'Van Buren' that Text to Columns splits incorrectly
  • The list includes titles (Mr., Mrs., Dr., Prof.) or suffixes (Jr., III, PhD) you want separated or dropped
  • You need to process a few hundred to a few thousand names in one pass
  • You're doing a one-time cleanup and don't want to build a reusable formula system

When this format breaks down

  • You have 100,000+ rows. Use Power Query or formulas because AI token limits and costs make it impractical.
  • Your data is already perfectly uniform ('First Last' with no exceptions). Text to Columns with a space delimiter takes 10 seconds.
  • You need a repeatable pipeline that runs automatically on new data. Build it in Power Query or a script instead.
  • The names are in a non-Latin script (Chinese, Arabic, Korean) where first/last ordering differs by culture and requires domain rules, not generic AI parsing.

The prompt we tested

You are an Excel expert helping users split a column of full names into separate first name and last name columns. Analyze the user's situation below and provide a clear, step-by-step solution.

Instructions: Respond with a numbered, step-by-step guide that includes at least two methods (a formula-based method using LEFT/RIGHT/FIND/SEARCH or TEXTSPLIT, and a no-formula method using Text to Columns or Flash Fill). Include exact formulas with cell references, explain briefly what each formula does, and note any edge cases like middle names or suffixes. Keep the tone practical and concise.

User's situation:
I have a spreadsheet with about 500 employee names in column A (like 'John Smith', 'Mary Jane Watson', 'Robert Downey Jr.'). I need to split these into a First Name column and a Last Name column. Some entries have middle names or suffixes which is making this tricky.

Provide the solution now.

Model comparison

ModelQualityCostLatencyTokens
Claude Opus 4.7 9 $0.1113 23.0s 318 / 1421
Claude Haiku 4.5 9 $0.0036 7.6s 222 / 682
GPT-5.4Not run yet
Gemini 2.5 ProNot run yet
Grok 4.1 Fast Reasoning 9 $0.0004 15.6s 342 / 752

Outputs

Claude Opus 4.7 9/10
# Splitting Full Names in Excel: Step-by-Step Guide

Since your data includes middle names and suffixes, you'll need to decide on a rule first. A common approach:
- **First Name** = the first word
- **Last Name** = everything after the first word (keeps middle names/suffixes with the last name)

If you'd rather isolate *just* the surname (e.g., "Watson" from "Mary Jane Watson"), see the notes at the end.

---

## Method 1: Formulas (LEFT / MID / FIND)

Assuming full names are in **A2:A501**:

1. **In cell B2 (First Name), enter:**
   ```
   =LEFT(A2, FIND(" ", A2) - 1)
   ```
   *This grabs everything before the first space.*

2. **In cell C2 (Last Name / remainder), enter:**
   ```
   =MID(A2, FIND(" ", A2) + 1, LEN(A2))
   ```
   *This grabs everything after the first space — including middle names and suffixes like "Jr."*

3. **Select B2:C2** and double-click the fill handle (small square at the bottom-right of the selection) to copy the formulas down through row 501.

4. **Convert to values (optional):** Select B2:C501 → Copy → Paste Special → Values. This removes dependency on column A.

---

## Method 2: TEXTSPLIT (Excel 365 / 2021+)

1. **In cell B2, enter:**
   ```
   =TEXTSPLIT(A2, " ")
   ```
   *This spills each word into its own column.* For "Mary Jane Watson," you'll get three columns: B=Mary, C=Jane, D=Watson.

2. To force first name and everything-else into two columns:
   ```
   =LET(parts, TEXTSPLIT(A2," "), HSTACK(INDEX(parts,1), TEXTJOIN(" ",TRUE,DROP(parts,,1))))
   ```

---

## Method 3: Text to Columns (No Formulas)

1. Select **A2:A501**.
2. Go to **Data → Text to Columns**.
3. Choose **Delimited** → Next.
4. Check **Space** as the delimiter → Next.
5. Under **Destination**, enter `=$B$2` so the original column isn't overwritten → Finish.

⚠️ This splits every space, so "Robert Downey Jr." becomes three cells. You'll need to manually consolidate middle names/suffixes afterward.

---

## Method 4: Flash Fill (Fastest for Mixed Patterns)

1. In **B2**, type the first name manually: `John`
2. In **B3**, start typing `Mary` — Excel should suggest the rest. Press **Enter** to accept, or press **Ctrl + E** to trigger Flash Fill.
3. Repeat in **C2** by typing the last name (e.g., `Smith`), then **Ctrl + E** in C3.

✅ Flash Fill is great because you can demonstrate the pattern for tricky cases (e.g., type `Downey Jr.` for the Robert Downey row) and Excel will often follow your lead.

---

## Edge Cases to Watch For

- **Suffixes (Jr., Sr., III):** Method 1 keeps them attached to the last name — usually the desired behavior. Verify by filtering column C for "Jr.", "Sr.", "II", "III".
- **Single-name entries (e.g., "Cher"):** The FIND formulas return `#VALUE!`. Wrap with IFERROR:
  ```
  =IFERROR(LEFT(A2, FIND(" ", A2)-1), A2)
  ```
- **Extra spaces:** Clean first with `=TRIM(A2)` in a helper column.
- **To extract ONLY the surname** (last word, ignoring suffixes requires manual review):
  ```
  =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
  ```

**Recommendation:** For 500 rows with mixed formats, use **Flash Fill (Method 4)** — it's the fastest way to handle the quirks, and you can spot-check results easily.
Judge notes: Excellent response that directly addresses the query with multiple practical methods, exact formulas with cell references, edge case handling, and clear prioritization for the user's specific situation (500 names with middle names/suffixes).
Claude Haiku 4.5 9/10
# Splitting Full Names in Excel: Two Methods

## **Method 1: Formula-Based (Recommended for 500 rows)**

### For First Names (Column B):
```excel
=LEFT(A2,FIND(" ",A2)-1)
```
**What it does:** Finds the first space and extracts everything to the left of it.

### For Last Names (Column C):
```excel
=TRIM(RIGHT(A2,LEN(A2)-FIND(" ",A2)))
```
**What it does:** Finds the first space and extracts everything to the right, trimming extra spaces.

### Step-by-step:
1. Click on cell **B1** and type the header "First Name"
2. Click on cell **B2** and paste the first name formula above
3. Press **Enter**, then copy the formula down to B501 (double-click the fill handle)
4. Click on cell **C1** and type the header "Last Name"
5. Click on cell **C2** and paste the last name formula above
6. Press **Enter**, then copy the formula down to C501

---

## **Method 2: Text to Columns (No Formulas, but less flexible)**

### Step-by-step:
1. Select the entire column **A** (all 500 names)
2. Go to **Data tab** → **Text to Columns**
3. Choose **Delimited** and click **Next**
4. Check the **Space** checkbox as the delimiter, click **Next**
5. Click **Finish**
   - Column A will now contain first names
   - Column B will contain last names (middle names/suffixes go here too)

6. **Manual cleanup needed:** Cut Column B data and paste into Column C, then rename headers

---

## **Edge Cases & Solutions**

| Scenario | Issue | Solution |
|----------|-------|----------|
| **Middle names** (Mary Jane Watson) | Last name formula captures "Jane Watson" | Use Method 1 formula—it takes everything after the *first* space as last name |
| **Suffixes** (Robert Downey Jr.) | Suffix gets included in last name | Method 1 includes it with last name; manually separate if needed, or accept as-is |
| **Single names** (Cher) | No space found—formula errors | Wrap formulas in `IFERROR(formula,"")` to handle gracefully |
| **Extra spaces** (John  Smith) | Double spaces cause errors | Method 1 uses TRIM to clean this automatically |

---

## **My Recommendation**

✅ **Use Method 1 (formulas)** for your 500 rows because:
- Handles middle names automatically
- Consistent, repeatable, and auditable
- Easy to modify if requirements change
- Preserves original data in Column A

Use Method 2 only if you want the fastest result and don't mind manual cleanup.
Judge notes: Excellent response that directly addresses the query with two practical methods, exact formulas with cell references, clear step-by-step instructions, and a helpful edge cases table; minor deduction only because the Text to Columns method explanation could be slightly clearer about its limitations with middle names.
Grok 4.1 Fast Reasoning 9/10
### Method 1: Formula-Based (Using Classic Functions - Works in All Excel Versions)
This extracts **First Name** as the first word (before first space) and **Last Name** as the last word (after last space). Edge cases: Middle names go into neither (e.g., "Mary Jane Watson" → First: Mary, Last: Watson); suffixes like "Jr." become the last name (manual fix needed, e.g., via Find/Replace).

1. Insert headers: In B1, type "First Name"; in C1, type "Last Name".
2. In B2 (First Name formula): `=LEFT(A2, FIND(" ", A2 & " ") - 1)`  
   *Extracts text from left up to first space (adds space if none for edge case of single name).*
3. In C2 (Last Name formula): `=TRIM(RIGHT(SUBSTITUTE(A2, " ", REPT(" ", 100)), 100))`  
   *Replaces spaces with 100 spaces, takes right 100 chars, trims to get last word.*
4. Copy formulas down to row 501 (double-click fill handle).  
5. Copy B:C, right-click → Paste Special → Values to replace formulas.

### Method 2: Formula-Based (TEXTSPLIT - Excel 365/2021+ Only)
Same logic as above, but dynamic array splits all at once.

1. Insert headers in B1:C1 as above.
2. In B2: `=INDEX(TEXTSPLIT(A2, " "), 1)`  
   *Splits A2 by spaces, takes 1st element.*
3. In C2: `=INDEX(TEXTSPLIT(A2, " "), -1)`  
   *Splits A2 by spaces, takes last element.*
4. Copy down (or it auto-spills if small range). Paste Values as above.

### Method 3: No-Formula - Text to Columns (Splits into Multiple Columns)
Splits on spaces; manually merge for middles/suffixes. Good for bulk, but creates temp columns.

1. Select A:A (or A2:A501).
2. Data tab → Text to Columns → Delimited → Next.
3. Check "Space" only → Next.
4. Set destination to B1 (shifts data right). Finish. (Now B+ has parts: B=first, last col=last.)
5. For First: Copy B:B to new First col, Paste Values.
6. For Last: Copy last split col (e.g., E:E if 3-word names) to Last col, Paste Values.  
   *Edge: Middles/suffixes in extra cols—delete or combine manually (e.g., =D2 & " " & E2 for "Downey Jr.").*

### Method 4: No-Formula - Flash Fill (Excel 2013+ - Pattern Recognition)
AI-like auto-fill; handles patterns fast for 500 rows.

1. Insert headers B1:C1.
2. In B2: Type first name manually (e.g., "John").
3. B3: Type next (e.g., "Mary"). Select B2:B3 → Ctrl+E (Flash Fill). It auto-fills B col.
4. In C2: Type last name (e.g., "Smith"). C3: Next (e.g., "Watson"). Select C2:C3 → Ctrl+E.
5. Verify/tweak any misses (e.g., suffixes), then Paste Values on B:C.  
   *Edge: Retrain by typing more examples if middles confuse it.*
Judge notes: Comprehensively addresses the query with four practical methods including formulas and no-formula approaches, exact cell references, clear edge case handling, and step-by-step instructions; minor deduction only for the Text to Columns method being somewhat verbose for the complexity involved.

What makes these work

  1. 01
    State the output format explicitly

    Tell the AI you want two columns labeled 'First Name' and 'Last Name', separated by a pipe or tab. Without this, models return inconsistent formats like bullet lists or prose, which you can't paste back into Excel cleanly.

  2. 02
    Give rules for edge cases up front

    Specify how to handle titles, suffixes, middle names, and compound surnames in the prompt itself. For example: 'Drop titles like Dr. and Mr. Keep compound surnames like van der Berg as one unit. Ignore middle names.' This prevents the model from guessing.

  3. 03
    Batch in chunks of 50 to 200 rows

    Most models handle 100 names per prompt accurately. Beyond that, they start skipping rows or truncating output. Paste in batches, verify each output, then stack the results in your spreadsheet.

  4. 04
    Include a sample row showing the expected output

    One example in the prompt ('Input: Dr. Jane Smith Jr. → First: Jane, Last: Smith') anchors the model's formatting choices. This single shot improves consistency more than any other prompt tweak.

More example scenarios

#01 · Sales CRM import with titles and suffixes
Input
Split these into First Name and Last Name, removing titles and suffixes:
Dr. Sarah Johnson
Mr. Michael Brown Jr.
Prof. Emily Watson PhD
Robert Garcia III
Ms. Linda Park
Expected output
First Name | Last Name
Sarah | Johnson
Michael | Brown
Emily | Watson
Robert | Garcia
Linda | Park
#02 · Event attendee list with compound surnames
Input
Split into first and last name, keeping compound surnames intact:
Maria de la Cruz
Jan van der Berg
Ahmed bin Rashid
Sofia Garcia Lopez
Pierre Saint-Martin
Expected output
First Name | Last Name
Maria | de la Cruz
Jan | van der Berg
Ahmed | bin Rashid
Sofia | Garcia Lopez
Pierre | Saint-Martin
#03 · Newsletter signup with messy user input
Input
Clean and split these names, fix capitalization:
john smith
MARY JONES
bob
Alice   Walker
chen, wei
Expected output
First Name | Last Name
John | Smith
Mary | Jones
Bob | 
Alice | Walker
Wei | Chen
#04 · HR employee roster with middle names
Input
Split into First Name and Last Name, ignore middle names:
James Robert Wilson
Katherine Anne Miller
David Lee
Jennifer Marie Elizabeth Thompson
Mark O'Connor
Expected output
First Name | Last Name
James | Wilson
Katherine | Miller
David | Lee
Jennifer | Thompson
Mark | O'Connor
#05 · Nonprofit donor list with 'Last, First' format
Input
These are in 'Last, First' order. Split and reformat:
Anderson, Paul
O'Brien, Siobhan
Williams-Lee, Tanya
Ng, Henry
Delacroix, Jean-Pierre
Expected output
First Name | Last Name
Paul | Anderson
Siobhan | O'Brien
Tanya | Williams-Lee
Henry | Ng
Jean-Pierre | Delacroix

Common mistakes to avoid

  • Using Text to Columns on compound names

    Splitting 'Maria de la Cruz' by space gives you four columns, not two. Text to Columns has no concept of surname particles, so you end up manually fixing every compound name.

  • Assuming the last word is always the surname

    A LEFT/RIGHT/FIND formula that grabs everything after the last space fails on 'Robert Garcia III' (returns 'III' as last name) and on 'Mary Ann Smith' (splits the first name). Suffixes and middle names break this logic.

  • Not validating the AI output row count

    Always compare the number of input rows to output rows. Models sometimes skip blank lines or merge adjacent entries, and you won't notice until the CRM import fails three days later.

  • Feeding the model commas without clarifying format

    If your list is 'Smith, John' and you don't say so, the AI may assume 'Smith' is the first name. Always tell the model whether input is 'First Last' or 'Last, First'.

  • Ignoring capitalization cleanup

    Names like 'JOHN SMITH' or 'mary jones' often come through as-is unless you ask for proper case. Add 'fix capitalization to title case' to your prompt to avoid a second cleanup pass.

Related queries

Frequently asked questions

How do I split a full name into first and last name in Excel without a formula?

Select your column, go to Data > Text to Columns, choose Delimited, and pick Space as the delimiter. This works for clean 'First Last' data. For messy data with middle names, titles, or compound surnames, use Flash Fill (Ctrl+E) after typing the first two examples manually, or run the names through an AI prompt.

What formula splits first and last name in Excel?

For first name: =LEFT(A2,FIND(" ",A2)-1). For last name: =RIGHT(A2,LEN(A2)-FIND(" ",A2)). These work for simple 'First Last' entries. For middle names, use =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)) to grab the last word as the surname.

How do I handle middle names when splitting in Excel?

Decide your rule first: drop the middle name, keep it in a third column, or include it with the first name. For dropping it, extract the first word as First Name and the last word as Last Name using TRIM and SUBSTITUTE formulas. AI prompts handle this more reliably when you specify the rule.

Does Flash Fill work for splitting names?

Yes, for consistent data. Type the first name manually in the next column for the first two or three rows, then press Ctrl+E. Excel detects the pattern and fills the rest. Flash Fill breaks on irregular data like mixed formats, compound surnames, or entries with titles.

How do I split 'Last, First' format into two columns?

Use Text to Columns with comma as the delimiter, then swap the column order. Or use formulas: =TRIM(MID(A2,FIND(",",A2)+1,100)) for first name and =LEFT(A2,FIND(",",A2)-1) for last name. An AI prompt handles this in one step if you tell it the input format.

Why does Text to Columns split my compound surnames wrong?

Text to Columns treats every space as a separator, so 'van der Berg' becomes three cells. There's no built-in way to preserve multi-word surnames. Either clean them manually, use Power Query with custom logic, or run the list through an AI prompt that understands surname particles.