Turn codes like \F\ back into symbols

Turn Reed\F\Ava into Reed|Ava in one HL7 field.

What you'll make

In Excel: Reed\F\Ava becomes Reed|Ava.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1SUBSTITUTE(A8,"\F\","|")Turns each \F\ into a | bar."Reed|Ava"
2SUBSTITUTE( … ,"\S\","^")Turns each \S\ into a ^ mark."Reed|Ava"
3SUBSTITUTE( … ,"\R\","~")Turns each \R\ into a ~ mark."Reed|Ava"
4SUBSTITUTE( … ,"\T\","&")Turns each \T\ into an & sign."Reed|Ava"
5SUBSTITUTE( … ,"\E\","\")Turns each \E\ into a \ last of all."Reed|Ava"

Each bracket wraps the one above it, so Excel works from the inside out. \E\ goes last so it can't make a new code.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A8,"\F\","|"),"\S\","^"),"\R\","~"),"\T\","&"),"\E\","\")

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 fields. Paste one field per row into the green column of the Template tab. The decoded text fills in by itself.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Use this on one field you have already split out, never on a whole message. Other codes, like \H\, stay as they are.

Microsoft's help: SUBSTITUTE function