Syntax, a live playground, a measured position gallery, the 1-based-start trap, and a sourced error library: extracting text from the middle.
Returns num_chars characters starting at start_num. A start below 1 is #VALUE!; a start past the end returns empty.
MID returns num_chars characters starting at a 1-based position. It generalises LEFT and RIGHT — but the start position has its own rules. Every row was measured live in HyperFormula. Click any row to load it.
| Expression | Result | Why |
|---|---|---|
| =MID(A2,2,3) | xce | Start at 2, take 3 |
| =MID(A2,1,3) | Exc | Start 1 is the same as LEFT |
| =MID(A3,3,4) | rmul | Formula from position 3 |
| =MID(A4,2,2) | oo | Lookup middle |
| =MID(A2,2,10) | xcel | Over-length takes the rest |
| =MID("Hello",2,3) | ell | Works on a literal |
| =MID(A2,2,2.9) | xc | Decimal num_chars truncated to 2 |
| =MID(A2,6,1) | "" | Start past the end: empty string |
| Expression | Result | Why |
|---|---|---|
| =MID(A2,0,3) | #VALUE! | Start below 1 is an error |
| =MID(A2,2,-1) | #VALUE! | Negative num_chars is an error |
Edit the table or type any formula — the engine evaluates instantly. Load a preset to see MID slice from the middle, match LEFT at start 1, and take the rest when over-length.
8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.
MID is available across modern Excel, Google Sheets and LibreOffice. It has been in Excel since 2003.
| Platform | Support | Notes | Gotcha |
|---|
MID is one piece. The full course walks the toolkit end to end with live, measured examples.