Remove spaces around apostrophes
Turn Zoë O' Neill into Zoë O'Neill so names look right on letters and labels.
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | A8 | The name. ' is a straight apostrophe. | "Ava Reed" |
| 2 | TRIM( … ) | Removes extra spaces at the ends and in between. | "Ava Reed" |
| 3 | SUBSTITUTE( … " '" … ) | Removes a space right before an apostrophe. | "Ava Reed" |
| 4 | SUBSTITUTE( … "' " … ) | Removes a space right after an apostrophe. | "Ava Reed" |
Each bracket wraps the one above it, so Excel works from the inside out. Names with no apostrophe stay the same.
=SUBSTITUTE(SUBSTITUTE(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 names into the green column of the Template tab. Fixed names fill in by themselves.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Only straight apostrophes are fixed. Change curly ones (’) to straight first, with lesson 051's formula.
Route: Get names ready for the letter
Microsoft's help: SUBSTITUTE function



