Keep the street from a health address

Turn 12 Oak St&Oak St&12 into 12 Oak St in HL7 exports.

What you'll make

In Excel: 12 Oak St&Oak St&12 becomes 12 Oak St.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8&"&"Adds one & at the end, so there is always one."12 Oak St&…&12&"
2"&"The mark between the parts."&"
3TEXTBEFORE( … )Keeps the text before the first &."12 Oak St"

The added & means a part with no & still comes back whole. An empty first part stays blank.

=TEXTBEFORE(A8&"&","&")

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 each street address part into the green column of the Template tab. The street lines fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Paste only the street part, not the whole address. Codes like \T\ stay as they are.

Microsoft's help: TEXTBEFORE function