How-to recipes · Text

How to combine first and last name in Excel

Join first and last names into one cell with the & operator, CONCAT or TEXTJOIN, skip empty middle names, and create Last, First formats.

Beginner CONCAT CONCATENATE TEXTJOIN PROPER TRIM LEFT IF

The reverse of splitting names is just as common: a form stored first and last name in separate columns, and now you need a full name for a letter, a badge, a mailing list or a lookup key. Joining texts in Excel is called concatenation. There are several ways to do it, and the main details to get right are the space between the names, empty middle names that would leave double spaces, and the format of the result.

The example data

First, middle and last names in A1:C5. Only John has a middle name, and the last row was typed in lower case.

Every version: the & operator

The ampersand joins texts. Put a space in quotes between the two cells:

E2fx=A2&" "&C2
ABCDE
1FirstMiddleLast
2MariaLopezMaria Lopez
3JohnPaulSmith
4AnnaBerg
5liamo'neil

The space must be added explicitly; without it the result is MariaLopez.

Result: Maria Lopez

You can add any text the same way: ="Dear "&A2&"," gives Dear Maria,. The & works in every Excel version, is short, and is what most experienced users type.

The CONCAT and CONCATENATE functions

CONCAT (Excel 2019 and later) and the older CONCATENATE do the same as & written as a function: =CONCAT(A2," ",C2). CONCAT can also take a range, =CONCAT(A2:C2), but it does not add separators, so the result would be MariaLopez. CONCATENATE is kept for compatibility; there is no reason to prefer it in new workbooks.

Excel 2019 and later: TEXTJOIN skips empty middle names

With =A2&" "&B2&" "&C2, Maria's empty middle name leaves two spaces between Maria and Lopez. TEXTJOIN adds a separator between items and, with TRUE as the second argument, ignores empty cells:

E3fx=TEXTJOIN(" ",TRUE,A3:C3)
ABCDE
1FirstMiddleLast
2MariaLopez
3JohnPaulSmithJohn Paul Smith
4AnnaBerg
5liamo'neil

The same formula on row 2 returns Maria Lopez with a single space.

Result: John Paul Smith

In Excel 2016, which has no TEXTJOIN, add the middle name only when it exists: =A2&IF(B2="",""," "&B2)&" "&C2, or join everything and remove the double spaces with TRIM: =TRIM(A2&" "&B2&" "&C2).

Microsoft 365: the whole column at once

Ranges can be joined directly, and the result spills down:

E2fx=A2:A5&" "&C2:C5
ABCDE
1FirstMiddleLast
2MariaLopezMaria Lopez
3JohnPaulSmithJohn Smith
4AnnaBergAnna Berg
5liamo'neilliam o'neil

One formula fills all four rows. The last row keeps its lower case.

Fix the capitalisation

Wrap the result in PROPER to capitalise the first letter of each word: =PROPER(A5&" "&C5) returns Liam O'Neil. PROPER treats the apostrophe as a word break, which is right for O'Neil but turns mcdonald into Mcdonald, not McDonald. More options are in How to capitalize the first letter in Excel.

Other useful formats

ResultFormula
Lopez, Maria=C2&", "&A2
M. Lopez=LEFT(A2,1)&". "&C2
ML (initials)=LEFT(A2,1)&LEFT(C2,1)
[email protected]=LOWER(A2&"."&C2)&"@example.com"
LOPEZ Maria=UPPER(C2)&" "&A2

Without formulas: Flash Fill

Type the full name for the first row in E2 (Maria Lopez), select E3 and press Ctrl+E. Flash Fill copies the pattern down. The results are fixed values: if a name changes later, the full name does not update.

Turning formulas into values

Before you delete the original First and Last columns, convert the formulas into plain text, otherwise they turn into #REF!. Select the results, copy (Ctrl+C), then Home > Paste > Values (Ctrl+Alt+V, then V).

Pitfalls

  • Leading or trailing spaces in the source cells end up in the result. Wrap each part in TRIM or clean the columns first (How to remove spaces in Excel).
  • Numbers and dates lose their format when joined: ="Due "&D2 shows Due 46100 for a date. Format them with TEXT: ="Due "&TEXT(D2,"d mmm yyyy"). See How to convert a date to text in Excel.
  • Results longer than 32,767 characters cause #VALUE! in TEXTJOIN and CONCAT; unusual for names, but possible when joining whole columns.
  • Formula shown as text. If the cell shows =A2&" "&C2 instead of the result, the cell was formatted as Text before you typed. Change the format to General and press F2, Enter.
⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

More how-to recipes