Keep only IDs of an approved type

Pass an ID through only when its type says NPI or TIN.

What you'll make

In Excel: NPI + 1234567890 becomes 1234567890 (approved type).

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1OR(A8="NPI",A8="TIN")Checks if the type is NPI or TIN.Yes, it says NPI
2B8The ID, unchanged."1234567890"
3"Review ID type"Shown for any other type.Not used for row 8
4IF( … )Uses part 2 if part 1 says yes, else part 3."1234567890"

Read it left to right. Capitals don't matter: npi counts too. The IDs here are made-up.

=IF(OR(A8="NPI",A8="TIN"),B8,"Review ID type")

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 ID's type label and the ID, stored as text, into the green columns of the Template tab. The approved IDs fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

This trusts the type label. Check that each label really matches its ID before you paste.

Microsoft's help: IF function