Keep a name before the last separator
Turn Ava-Reed-0042 into Ava-Reed, cutting at the last separator from column B.
Download Excel templateMicrosoft 365
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | TEXTBEFORE(A8,B8,-1) | Takes what comes before the last separator. | "Ava-Reed" |
| 2 | TRIM( … ) | Removes any spaces left at the ends. | "Ava-Reed" |
| 3 | TRIM(A8) | With no separator, keeps the whole cell. | Not used for row 8 |
| 4 | IFERROR( … ) | Uses part 3 when there is no separator. | "Ava-Reed" |
Each bracket wraps the one above it, so Excel works from the inside out.
=IFERROR(TRIM(TEXTBEFORE(A8,B8,-1)),TRIM(A8))How to use it
Yellow bar at the top? Click Enable Editing.
- See it work. The Example tab shows 20 made-up names with the formula already in.
- Use your own names. Paste export records into column A of the Template tab and their separator into column B. Names fill in by themselves.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Only the part after the last separator is removed. If a record ends with two extra fields, one stays.
Route: Get names ready for the letter
Microsoft's help: TEXTBEFORE function
OTHER ROUTES YOU MIGHT LIKE

Keep a name after the last separator
NE|Active|Ava Reed + | → Ava Reed
Get the template →
Flip surname-first fields at a separator
de la Cruz|Mary Ann + | → Mary Ann de la Cruz
Get the template →
Flip Last, Given, Suffix names
Reed, Ava Marie, Jr. → Ava Marie Reed Jr.
Get the template →
Fix "Dear ," when a first name is blank
(blank) → Dear colleague,
Take this route →