Contact

SEARCH Function in ONLYOFFICE Spreadsheet Editor: Formula and Examples

Text and Data Intermediate ONLYOFFICE Spreadsheet Editor

Use SEARCH and SEARCHB in ONLYOFFICE with worked ASCII examples and clear byte-contract, source and migration cautions.

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

=SEARCH("toronto",A3) has the expected result 9 when A3 contains PO-1047-Toronto. SEARCH locates a substring without requiring the same capitalization and returns its one-based starting position in the original text.

Availability and version history

  • Introduced: The original introduction version and date are not established by the checked references.
  • Availability: Documented in current ONLYOFFICE Spreadsheet Editor help; no final supported-version endpoint is established.
  • Scope: Desktop and Docs release separately. Older builds, mobile clients, localized parsing and imported-workbook parity remain separately unverified.
  • Checked: October 14, 2026, against the official SEARCH reference, vendor illustrations and pinned calculation source. The explicit text examples were independently calculated; these formulas were not executed in a native application.

Syntax and the optional starting position

SEARCH(find_text, within_text, [start_num])

The official reference prints all three arguments in its signature but explicitly describes start_num as optional. Omitting it starts at the beginning. Brackets indicate optional syntax; do not enter them in the formula.

The returned number is a position, not the matching text or the number of occurrences. A missing match produces the documented #VALUE! result. FIND instead requires matching case.

On a separate VendorSearch sheet, enter Online Office in A1 and =SEARCH("line",A1) in C1. The official illustration shows 3: the substring starts after O and n.

Enter the original eight text records

Create TextSearch, reserving A1:H12. Put Source text in A1 and these exact text values in A2:A9. Do not type surrounding backticks or quotation marks.

Cell Text
A2 ORD-4821-ON
A3 PO-1047-Toronto
A4 red-red-red
A5 INV|2026|0412
A6 INV-2025-0412
A7 sales@Example.com
A8 ABC-xyz-ABC
A9 PO-0008-WEST

A5 contains actual vertical bars: INV|2026|0412. The HTML escape only keeps the displayed table aligned. Keep the codes as text so that later extracted fields can retain leading zeros.

Enter the following six formulas in their specified cells. Several deliberately search A3; a formula’s output row does not determine its input.

Cell Formula Expected result
B2 =SEARCH("toronto",A3) 9
B3 =SEARCH("PO",A3) 1
B4 =SEARCH("-",A3) 3
B5 =SEARCH("-",A3,4) 8
B6 =SEARCH("on",A2) 10
B7 =SEARCH("east",A9) #VALUE!

B5 starts after the first hyphen. Its answer is still position 8 in the whole string, rather than position 5 within the shortened search region.

Repeated words and a visible error guard

Keep the original results and add these controls:

Cell Formula Expected result
D2 =FIND("on",A2) #VALUE!
D3 =IFERROR(SEARCH("east",A9),"No match") No match
D5 =SEARCH("RED",A4) 1
D6 =SEARCH("RED",A4,2) 5
D7 =SEARCH("RED",A4,6) 9
F2 =SEARCH("abc",A8,2) 9
F3 =SEARCH("@",A7) 6
F4 =MID(A6,5,4) text 2025

IFERROR changes the presentation of a failed search. It does not prove that the input is valid. Keeping raw B7 beside guarded D3 makes that distinction visible.

Advanced: extract between two delimiters

Create ParsedOrders, reserving A1:F8. Put Code, First hyphen, Second hyphen, Middle, Tail and Middle length in A1:F1. Enter ORD-4821-ON, PO-1047-Toronto and PO-0008-WEST in A2:A4.

Enter these formulas in row 2, then fill B2:F2 through row 4:

B2: =SEARCH("-",A2)
C2: =SEARCH("-",A2,B2+1)
D2: =MID(A2,B2+1,C2-B2-1)
E2: =MID(A2,C2+1,LEN(A2)-C2)
F2: =LEN(D2)
Row Expected B C D E F
2 4 9 4821 ON 4
3 3 8 1047 Toronto 4
4 3 8 0008 WEST 4

