Turn HTML br tags into address lines

Turn an exported 12 Oak St<br>Boston, MA 02108 into two real address lines.

What you'll make

In Excel: 12 Oak St<br>Boston, MA 02108 becomes two address lines.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The address, with web code between its lines."12 Oak St<br>Boston…"
2SUBSTITUTE( … "<br>" … )Swaps each <br> for a real line break. ¶ marks it."12 Oak St¶Boston…"
3SUBSTITUTE( … "<br/>" … )Swaps each <br/> for a line break."12 Oak St¶Boston…"
4SUBSTITUTE( … "<br />" … )Swaps each <br /> for a line break."12 Oak St¶Boston…"

Each bracket wraps the one above it, so Excel works from the inside out.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A8,"<br>",CHAR(10)),"<br/>",CHAR(10)),"<br />",CHAR(10))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own addresses. Paste exported addresses into the green column of the Template tab. The address lines fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Only lowercase <br>, <br/> and <br /> are changed. Other web code stays as it is, so check those rows. Turn on Wrap Text where you paste the results.

Microsoft's help: SUBSTITUTE function