Difference between revisions of "Documentation/How Tos/Calc: SEARCH function"
From Apache OpenOffice Wiki
< Documentation | How Tos
OOoWikiBot (talk | contribs) m (Robot: Automated text replacement %s) |
|||
Line 28: | Line 28: | ||
: returns <tt>'''3'''</tt>, if regular expressions are enabled. The "." stands for any single character in a regular expression, so <tt>'''"t.n"'''</tt> matches <tt>'''"ten"'''</tt>. | : returns <tt>'''3'''</tt>, if regular expressions are enabled. The "." stands for any single character in a regular expression, so <tt>'''"t.n"'''</tt> matches <tt>'''"ten"'''</tt>. | ||
− | + | {{Documentation/SeeAlso| | |
− | + | * [[Documentation/How_Tos/Calc: REPLACE function|REPLACE]] | |
− | + | * [[Documentation/How_Tos/Calc: FIND function|FIND]] | |
− | + | * [[Documentation/How_Tos/Calc: SUBSTITUTE function|SUBSTITUTE]] | |
− | + | * [[Documentation/How_Tos/Calc: EXACT function|EXACT]]''' | |
− | + | * [[Documentation/How_Tos/Regular Expressions in Calc|Regular Expressions in Calc]]''' | |
− | + | * [[Documentation/How_Tos/Calc: Text functions|Text functions]]''' | |
− | [[Documentation/How_Tos/Calc: Functions listed alphabetically| | + | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] |
− | [[Documentation/How_Tos/Calc: Functions listed by category| | + | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} |
Revision as of 14:16, 25 February 2009
SEARCH
Returns the position of a string of text within another string.
Syntax:
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 - OpenOffice.org Calc - Calculate).
- A failed search gives the #VALUE! error.
- In Tools - Options - OpenOffice.org Calc - Calculate the setting for Search criteria = and <>must apply to whole cells has no effect.
Example:
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".