MID Function in Apple Numbers: Extract Characters from the Middle
Use MID in Apple Numbers for substring extraction, reproducible SKU segment parsing and troubleshooting.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Apple Numbers. How formula examples are checked
Quick answer: MID extracts a specified number of characters starting at a 1-based position inside a string. In CA-2048-R1, =MID(A2,4,4) returns the expected text 2048. Its main advantage over LEFT or RIGHT is that the segment can start inside the source text.
Exact official syntax
=MID(source-string, start-pos, string-length)
| Argument | Required? | Official behaviour and constraints |
|---|---|---|
source-string |
Yes | Source value, whose characters are considered as text. |
start-pos |
Yes | Starting position, counting the first character as 1. Apple says it must be at least 1 and no greater than the number of characters in the source string. |
string-length |
Yes | Number of characters requested, at least 1. All three arguments are required; omitted length is not a documented default. |
Apple notes that a requested length that runs beyond the available source text returns the remainder from the start position. Its MID("shorten",5,20) example yields ten. Do not teach start-pos = 0, a position past the end, or string-length = 0 as supported under the current Apple reference.
Numbers version, platform and regional settings
The function’s current English documentation is in Apple Formulas and Functions Help 15.4, reviewed 2026-10-11. This is a documentation version, not proof that the formula first appeared in Numbers 15.4. Apple’s Functions Help welcome describes its use alongside iWork apps on Mac, iPhone, iPad and iCloud.com. The individual reference does not certify identical behavior on every older Numbers release or browser/device build. No Mac, iPhone, iPad, or iCloud Numbers session was executed for this guide. Where an older release matters, check its formula editor and retest the sample.
Examples below use references inside one Numbers table. Apple’s cell reference guide documents A2 and A2:A6 for the current table, and qualified forms such as Catalog::A2 or Sheet 2::Catalog::A2 for cells in other tables or sheets. Select the cell in the editor when unsure about the qualifier. Numbers is table-centric; don’t replace :: with an Excel worksheet !.
Apple’s syntax guide shows commas between arguments for locales that do not use a decimal comma. When the decimal separator is a comma, use semicolons between function arguments you type manually. This changes the delimiter, not the order or meaning of arguments. Formula names are case-insensitive when typed, although Apple shows them in uppercase.
Reproduce the sample in Numbers
Create a table named Catalog with one header row and these five text values. Enter the codes as text, not numeric cells, so the leading zero in row 4 survives import.
| Row | Column A — SKU (text) |
|---|---|
| 2 | CA-2048-R1 |
| 3 | US-7312-R2 |
| 4 | CA-0097-R3 |
| 5 | UK-6005-R1 |
| 6 | US-0120-R3 |
Put the formula into a free cell in column B of the same table and fill/copy down as indicated. The codes follow the documented example pattern two-letter region, hyphen, four-character identifier, hyphen, two-character revision. This is a teaching assumption, not a promise that real imported SKUs always follow that structure.
Worked example: take the middle four characters
In B2 type:
=MID(A2,4,4)
Positions in CA-2048-R1 are 1:C, 2:A, 3:-, 4:2, 5:0, 6:4, 7:8, 8:-, 9:R, 10:1. Thus positions 4–7 spell 2048.
| Row | Source | Expected middle ID |
|---|---|---|
| 2 | CA-2048-R1 |
2048 |
| 3 | US-7312-R2 |
7312 |
| 4 | CA-0097-R3 |
0097 |
| 5 | UK-6005-R1 |
6005 |
| 6 | US-0120-R3 |
0120 |
Copy B2 down the rows. These are text identifiers. Treat 0097 as a four-character string rather than converting it into the number 97. If the input code changes position conventions, a fixed-position formula needs revision.
Advanced scenario: a variable-length identifier between hyphens
For codes of the general pattern region-identifier-revision where the middle identifier length can vary, combine Apple’s 1-based FIND with MID:
=MID(A2,FIND("-",A2)+1,FIND("-",A2,FIND("-",A2)+1)-FIND("-",A2)-1)
For CA-2048-R1, FIND locates the hyphens at positions 3 and 8. MID starts at 4 and takes 8-3-1 = 4 characters, so the expected result is 2048. For US-73120-R2, the second hyphen moves to position 9, and the same formula returns 73120 (five characters). Use this only for two-hyphen codes with nonempty middle components. If the second hyphen is missing or two delimiters are adjacent, the FIND calls or Apple’s minimum length rule invalidate the assumed workflow. Validate the structure before applying it to bulk data.
Errors, limitations, and troubleshooting
- Off by one: Positions start at 1, not 0. For this table, the first digit is at 4, not 3.
- Wrong value or blank: Check that the source is the intended cell, not a different table’s A2.
- Invalid argument: Apple’s current guide constrains
start-posto existing characters andstring-lengthto at least one; don’t rely on how other spreadsheet engines treat 0 or out-of-range positions. - Mixed ID formats: A row without a prefix or with extra embedded hyphens may give a plausible but incorrect substring. Check against the input schema.
- String versus number: MID returns text; if the leading zeros are significant, do not coerce the result to a number.
- Locale: If your locale uses decimal commas, replace argument-separating commas with semicolons when manually typing.
Cross-software differences
Excel and Google Sheets support functions called MID with broadly comparable text, start, length intent, but they may not impose exactly the same bounds or produce identical errors for unusual inputs. The formula above is documented for Apple Numbers; verify conversions before copying edge-case formulas into Excel or Google Sheets. Numbers’ table-qualified references also differ from Excel’s worksheet-qualified references.
Related guides
- TEXTBETWEEN in Apple Numbers — a delimiter-aware alternative, present in the owner’s October 10 snapshot.
- TEXTAFTER in Apple Numbers — retrieve text after a known marker, present in that snapshot.
- Apple LEFT reference and Apple RIGHT reference — start/end alternatives.
- Apple FIND reference — location of delimiters for variable-length slices.
Official reference and verification
- Apple Numbers — function documentation
- Functions Help welcome
- cell reference guide
- syntax guide
- Apple LEFT reference
- Apple RIGHT reference
- Apple FIND reference
Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in Apple Numbers.
- No genuine Apple Numbers screenshots are included; this guide does not use mock application images.