Build a subscriber-plus-dependent ID

Turn XKM441720 and dependent 1 into XKM44172001 for a 2-digit suffix.

What you'll make

In Excel: XKM441720 + 1, width 2 becomes XKM44172001.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1OR(A8="",B8="")Checks if the subscriber or dependent is empty.No
2LEN(B8)>C8Checks if the dependent is longer than the width.No, 1 is not more than 2
3REPT("0",C8-LEN(B8))One zero for each missing place."0"
4IF( … )Flags part 1 or 2, else joins ID, zeros, dependent."XKM44172001"

A Review message shows when part 1 or part 2 says yes. The & joins the subscriber, the zeros and the dependent.

=IF(OR(A8="",B8=""),"Review subscriber/dependent pair",IF(LEN(B8)>C8,"Review dependent width",A8&REPT("0",C8-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 IDs. Paste subscriber IDs and dependent numbers, stored as text, and the width into the green columns of the Template tab. The member IDs fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Use this only when the payer says a member ID is the subscriber plus a set-width dependent number. The IDs here are made-up.

Microsoft's help: REPT function