Practice by topic / Excel / Text Functions

Split First and Last Names Exercises

FIND locates the space (or comma, or @), LEFT takes the text before it and MID or RIGHT the text after: =LEFT(A2,FIND(" ",A2)-1) returns the first name and =MID(A2,FIND(" ",A2)+1,100) the last. The same pattern splits email addresses, codes and "Last, First" lists. These 10 exercises build up step by step, starting with get the first name, get the last name with right, get the last name with mid.

3 of 10 free · no sign-up needed · graded on the formula you write

1

Get the First Name

Free

A2 holds a full name. Write a formula in B2 that returns the first name (everything before the space).

AB
1Full name
2Sarah Lim?
Show the solution

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

Right — FIND gives the position of the space, and LEFT takes everything before it.

Expected result in B2: Sarah

Try it in the live spreadsheet →
2

Get the Last Name With RIGHT

Free

A2 holds a full name. Write a formula in C2 that returns the last name (everything after the space) using RIGHT, LEN and FIND.

ABC
1Full name
2Sarah Lim?
Show the solution

Use =RIGHT(A2,LEN(A2)-FIND(" ",A2))

Good — the total length minus the position of the space is the number of characters in the last name.

Expected result in C2: Lim

Try it in the live spreadsheet →
3

Get the Last Name With MID

Free

A2 holds a full name. Write a formula in C2 that uses MID to return everything after the space.

ABC
1Full name
2Daniel Wong?
Show the solution

Use =MID(A2,FIND(" ",A2)+1,100)

Right — start one character after the space and ask for more characters than you'll ever need.

Expected result in C2: Wong

Try it in the live spreadsheet →
4

Text Before a Comma

A2 holds a name written as 'Last, First'. Write a formula in B2 that returns the last name (everything before the comma).

AB
1Name (Last, First)
2Tan, Mei Ling?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
5

Text After a Comma

A2 holds a name written as 'Last, First'. Write a formula in C2 that returns the first name (everything after the comma and the space that follows it).

ABC
1Name (Last, First)
2Tan, Mei Ling?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
10

Clean the Name, Then Take the First Part

A2 holds a name with extra spaces and no capitals. Write a formula in B2 that returns the first name in proper case.

AB
1Full name (as typed)
2 ahmad ismail ?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →