Contact

FINDB Function (LibreOffice Calc)

Text Beginner LibreOffice Calc LibreOffice 6.0

Find case-sensitive text by Calc byte position with LibreOffice FINDB. Work through mixed CJK and ASCII strings, optional starts and partial-character boundaries.

Verification status: Eight ordinary formula examples were recalculated in LibreOfficeDev 26.8.0.0.alpha0 (2c87e51eeaa2b413ff4ae097b2705eea1995d8e5) using headless XLSX import and forced recalculation. Exact saved text/positions and both controls were checked. LibreOffice 26.8.1.1 was source-checked only; no stable-release or GUI execution is claimed. How formula examples are checked

Quick answer: =FINDB("国";"中国") returned 3 in the tested development build.

Availability and version history

  • Introduced: Introduced in LibreOffice 6.0.
  • Supported in: LibreOffice 26.8 Help and 26.8.1.1 registration; no retirement is established.
  • Scope: Desktop Calc, English semicolon-separated formulas. The byte convention is not a file-encoding byte offset.
  • Checked: October 14, 2026. Eight listed formulas were recalculated in LibreOfficeDev 26.8.0.0.alpha0 using headless XLSX import. Stable releases and 26.8.1.1 were not executed.

What FINDB returns

FINDB locates a literal, case-sensitive substring and returns its one-based position in Calc’s byte-counting convention. For the Chinese characters and full-width letters used here, the inspected helper counts two units per character; ASCII letters count one. These are not UTF-8 file offsets. Function Help.

Syntax and arguments

FINDB(FindText; Text[; Position])

Square brackets mark an optional argument; do not type them. FindText is the literal substring to locate. Text is the containing string. Position is optional and defaults to 1. It chooses the one-based byte position at which the search starts. The source accepts two or three arguments and reads the start through its string-position conversion helper.

Eight reproducible examples

The native column is from LibreOfficeDev 26.8.0.0.alpha0, build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5, using headless XLSX import and forced recalculation. Text is quoted to distinguish empty strings and spaces. Delimiting quotation marks are not returned characters.

Formula Independent reference LibreOfficeDev result
=FINDB("国";"中国") 3 3
=FINDB("B";"A中国B") 6 6
=FINDB("中";"A中国B") 2 2
=FINDB("a";"aAa";2) 3 3
=FINDB("a";"LibreOffice Calc") 15 15
=FINDB("中";"中国中国";3) 5 5
=FINDB("国";"中国";2) 3 3
=FINDB("ffi";"office") 2 2

Practical worksheet

For the text A中国B, the positions are A=1, 中=2–3, 国=4–5 and B=6. Thus FINDB(“B”;“A中国B”) returns 6, even though B is the fourth visible character. A character-counting FIND result and a FINDB result should not be mixed in the same extraction formula without checking the intended units.

Case matters. Starting at position 2 in aAa, a search for lowercase a skips uppercase A and finds the final a at position 3. SEARCHB’s corresponding case-insensitive example finds position 2 instead.

A practical use is locating a fixed label in a legacy mixed-width field before passing the result to another byte-oriented function. Keep the source text, search term and returned position in separate cells so that an unexpected index can be checked against the actual string.

Advanced interpretation and checks

The callback first computes the byte lengths of both strings. It then constructs the suffix starting at Position using its byte-aware right helper, performs an ordinary literal substring search, and converts the matching prefix length back into a byte count. Finally it adds the original starting position.

A start in the second half of a two-unit character is not silently rounded to the next complete character: the byte helper can substitute a space. In the listed search for 国 within 中国 starting at 2, the suffix is a space followed by 国, and the match is still reported at byte position 3.

The official full-width example returns 15 for a inside LibreOffice Calc. The twelve ASCII characters occupy positions 1–12, full-width C occupies 13–14 and full-width a begins at 15. That breakdown is more informative than interpreting 15 as the fifteenth displayed character. Inspected implementation.

Boundaries and troubleshooting

The inspected guard rejects a start below 1 or beyond the last possible starting position for the search term. A literal that is not found follows the no-value error branch. Those error branches were source-reviewed, not part of the ordinary native table.

FINDB does not use the SEARCHB pattern-detection path. Do not assume wildcard or regular-expression behavior from the similar function names. Conversely, do not treat its byte index as an offset into a UTF-8 export.

The byte helper has locale-specific treatment for backslash and euro sign under a configured Japanese system language. Those characters and locale differences were not in this fixture. Fractional starts, supplementary characters and every possible Unicode block were not exhaustively tested.

Official evidence and checking scope

The exact saved formulas and text were reconciled, including ODF repeated-space elements. The stale SUM cache refreshed to 3 and the uncached SUM returned 7. This is headless development-build evidence, not a stable-release or GUI test.