Read a provider ID from a data snippet

Turn JSON text like {"providerId":"000123"} into 000123, zeros kept.

What you'll make

In Excel: {"providerId":"000123"} becomes 000123.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The text."{"providerId":"000123"}"
2TEXTAFTER( … ,"""providerId"":""")Keeps the text after "providerId":"."000123"}"
3TEXTBEFORE( … ,"""")Keeps the text up to the next quote mark."000123"
4IFERROR( … )Shows Review field when there is no quoted providerId."000123"

Each bracket wraps the one before it, so Excel works from the inside out. Two quote marks in a row stand for one ".

=IFERROR(TEXTBEFORE(TEXTAFTER(A8,"""providerId"":"""),""""),"Review field")

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 list. Paste the text into the green column of the Template tab. The provider 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 for short, simple text. A space after the colon, or a providerId listed twice, needs a look.

Microsoft's help: TEXTAFTER function