Remove spaces and hyphens from a TIN
Turn 01 - 2345678 into the nine digits 012345678. Leading zeros stay.
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | A8 | The TIN, with spaces and a hyphen. | "01 - 2345678" |
| 2 | SUBSTITUTE( … "-" … ) | Takes out every hyphen. | "01 2345678" |
| 3 | SUBSTITUTE( … " " … ) | Takes out every ordinary space. | "012345678" |
| 4 | SUBSTITUTE( … 160 … ) | Takes out nonbreaking spaces, which look like spaces. | "012345678" |
Each bracket wraps the one inside it, so Excel works from the inside out. The TINs here are made-up.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A8,"-","")," ",""),UNICHAR(160),"")How to use it
Yellow bar at the top? Click Enable Editing.
- See it work. The Example tab shows 20 made-up examples with the formula already in.
- Use your own IDs. Paste TINs into the green column of the Template tab. The digits fill in by themselves.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Use this only on TINs you have checked. Other marks stay, so look over any result that isn't nine digits.
Microsoft's help: SUBSTITUTE function
OTHER ROUTES YOU MIGHT LIKE

Mask a text identifier except its final four
012345678 → XXXXX5678
Get the template →
Write a masked EIN with its hyphen
012345678 → **-***5678
Get the template →
Write an NPI-ending caption
1234567890 → NPI ending 7890
Get the template →
Merge a few test letters before the whole mailing
Whole mailing → records 2 to 4 only
Take this route →