The middle values are text. MID supplies the substring and LEN supplies its character count. For the original TextSearch sheet, H3 =MID(A3,SEARCH("-",A3)+1,SEARCH("-",A3,SEARCH("-",A3)+1)-SEARCH("-",A3)-1) combines the same steps and gives 1047.

Copy ParsedOrders as ExtraSeparator and change only A2 to ORD-4821-ON-OLD. B2:F2 now gives 4,9,4821,ON-OLD,4. The middle field is unchanged while the tail includes the additional separator. Successful extraction therefore does not validate the entire record’s format.

Wildcards: distinguish source evidence from the short help

The pinned calculation source translates ? to a single-character match, * to a sequence match, and ~?/~* to literal punctuation. The short function help does not explain these rules. For ordinary ASCII strings, its source-derived controls on a separate PatternChecks sheet are:

Cell Formula Expected source-model result
B2 =SEARCH("?ed","red-red-red") 1
B3 =SEARCH("*RED","red-red-red") 1
B4 =SEARCH("~?","Ready? Yes") 6
B5 =SEARCH("~*","A*B") 2

These examples do not establish every escaping combination, newline match or Unicode case-folding rule. Treat text supplied by someone else as a possible pattern when using this implementation, rather than assuming all punctuation is literal.

Limits and troubleshooting

Use positive integer starting positions within the text for these exercises. The checked source rejects starts outside that range and has a separate empty-search branch; localized errors, fractional starts, array inputs and imported-workbook parity remain unverified. SEARCHB has a documented byte-oriented role and should not be treated as a mere spelling replacement for character-based SEARCH.

If an expected position differs, inspect the exact input for spaces and extra separators, then compare the raw search with its guard. For a whole-cell, case-sensitive identity check, use EXACT rather than inferring equality from a found substring.

SEARCHB: documented byte-oriented variant

SEARCHB(find_text, within_text, [start_num])

The search text and source text are required. The vendor prints start_num without brackets in the syntax line but describes it as optional; brackets here express that documented optionality. Omission starts at the beginning. Matching ignores case.

Documentation and implementation are different evidence

The official SEARCH/SEARCHB reference describes SEARCHB for byte-oriented or double-byte-character-set language use. However, the pinned SEARCHB implementation directly inherits SEARCH, without a separate calculation override in that definition. This is a documented-contract versus inspected-implementation discrepancy, not proof that all clients implement a separate DBCS byte algorithm.

The added coverage was checked on October 19, 2026. Neither the first supported version nor a last supported version is established. The source revision is evidence about that revision, not native execution, a universal Unicode rule or cross-version compatibility.

Worked ASCII controls for SEARCHB

On a separate SearchbControls sheet, enter the following formulas into individual empty cells. They contain their inputs, so they do not overwrite the earlier worksheets. Results are independently reasoned from ordinary ASCII and the inherited calculation, not observations from a running ONLYOFFICE editor. Text results remain text; “empty text” means a formula result of zero length.

Formula Expected result Explanation
=SEARCHB("on","ORD-4821-ON",1) 10 Lower-case on matches ON at position 10.
=SEARCHB("-","ORD-4821-ON",5) 9 Starting at 5 skips the first hyphen.
=SEARCHB("Z","ABC",1) #VALUE! Z is absent from the source text.
=SEARCHB("b","ABC") 2 The omitted start begins at the first position.
=SEARCHB("A","ABC",0) #VALUE! The inherited calculation rejects this invalid start.

The lower-case on finds upper-case ON at position 10. Starting at 5 skips the first hyphen but returns position 9 in the full string. SEARCHB inherits the SEARCH pattern handling discussed above; do not assume wildcard punctuation supplied as search text is literal.

Migrating a workbook that uses SEARCHB

Keep a copy of the original formula and its source text. Compare the ASCII controls first, then separately check the real workbook’s Japanese, Chinese or Korean text, mixed-script strings, emoji and combining marks in the intended editor/build and locale. Record actual results instead of deriving them from these ASCII examples.

Do not equate the B suffix with UTF-8 file size, display width or user-perceived characters, and do not silently replace SEARCHB with SEARCH in a workbook whose author depended on byte positions. Matching names and inherited code do not establish import/export parity. Confirm formula separators and language in the destination editor; fractional counts, type conversions and unlisted error cases remain outside this evidence.