Take the first name with TEXTBEFORE
PremiumIn B2, use TEXTBEFORE to get the text in A2 before the first space.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Full name | First name | ||||
| 2 | Maria Lopez Garcia | |||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
Premium lesson
Unlock SUBSTITUTE, TEXTBEFORE and TEXTAFTER and every other lesson
This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.
It comes up in this mock test: Excel test for admin jobs
Why this works
TEXTBEFORE(A2," ") returns everything before the first space: "Maria". It does the same job as =LEFT(A2,FIND(" ",A2)-1) without the counting. A third argument picks another match: -1 means the last space, so =TEXTBEFORE(A2," ",-1) gives "Maria Lopez".
Common mistake: Expecting TEXTBEFORE to split at every space. It stops at the first one unless you give it an instance number.
The answer
- B2
=TEXTBEFORE(1A2,2" ")
In plain words: Return the text in 1the full name in A2 that comes 2before the first space.