1TEXTBEFORE and TEXTAFTER
=TEXTBEFORE(A2," ")
- In B2 type =TEXTBEFORE(A2," ") to return the first name.
- In C2 type =TEXTAFTER(A2," ") to return the last name.
- Select B2:C2 and double-click the fill handle to copy both formulas down.
Separate a full name into first and last name with TEXTBEFORE and TEXTAFTER, or use Text to Columns and Flash Fill on the ribbon.
A column holds "Priya Nair" and you need the first name and the last name in separate columns, so you can sort by surname or merge a mail.
The name has a clear separator: the space. That is all a formula needs. TEXTBEFORE returns everything before the space and TEXTAFTER returns everything after it. Both are live, so if the name changes the parts change too.
TEXTSPLIT does both in one step: it spills the pieces across the row. Use it when the number of pieces is not always two.
The ribbon has two shortcuts. Text to Columns splits the cells in place and is permanent. Flash Fill learns a pattern from one or two examples you type and fills the rest. Both produce fixed text, not formulas, so they will not follow later edits.
Before you split, check how your names are written. A middle name or a double-barrelled surname adds spaces, and a formula that cuts at the first space will put the extra words in the last-name column. For names like these, cut at the first space for the first name and at the last space for the surname, or review the odd rows by hand.
Stray spaces at the start or end also get in the way. Run the column through TRIM first if you are unsure. The Logic and text track covers cleaning and splitting in depth.
=TEXTBEFORE(A2," ")
=TEXTSPLIT(A2," ")
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In B2, return the first name from A2, then fill the formula down to B9.
Answer in B2, then it fills down to B9.
Logic and text covers this in lesson 13, TEXTBEFORE and TEXTAFTER.