6. Splitting first names and surnames in Excel

In this lesson you learn how to split names automatically.

Splitting names

Recreate the table below:

Figure 6.1 Names
A column in Excel with full names, first name and surname in the same cell.

Column B will contain the first names.
In B2, type the first name of the first person: Marian and press Enter.
In B3, type the first name of the second person: Joris. If Excel recognises the name, press Enter.

Figure 6.2 First names
Excel suggests the next first name as soon as you have typed two of them.

The first names are filled in automatically.

Figure 6.3 First names
The first-name column is complete, filled in automatically by Excel.

Do the same in column C for the surnames.

Figure 6.4 Surnames
The surnames are in a column of their own, filled in automatically by Excel.

Not working? Use Ctrl+E

Excel calls this Flash Fill (Flash Fill). If it doesn't fill in by itself, type the first two names yourself and press Ctrl+E. You'll find the same button on the Data tab as well, in the Data Tools group.

Watch out for name prefixes

With Dutch names, Flash Fill often goes wrong on name prefixes. With "Jan van der Berg", Excel doesn't know whether "van der" belongs to the first name or to the surname. Always check those rows afterwards, or give Excel more examples: type three or four yourself first and only then fill in the rest. The more examples, the better it recognises the pattern.

The second method: Text to Columns

If all the names are neatly separated by a space, this is quicker:

  1. Select the column with the full names.
  2. Go to the tab Data and click Text to Columns.
  3. Choose Delimited and click Next.
  4. Tick Space and click Next.
  5. Under Destination, select an empty column, otherwise you will overwrite your original data.

This method splits at every space. So with "Jan van der Berg" you end up with four columns instead of two. It works fine for a list of simple names, but not for a list with name prefixes.

The third method: with a formula

If you want the split to update when you change the names, use formulas. If the full name is in A2:

  • First name: =LINKS(A2;VIND.SPEC(" ";A2)-1)
  • Surname: =RECHTS(A2;LENGTE(A2)-VIND.SPEC(" ";A2))

The first formula takes everything before the first space, the second everything after it. Here too, everything after the first space ends up in the surname, including the name prefix. For most address files that is exactly right.

What you can do now

There are three ways to split a column of full names: with Flash Fill for a one-off job, with Text to Columns for a large, tidy list, and with formulas if the result needs to update automatically.

Share this chapter: