Contact

MID Function in Collabora Office Calc: Formula, Examples & Troubleshooting

Text Beginner Collabora Office Calc

Learn the MID formula in Collabora Office Calc: extract a fixed-length substring from a position, with reproducible examples, expected answers and compatibility cautions.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: MID extracts a segment starting at a specified character position. =MID("Invoice-482";9;3) is expected to return 482. Positions start at one, and the third argument is a character count rather than an ending position.

Availability and version history

  • Introduced: the original Collabora release and launch date are not established by the sources reviewed.
  • Availability: documented in the Collabora Office 26.04 MID reference. This supports the desktop-help release scope, without inferring all online or mobile deployments.
  • Platform scope: verify the installed product and its formula settings before moving a workbook between clients.
  • Checked: October 14, 2026. Dedicated product documentation and independent example calculations; no native Collabora execution was performed.

Syntax and position counting

=MID(text; start; number)

text supplies the source, start identifies the first character to extract, and number is the length of the extracted segment. All three arguments appear in Collabora’s documented syntax. The examples use English function names and semicolons; regional settings can change argument separators.

For ABCDE, position 1 is A and position 4 is D. To extract BCD, start at 2 and take 3 characters. Passing 4 as the final argument would request four characters, not “stop at position 4.”

Example 1: preserve the original interior-field controls

=MID("Invoice-482";9;3)
=MID("AB-2026-Q4";4;4)

Expected results: 482 and 2026. The first string has seven letters, then a hyphen, so its numeric suffix begins at position 9. The year in the second string begins immediately after AB-.

Both results are text. A year-looking substring is not automatically a date, and a numeric-looking serial is not automatically a quantity. Keep the original representation until you decide how the extracted field will be used.

Example 2: extract a fixed-width field from several records

Enter AA-0042-OK, BB-0718-NO, and CC-9001-OK in A2:A4. Enter in B2 and fill down:

=MID(A2;4;4)

Expected B2:B4: 0042, 0718, 9001. The two-letter prefix and hyphen occupy positions 1–3; the four-character field occupies positions 4–7.

The rule depends on the fixed input layout. A three-letter prefix shifts every later position. MID does not detect that schema change, so validate the layout before filling a parsing formula down a large import.

For the first source, =MID(A2;5;4) would return 042-. This deliberately shifted example shows how a one-position error can produce a plausible-looking but incorrect field.

Example 3: distinguish length from ending position

=MID("ABCDE";2;3)
=MID("ABCDE";2;4)

Expected results: BCD and BCDE. These are both valid interior slices with different lengths. When a specification gives inclusive start and end positions, calculate the count as end-start+1.

For a field spanning positions 4 through 7, that count is 7-4+1, or 4. Write down the positions or add helper cells while developing a parser rather than repeatedly adjusting a number until the output looks right.

Advanced example: remove a known prefix and suffix

Suppose a controlled feed wraps a variable-length field in ID[ and ]. Enter ID[0042], ID[NORTH-9], and ID[A] in D2:D4. In E2 enter and fill down:

=MID(D2;4;LEN(D2)-4)

Expected E2:E4: 0042, NORTH-9, A. The three-character prefix sets the starting position to four. Subtracting the three prefix characters and one suffix character from the full length gives the field length.

LEN makes the extraction adapt to the interior field’s size. The formula does not verify the wrapper. It should be applied only after confirming that the source follows the exact stated format.

A useful reconstruction control for the first row is:

=LEFT(D2;3)&E2&RIGHT(D2;1)

Expected result: ID[0042]. LEFT and RIGHT take the complementary edges. Matching the original proves the partition preserved its characters, but does not establish that the wrapper or field is valid for your process.

Advanced example: take a field using helper positions

Put AA-0042-OK in G2, the start position 4 in H2 and the inclusive end position 7 in I2. Use:

=MID(G2;H2;I2-H2+1)

Expected result: 0042. Keeping positions in separate cells makes the specification visible and allows a reviewer to inspect it. Validate that the end is at least the start and that both positions fall within the intended source before relying on imported position values.

Boundaries and troubleshooting

The dedicated Collabora page documents ordinary start/count extraction. This guide does not claim a native test of invalid starts, negative counts, requests extending beyond the string, or Unicode grapheme boundaries. Those are separate acceptance tests when your deployment needs them.

Spaces and punctuation count as source characters; cell width does not. Use a fixed, visible ASCII control string first, then test realistic international text separately. A source containing formatting-added leading zeroes can behave differently from a text value that actually stores them.

When the desired field moves with an unpredictable delimiter, its start and count need a search-based calculation. Do not treat the fixed-width examples here as a universal delimiter parser.

Cross-program references and verification

Related guides already published for this function: Microsoft Excel | Google Sheets | LibreOffice Calc | Apache OpenOffice Calc | Gnumeric

These are separate product guides. Similar function names do not establish identical edge cases, version histories or Unicode behavior.

Evidence level: Full manuscript checked against the direct Collabora reference. Original examples are retained and additional results are independently calculated. No native application test, unsupported release range or borrowed LibreOffice lifecycle is claimed.