Documentation/How Tos/Calc: SEARCH function

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 09:43, 24 November 2009 by OOoWikiBot (Talk | contribs)

Jump to: navigation, search


Returns the position of a string of text within another string.


SEARCH(findtext; texttosearch; startposition)

returns the character position of the first occurrence of findtext within texttosearch.
startposition (optional) is the position from which the search starts.
The search is not case-sensitive.
The search will use regular expressions, if they are enabled (Tools - Options - Calc - Calculate).
A failed search gives the #VALUE! error.
In Tools - Options - Calc - Calculate the setting for Search criteria = and <>must apply to whole cells has no effect.


SEARCH("yo"; "Yoyo")

returns 1. The search is case-insensitive.

SEARCH("cho"; "choochoo"; 2)

returns 5.

SEARCH("t.n"; "often")

returns 3, if regular expressions are enabled. The "." stands for any single character in a regular expression, so "t.n" matches "ten".


Personal tools