Remove one identifier label at the start

Turn NPI: 1234567890 into 1234567890, and flag a cell with another label.

What you'll make

In Excel: NPI: 1234567890 becomes 1234567890.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1LEFT(TRIM(A8),LEN(B8))=B8Checks the cell starts with the label, in any case.Yes
2TRIM(MID( … ))Keeps what comes after the label."1234567890"
3"Review prefix"What the cell says when the label isn't there.Not used for row 8
4IF( … )Uses part 2 when the label is there, otherwise part 3."1234567890"

Read it left to right. The result is text, so leading zeros stay. The IDs here are made-up.

=IF(LEFT(TRIM(A8),LEN(B8))=B8,TRIM(MID(TRIM(A8),LEN(B8)+1,999)),"Review prefix")

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

Before you send

Type the label exactly as your file writes it, colon or # included.

Microsoft's help: MID function