Remove a duplicated unit designator

Turn APT and APT 5 into APT and 5, so the label prints APT once.

What you'll make

In Excel: APT + APT 5 becomes 5.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1LEFT(…)=UPPER(A8)&" "Checks if the value starts with APT and a space.Yes
2TRIM(MID( … ))Keeps what comes after APT and the space."5"
3B8The value as typed, when it doesn't start that way.Not used for row 8
4IF( … )Shows part 2 when the check says yes, otherwise part 3."5"

Read it left to right. Capitals don't matter for the check, so apt 5 counts too.

=IF(LEFT(UPPER(TRIM(B8)),LEN(A8)+1)=UPPER(A8)&" ",TRIM(MID(TRIM(B8),LEN(A8)+2,LEN(B8))),B8)

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 unit designator and unit value into the green columns of the Template tab. The clean values fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

APT4 with no space is left as it is. Fix those by hand first.

Microsoft's help: IF function