ExcelyourTraining

Home › Blog

How to combine first and last name in Excel (and split them again)

Sooner or later someone hands you a list with first names in one column and surnames in another, and asks for a single "Full name" column. Or the opposite: one column of full names that needs to be split for a mail merge or a database import.

This guide shows you how to combine first and last name in Excel with three different formulas, and how to split names apart again. You'll also see where each method trips up on South African surnames like "van der Merwe" and "du Plessis", because that's where most tutorials stop being useful.

The list we'll work with

Here's a small staff list. First names are in column A, surnames in column B.

A B
1 First name Surname
2 Pieter van der Merwe
3 Anika du Plessis
4 Sean McDonald
5 Lerato Mokoena

Combine first and last name in Excel with &

The ampersand (&) glues pieces of text together. In C2, type:

=A2&B2

You get "Pietervan der Merwe". The names are joined, but there's no space. This is the single most common beginner mistake, and the fix is simple: add the space yourself, in quotation marks.

=A2&" "&B2

Now C2 shows "Pieter van der Merwe". Fill the formula down and every row gets a full name. The " " is just a piece of text that happens to be one space long. You can put anything between the quotes. For a "surname, first name" list, try:

=B2&", "&A2

That gives "van der Merwe, Pieter".

CONCAT does the same job

If you find a row of ampersands hard to read, CONCAT does the same thing with commas between the pieces:

=CONCAT(A2," ",B2)

The result is identical: "Pieter van der Merwe". CONCAT is the newer replacement for the old CONCATENATE function. Microsoft keeps CONCATENATE for compatibility, but recommends CONCAT or & for new work. CONCAT is available in Excel 2019 and later, and in Microsoft 365.

TEXTJOIN handles blanks and separators for you

Now say your list also has a middle-name column, and most people left it empty.

A B C
1 First name Middle name Surname
2 Sean Patrick McDonald
3 Lerato Mokoena

With &, you'd write =A3&" "&B3&" "&C3 and get "Lerato Mokoena" with two spaces, because the empty middle name still has a space on each side. That double space will cause trouble later, for example in lookups.

TEXTJOIN solves this:

=TEXTJOIN(" ",TRUE,A2:C2)

The first argument is the separator (a space). The second, TRUE, tells Excel to skip empty cells. The third is the range to join. Row 2 gives "Sean Patrick McDonald" and row 3 gives "Lerato Mokoena", each with single spaces. TEXTJOIN is available in Excel 2019 and later, and in Microsoft 365.

A quick rule of thumb:

Separate first and last name in Excel

Now the reverse. You have one column of full names in A and want first name in B and surname in C.

A
1 Full name
2 Pieter van der Merwe
3 Anika du Plessis
4 Sean McDonald

Option 1: Text to Columns

Select the names, go to Data > Text to Columns, choose Delimited, tick Space and click Finish. Excel splits each name at every space.

That works well for "Sean McDonald". It doesn't for "Pieter van der Merwe", which lands in four columns: Pieter, van, der, Merwe. "Anika du Plessis" ends up in three. You'd have to stitch the surnames back together by hand.

Two more things to know. Text to Columns overwrites whatever is in the columns to the right, so leave them empty first. And it's a one-off action: if a name changes later, the split columns won't update.

Option 2: TEXTBEFORE and TEXTAFTER

These two functions split text at a character you choose. For the first name, in B2:

=TEXTBEFORE(A2," ")

That returns everything before the first space: "Pieter". For the surname, in C2:

=TEXTAFTER(A2," ")

That returns everything after the first space: "van der Merwe". All three words stay together, which is exactly what you want for South African surnames with prefixes. "Anika du Plessis" gives "Anika" and "du Plessis".

You may see advice online to use =TEXTAFTER(A2," ",-1) for surnames. The -1 tells Excel to search from the end, so it returns the text after the last space. For "Sean McDonald" that's fine. For "Pieter van der Merwe" it returns just "Merwe". Know your data before you pick a formula.

Two cautions:

TEXTBEFORE and TEXTAFTER are available in Microsoft 365 and Excel 2024. If you get a #NAME? error, your version doesn't have them.

Option 3: LEFT, MID and FIND for older versions

On Excel 2021 or earlier, you can build the same split from older functions. First name:

=LEFT(A2,FIND(" ",A2)-1)

FIND gives the position of the first space, and LEFT takes everything before it. Surname:

=MID(A2,FIND(" ",A2)+1,LEN(A2))

MID starts one character after the space and takes the rest. It's longer to type but gives the same "van der Merwe" result.

One thing to clean first

If your source data has stray spaces, a leading space in front of "Anika" for example, both joining and splitting go wrong. TEXTBEFORE splits at that leading space and returns an empty first name. It's worth wrapping the name in TRIM first, like =TEXTBEFORE(TRIM(A2)," "), which removes extra spaces before Excel looks for the split.

Try it yourself

Reading about formulas only gets you so far. The quickest way to remember the missing space and the "van der Merwe" problem is to type the formulas and see the results.

Each lesson runs in your browser and is graded the moment you press Enter. It's free, with no sign-up and nothing to install.