Remove spaces around hyphens
Turn Reed - Park into Reed-Park, so double last names match and sort.
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | A8 | The name with spaces around its hyphen. | "Reed - Park" |
| 2 | TRIM( … ) | Removes extra spaces, leaving single ones. | "Reed - Park" |
| 3 | SUBSTITUTE( … ," -","-") | Removes the space before the hyphen. | "Reed- Park" |
| 4 | SUBSTITUTE( … ,"- ","-") | Removes the space after the hyphen. | "Reed-Park" |
Each bracket wraps the one above it, so Excel works from the inside out. Other spaces, as in Mary Ann, stay.
=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 ordinary hyphens are fixed. A spaced long dash, like Reed – Park, stays as it is, so check those rows.
Route: Get names ready for the letter
Microsoft's help: SUBSTITUTE function



