Contact

SEARCH Function (OpenOffice Calc)

Text Intermediate OpenOffice Calc

Learn the SEARCH function in Apache OpenOffice Calc: Looks for one text value within another (not case-sensitive).

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

Availability and version history

  • Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
  • Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.

SEARCH returns the one-based position of a match without requiring the same letter case. It can perform a regular-expression search when the document’s formula-regex option and the search string select that mode. That product setting matters when a search term contains punctuation with pattern meaning.

Syntax and arguments

=SEARCH(find_text; text; start)
=SEARCH(find_text; text)

find_text and text are required. Optional start defaults to 1; supply a whole-number position within the source string. In the pinned 4.1.16 implementation, an explicit numeric start is approximately floored and the internal length bound is checked. The returned position is relative to the complete source, not the remaining suffix. English function names and semicolon argument separators are used here.

Reproducible examples

Formula Expected result
=SEARCH("Cat";"bobcat") 4
=SEARCH("A";"banana") 2
=SEARCH("A";"banana";3) 4
=SEARCH("WEST";"north-west") 7
=SEARCH("ab";"ABab";2) 3
=SEARCH("-";"AB-0042") 3

The first formula preserves the original guide’s worked example. Its historical comparable LibreOffice 25.2 check was not an OpenOffice test. New results are independently checked reference expectations; no fresh native or GUI test is claimed. Here "" denotes zero-length text.

Practical worksheet: locate case-insensitive region labels

Enter North-West, north-west and NORTH-WEST in A2:A4. In B2 enter =SEARCH("west";A2) and fill down. All three results are 7. In C2 enter =MID(A2;B2;4) and fill down; the original substrings are West, west and WEST. SEARCH ignores case for the match but does not change the stored source text.

Add North-East in A5. SEARCH(“west”;A5) has no match and produces an error, not position zero. Decide whether missing labels are expected data or malformed records before wrapping the search in broad error-handling logic.

Advanced applications

Distinguish literal and pattern searches. With formula regular expressions enabled, =SEARCH(".";"A.B") can match the first character and return 1 because a dot is a pattern metacharacter. With that option disabled, the literal dot is at position 2. The inspected MayBeRegExp helper consults the document option and recognizes metacharacters; this is not a universal wildcard contract. Use FIND for a literal case-sensitive punctuation search, or explicitly define and test a literal case-insensitive strategy.

Do not import wildcard assumptions. In a regex-enabled search, a.*b describes a pattern from a through any sequence to b; it is not the same syntax as an ordinary literal substring. These pattern examples explain source-selected mode, not a fresh native regex-engine test. Keep configuration with the workbook’s documented requirements.

Search a later occurrence. With A-B-C in A2, SEARCH("-";A2) returns 2, and =SEARCH("-";A2;3) returns 4. The second result is not 2 merely because the search started at the third character.

Errors, edge cases and troubleshooting

A missing match or an ordinary start outside the text follows the no-value path. Use a positive integer start no greater than LEN(text); do not probe huge negative or overflowing values to discover accidental integer-conversion behavior. An empty source has no valid ordinary starting position.

Formula-regex configuration can explain why a punctuation search behaves differently across workbooks. A period, bracket or asterisk should not automatically be treated as an ordinary character. The selected ordinary examples contain no active metacharacter pattern and use ASCII to avoid unverified locale-specific case equivalences.

SEARCH does not return the number of matches or the matched text. Use MID/LEFT/RIGHT with explicitly derived boundaries when extracting. Hidden spaces and imported leading zeros affect positions; preserve identifiers as text. Do not infer UTF-8 byte offsets or visual-grapheme slicing rules from these ASCII cases. Case-insensitive matching also does not prove two complete identifiers are equivalent.

Documentation and verification

See the Apache OpenOffice SEARCH reference, 4.1.16 text-function help, and versioned interpreter. The official source snapshots were retrieved on October 13, 2026 and re-read for this guide; no new retrieval date is implied. Source inspection and reference calculations do not certify native encoding, locale or extreme-input behavior. First introduction and final functioning version remain unestablished; the lifecycle section identifies documented support.