Extract the Value After a Label

Excel Formulas › Text

All versionsMID

From “Name: Ann Lee” or “Total=42,” pull the value after the label. SEARCH for the label, then take everything after it — great for parsing semi-structured text.


Quick formula: value after “Name:” in A2:
=TRIM(MID(A2, SEARCH("Name:", A2) + LEN("Name:"), 100))
Find the label, jump past it (add its length), and take the rest. TRIM cleans the leading space.

Functions used (tap for the full reference guide):

The example

The value following a label.

AB
1TextAfter 'Name:'
2ID: 7 | Name: Ann LeeAnn Lee

The formula

Everything after the label:

=TRIM(MID(A2, SEARCH("Name:", A2)+LEN("Name:"), 100)) // pulls the value

How it works

Locate the label, skip past it:

  1. SEARCH("Name:", A2) returns where the label starts (case-insensitive).
  2. Add LEN("Name:") to jump past the label to the value.
  3. MID(…, 100) grabs the rest; TRIM removes the leading space.
  4. If the value ends at a delimiter (like |), use TEXTBEFORE/FIND to stop there instead of taking everything.

Value between two labels: combine — take text after “Name:” and before the next delimiter. In 365, =TEXTBEFORE(TEXTAFTER(A2,"Name: "), "|") isolates a field cleanly.

Try it: interactive demo

Live demo

Text and a label.

Value:

Variations

Stop at a delimiter

Field between labels:

=TEXTBEFORE(TEXTAFTER(A2,"Name: "),"|")

365 simple

After the label:

=TEXTAFTER(A2, "Name: ")

Numeric value

Convert the result:

=VALUE(TEXTAFTER(A2,"Total="))

Pitfalls & errors

Label not found = error. SEARCH errors if the label is missing — wrap with IFERROR.

Include the colon/space. Search for the full label (“Name:”) so you land right before the value.

Taking too much. MID(…,100) grabs to the end; stop at a delimiter if other fields follow.

Practice workbook

📊
Download the free Extract the Value After a Label practice workbook
A label-parser with the delimiter, 365, and numeric variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I extract the value after a label in Excel?
Use =TRIM(MID(A2, SEARCH("Name:", A2)+LEN("Name:"), 100)). It finds the label, skips past it, and returns the rest. In 365, =TEXTAFTER(A2, "Name: ").
How do I stop at the next field?
Combine TEXTAFTER and TEXTBEFORE: =TEXTBEFORE(TEXTAFTER(A2,"Name: "),"|") isolates the value before the next delimiter.
What if the label isn't there?
SEARCH returns an error. Wrap the formula in IFERROR to return a blank or message.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: TEXTBEFORE & TEXTAFTER · Extract between · Split text

Function references: MID · SEARCH