Remove a fixed-length code after a name

Turn Ava Reed0042 into Ava Reed by removing the last 4 characters.

What you'll make

In Excel: Ava Reed0042 + 4 characters becomes Ava Reed.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1LEN(A8)-B8Counts the characters, minus the code's 4.8
2MAX(0, … )Never lets that number drop below 0.8
3LEFT(A8, … )Keeps that many characters from the start."Ava Reed"
4TRIM( … )Removes any spaces left at the ends."Ava Reed"

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

=TRIM(LEFT(A8,MAX(0,LEN(A8)-B8)))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up names with the formula already in.
  2. Use your own names. On the Template tab, paste the coded names into column A. Put how many code characters to remove into column B. The names fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Count the code's characters exactly. One too few leaves a digit at the end; one too many cuts off a letter.

Route: Get names ready for the letter

Microsoft's help: LEFT function