Instant digital downloadExcel and Google SheetsSecure card checkout

Excel and Google Sheets how-to

Combine first and last name into one cell

First names in one column, last names in the next, and you need "Ana Lopez" in one cell. The & sign joins them.

ABCD
1FirstLastFull name
2AnaLopezAna Lopez
3RajPatelRaj Patel
4KimNguyenKim Nguyen
5LeeBrownLee Brown
6SamOrtizSam Ortiz

Sample data. First names in A, last names in B, the formula in D2 is copied down.

The formula

Click the first Full name cell (D2) and type:

=A2&" "&B2

D2 shows Ana Lopez. Copy it down and every row joins its own names.

  • & joins two pieces of text.
  • " " is a space in double quotes. Without it you get AnaLopez.

The same result with a function: =CONCATENATE(A2," ",B2) also gives Ana Lopez.

Last name first

Swap the order and put a comma and a space in the middle:

=B2&", "&A2

Row 2 shows Lopez, Ana, handy for a list sorted by surname.

A middle name that is sometimes empty

With first, middle and last names in G, H and I, joining all three with & leaves two spaces wherever the middle name is blank ("Ana  Lopez"). TEXTJOIN skips the empty cell:

=TEXTJOIN(" ",TRUE,G2,H2,I2)

Raj K Patel shows as Raj K Patel, and Ana with no middle name shows as Ana Lopez with one space. The TRUE tells it to ignore empty cells. TEXTJOIN is in Excel 2019 and later, Microsoft 365 and Google Sheets.

Fix the capitals

Names typed as "ana" and "LOPEZ"? PROPER makes the first letter of each word a capital and the rest small:

=PROPER(K2&" "&L2)

The result is Ana Lopez. Check names like McDonald by eye afterwards, since PROPER gives Mcdonald.

Extra spaces

Names pasted from a form often carry spaces before or after them. TRIM removes those and turns double spaces into single ones:

=TRIM(M2&" "&N2)

"  Kim " and "Nguyen " come out as Kim Nguyen.

Initials

LEFT takes the first letter of each name:

=LEFT(A2,1)&LEFT(B2,1)

Ana Lopez becomes AL. The & sign, CONCATENATE, PROPER, TRIM and LEFT work in every version of Excel and in Google Sheets.

Templates with the math already done

Rather skip the formulas? These templates come with every formula built and checked, plus a filled-in sample.

More how-tos