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: See the evidence and test scope described in this guide. How formula examples are checked
MID returns a specified number of characters starting at a one-based position. For CA-2048-R1, =MID(A2,4,4) returns the text 2048. The start is character 4, immediately after the first hyphen.
Availability and version history
- Introduced: Documented in Apple’s Formulas and Functions Help 15.4; the original introduction release is not established.
- Availability: Currently documented in Apple’s Formulas and Functions Help 15.4 edition; this is not a Numbers app version or a final supported-version endpoint.
- Scope: Shared iWork function help. Availability in individual clients and older releases is not established by this check.
- Checked: October 14, 2026, against the official MID reference. Official documentation and independent string checks; no native Numbers execution.
Syntax and the important position limits
MID(source-string, start-pos, string-length)
All three arguments are required. The source may be any value. The numeric start must be at least 1 and no greater than the number of characters in the source. The requested length must be at least 1. Apple does not document an omitted-length default. See the MID reference.
A request extending beyond the remaining characters returns the available remainder. That rule does not authorize starting beyond the source itself. In particular, do not import another program’s empty-result behavior for a start past the end into Numbers’ documented contract.
Set up the original SKU example
Create Catalog, a Numbers table with seven columns A:G and six rows, including one header row. Set A2:A6 to Text and enter the following codes without enclosing quotation characters. Keep the original table unchanged when trying later scenarios.
| Row | A — SKU |
|---|---|
| 2 | CA-2048-R1 |
| 3 | US-7312-R2 |
| 4 | CA-0097-R3 |
| 5 | UK-6005-R1 |
| 6 | US-0120-R3 |
These codes have a two-letter prefix, a four-character identifier and a two-character revision, separated by hyphens. That is an explicit input convention, not a rule imposed by the function. Keeping the entire code as text preserves 0097 and 0120 for later extraction.
Keep four-character identifiers as text
Put =MID(A2,4,4) in B2 and fill through B6. Expect 2048, 7312, 0097, 6005, 0120. The zeros in rows 4 and 6 remain part of the returned strings.
In C2 enter =LEN(B2) and fill through C6 for 4 throughout. In D2 put =ISTEXT(B2) and fill through D6 for TRUE. A four-character identifier is not equivalent to a number merely because its characters happen to be digits.
For a deliberate position comparison, put =MID(A2,3,4) in E2 and fill through E6. Expect -204, -731, -009, -600, -012. Position 3 includes the hyphen and loses the final identifier character. This makes an off-by-one mistake visible without overwriting the correct B results.
In F2 enter =FIND("-",A2)+1 and fill through F6 for 4. G2 =F2=4 filled through G6 is TRUE for the original fixed-width sample.
Apple’s start and length examples
Create MiddleControls, with three columns and five rows. Put these formulas in A2:A4:
| Cell | Formula | Expected text |
|---|---|---|
| A2 | =MID("lorem ipsum dolor sit amet",7,5) |
ipsum |
| A3 | =MID("1234567890",4,3) |
456 |
| A4 | =MID("shorten",5,20) |
ten |
B2 =LEN(A2) filled through B4 gives 5,3,3. C2 =ISTEXT(A2) filled through C4 is TRUE. The last example requests twenty characters from a valid fifth-character start; only three remain. No padding characters are added.
Advanced: a variable-width field between two hyphens
Create VariableIDs, with seven columns and five rows. Enter the following text in A2:A5:
| Row | Code | First hyphen | Second hyphen | Start | Length | Extracted ID |
|---|---|---|---|---|---|---|
| 2 | CA-2048-R1 |
3 | 8 | 4 | 4 | 2048 |
| 3 | US-73120-R2 |
3 | 9 | 4 | 5 | 73120 |
| 4 | C-7-R3 |
2 | 4 | 3 | 1 | 7 |
| 5 | GLOBAL-0097-R10 |
7 | 12 | 8 | 4 | 0097 |
Use B2 =FIND("-",A2), C2 =FIND("-",A2,B2+1), D2 =B2+1, E2 =C2-B2-1, F2 =MID(A2,D2,E2) and G2 =LEN(F2). Fill B2:G2 through row 5. G repeats E’s lengths, confirming that every requested segment was available.
The combined formula, in F2 instead of the helper-based version, is equivalent:
=MID(A2,FIND("-",A2)+1,FIND("-",A2,FIND("-",A2)+1)-FIND("-",A2)-1)
You may keep the helper version and compare the combined formula in a new H column instead; do not place it over an input. The method handles both variable prefix width and variable identifier width, while retaining the original five-character 73120 example.
A correct substring can still describe a malformed record
Copy VariableIDs as ExtraField and change only A2 to CA-20-48-R1. B2/C2 become 3/6, D2 is 4, E2/G2 are 2 and F2 becomes 20. The formula extracts the first middle field correctly, but the record has an extra separator. It does not reconstruct a hypothetical identifier 2048.
Adjacent hyphens would calculate a requested length of zero. A missing second hyphen would prevent the boundary calculation. These cases fall outside this two-delimiter, nonempty-field exercise and require a separate validation decision. Checking only that an extracted result is text is not a sufficient validation test.
Choose the operation that matches the question
LEFT and RIGHT work from the edges; FIND supplies a position. TEXTBETWEEN is another way to describe a delimiter-based task, with a different argument contract.
Before copying a formula to another table, select its intended input cells rather than assuming A2 still names the desired source. Keep extracted identifiers as text if their leading zeros have business meaning.
Input boundaries and portability
The exercises use ordinary ASCII identifiers with explicitly positioned spaces. Apple’s LEN reference counts graphemes, including spaces and special characters. Do not replace that contract with a byte count or extrapolate these examples to every Unicode sequence.
The references are local to the table containing each formula. English examples use commas between arguments; Apple’s syntax guidance specifies semicolons when the decimal separator is a comma. Similar function names in other spreadsheet programs do not establish identical argument bounds, error labels, imports or reference notation.
Exact error presentation, fractional arguments, empty inputs and custom-formatted numeric conversions beyond Apple’s explicit examples remain unverified. Preserve meaningful spaces and leading zeros rather than applying cleanup or numeric conversion automatically.