Build a letter-reference code

Turn the prefix AB and the number 123 into the letter reference AB000123.

What you'll make

In Excel: AB + 123 becomes AB000123.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The two-letter prefix."AB"
2TEXT(B8,"000000")Adds the number with zeros in front, six digits."AB000123"

Read it left to right. The & joins the two pieces. The result is text, so the zeros stay.

=A8&TEXT(B8,"000000")

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 IDs. Paste prefixes and sequence numbers into the green columns of the Template tab. The codes fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

This doesn't check that a code is new. Make sure each number is used only once in your scheme.

Microsoft's help: TEXT function