Formula explainer

Extract text between characters with MID and FIND

New
ResultCalculating…

To extract text between two hyphens, FIND calculates where the delimiters sit and MID uses those positions as its starting point and length. Here it pulls AX42 from SKU-AX42-WEST.

Inside the formula

  • ↗

Example data

How this MID formula works

The first hyphen is character 4, so extraction begins at 5. The second hyphen is character 9, making the slice four characters long; MID returns AX42.

The top row above is the whole formula. Open any argument that holds a calculation of its own to see the values it used. Excel works out those inner parts first, because the function around them needs their results. Edit a cell in the grid to see every value update.

Try your own formula and data

The sample spreadsheet is fully editable. Change the formula or any cell it references. The intermediate values recalculate in your browser.

Practice with an exercise

Here is an exercise that uses MID. Type the formula into a real spreadsheet and we will check your answer as you go.

Parse full address

Intermediate

Extract city from a full address string (assume consistent format).

Open exercise

Common mistakes with MID

If this formula is not doing what you expect, one of these is usually why.

Why does this MID FIND formula return #VALUE!?

FIND could not locate one of the expected hyphens. Check that the source text contains both delimiters and that the formula uses the correct character.

Why is the first or last character missing?

The +1 and -1 adjustments define the slice inside the delimiters. Removing or duplicating one shifts the starting point or length.

Is FIND case-sensitive?

Yes. FIND distinguishes uppercase and lowercase text. Use SEARCH when the text match should ignore case.

Is there a simpler formula in modern Excel?

TEXTBEFORE, TEXTAFTER, and TEXTSPLIT can be easier when available. MID and FIND remain useful in older Excel versions and when you need exact positions.