<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GreatBigBore</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GreatBigBore"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/GreatBigBore"/>
	<updated>2026-05-09T17:36:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Spreadsheets/Spreadsheet_Documents&amp;diff=229302</id>
		<title>Documentation/DevGuide/Spreadsheets/Spreadsheet Documents</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Spreadsheets/Spreadsheet_Documents&amp;diff=229302"/>
		<updated>2013-07-21T15:27:21Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Subject/verb agreement&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/SpreadsheetsTOC&lt;br /&gt;
|SpreadsheetDocs2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Text/TextViewCursor&lt;br /&gt;
|NextPage=Documentation/DevGuide/Spreadsheets/Example: Adding a New Spreadsheet&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:Spreadsheet Documents}}&lt;br /&gt;
{{Download Collection|MediaWiki:Collections/Developer&amp;#039;s Guide - Spreadsheet Documents}}&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
{{PRODUCTNAME}} API knows three variants of tables: text tables (see [[Documentation/DevGuide/Text/Tables|Tables]]), database tables (see [[Documentation/DevGuide/Database/Table Service|Table Service]]) and spreadsheets. Each table concept has its own purpose. Text tables handle text contents, database tables offer database functionality and spreadsheets operate on data cells that can be evaluated. Being specialized in such a way means that each concept has its strength. Text tables offer full functionality for text formatting, where spreadsheets support complex calculations. Alternately, spreadsheets support only basic formatting capabilities and text tables perform elementary calculations.&lt;br /&gt;
&lt;br /&gt;
The implementations of the various tables differ due to each of their specializations. Basic table features are defined in the module &amp;lt;idlmodule&amp;gt;com.sun.star.table&amp;lt;/idlmodule&amp;gt;. Regarding the compatibility of text and spreadsheet tables, the corresponding features are also located in the module &amp;lt;idlmodule&amp;gt;com.sun.star.table&amp;lt;/idlmodule&amp;gt;. In addition, spreadsheet tables are fully based on the specifications given and are extended by additional specifications from the module &amp;lt;idlmodule&amp;gt;com.sun.star.sheet&amp;lt;/idlmodule&amp;gt;. Several services of the spreadsheet application representing cells and cell ranges extend the common services from the module com::sun::star::table. The following table shows the services for cells and cell ranges.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=4 style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-bgcolor=#EDEDED&lt;br /&gt;
!Spreadsheet service &lt;br /&gt;
!Included com::sun::star::table service &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.sheet.SheetCell&amp;lt;/idl&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.table.Cell&amp;lt;/idl&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.sheet.Cells&amp;lt;/idl&amp;gt;&lt;br /&gt;
| - &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.sheet.SheetCellRange&amp;lt;/idl&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.table.CellRange&amp;lt;/idl&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.sheet.SheetCellRanges&amp;lt;/idl&amp;gt; &lt;br /&gt;
| - &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.sheet.SheetCellCursor&amp;lt;/idl&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;idl&amp;gt;com.sun.star.table.CellCursor&amp;lt;/idl&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The spreadsheet document model in the {{PRODUCTNAME}} API has five major architectural areas (see &amp;#039;&amp;#039;Illustration 9.1&amp;#039;&amp;#039;) The five areas are:&lt;br /&gt;
&lt;br /&gt;
* Spreadsheets Container&lt;br /&gt;
* Service Manager (document internal)&lt;br /&gt;
* DrawPages&lt;br /&gt;
* Content Properties&lt;br /&gt;
* Objects for Styling&lt;br /&gt;
&lt;br /&gt;
[[Image:SpreadsheetDocumentOverview.png|none|thumb|400px|Spreadsheet Document Component]]&lt;br /&gt;
&lt;br /&gt;
The core of the spreadsheet document model are the spreadsheets contained in the spreadsheets container. When working with document data, almost everything happens in the spreadsheet objects extracted from the spreadsheets container.&lt;br /&gt;
&lt;br /&gt;
The service manager of the spreadsheet document model creates shape objects, text fields for page headers and form controls that can be added to spreadsheets. Note, that the document service manager is different from the main service manager used when connecting to the office. Each document model has its own service manager, so that the services can be adapted to the document they are required for. For instance, a text field is ordered and inserted into the page header text of a sheet using &amp;lt;idlml&amp;gt;com.sun.star.text.XText:insertTextContent&amp;lt;/idlml&amp;gt;() or the service manager is asked for a shape object and inserts it into a sheet using &amp;lt;code&amp;gt;add()&amp;lt;/code&amp;gt; at the drawpage.&lt;br /&gt;
&lt;br /&gt;
Each sheet in a spreadsheet document can have a drawpage for drawing contents. A drawpage can be visualized as a transparent layer above a sheet. The spreadsheet model is able to provide all drawpages in a spreadsheet document at once.&lt;br /&gt;
&lt;br /&gt;
Linked and named contents from all sheets are accessed through content properties at the document model. There are no content suppliers as in text documents, because the actual content of a spreadsheet document lies in its sheet objects. Rather, there are only certain properties for named and linked contents in all sheets.&lt;br /&gt;
&lt;br /&gt;
Finally, there are services that allow for document wide styling and structuring of the spreadsheet document. Among them are style family suppliers for cells and pages, and a number formats supplier.&lt;br /&gt;
&lt;br /&gt;
Besides these five architectural areas, there are document and calculation aspects shown at the bottom of the illustration. The document aspects of our model are: it is printable, storable, and modifiable, it can be protected and audited, and it supplies general information about itself. On the lower left of the illustration, the calculation aspects are listed. Although almost all spreadsheet functionality can be found at the spreadsheet objects, a few common functions are bound to the spreadsheet document model: goal seeking, consolidation and recalculation of all cells.&lt;br /&gt;
&lt;br /&gt;
Finally, the document model has a controller that provides access to the graphical user interface of the model and has knowledge about the current view status in the user interface (see the upper left of the illustration).&lt;br /&gt;
&lt;br /&gt;
The usage of the spreadsheet objects in the spreadsheets container is discussed in detail in the section [[Documentation/DevGuide/Spreadsheets/Working With Spreadsheet Documents|Working With Spreadsheet Documents]]. Before discussing spreadsheet objects, consider two examples and how they handle a spreadsheet document, that is, how to create, open, save and print.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Spreadsheet Documents]]&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229289</id>
		<title>Documentation/How Tos/Calc: FIND function</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229289"/>
		<updated>2013-07-18T15:30:42Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Added comment to show case sensitivity, for consistency with SEARCH() documentation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/MasterTOC&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=&amp;lt;div style=&amp;quot;padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;&amp;quot;&amp;gt;CALC FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Text_functions|&amp;lt;div style=&amp;quot;font-size: 140%;&amp;quot;&amp;gt;Text Functions]]&lt;br /&gt;
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_FIXED_function&lt;br /&gt;
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_EXACT_function&lt;br /&gt;
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Statistical_functions&lt;br /&gt;
|ShowNextPart=block|NextPart=Documentation/Reference/Calc_functions&lt;br /&gt;
|toccontent= &amp;lt;div style=&amp;quot;padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;&amp;quot;&amp;gt;FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_BASE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Base]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CHAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Char]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CLEAN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Clean]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CODE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Code]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CONCATENATE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Concatenate]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_DOLLAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Dollar]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_EXACT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Exact]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIND_function|&amp;lt;div style=&amp;quot;font-size: 120%; border-style: double; border-color:#778899;&amp;quot;&amp;gt;Find]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIXED_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Fixed]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEFT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Left]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Len]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LOWER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Lower]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_MID_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Mid]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_PROPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Proper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPLACE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Replace]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Rept]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_RIGHT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Right]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SEARCH_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Search]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SUBSTITUTE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Substitute]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_T_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;T]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TEXT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Text]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TRIM_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Trim]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_UPPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Upper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_VALUE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Value]]&lt;br /&gt;
}}__TOC__&lt;br /&gt;
== FIND ==&lt;br /&gt;
Returns the position of a string of text within another string. &lt;br /&gt;
&lt;br /&gt;
=== Syntax: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(findtext; texttosearch; startposition)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns the character position of the first occurrence of &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;findtext&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; within &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;texttosearch&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;startposition&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (optional) is the position from which the search starts.&lt;br /&gt;
&lt;br /&gt;
: The search is case-sensitive. For case-insensitive search, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
: The search will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; use regular expressions. For searching with regular expressions, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
: A failed search gives the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; error.&lt;br /&gt;
&lt;br /&gt;
: In &amp;#039;&amp;#039;&amp;#039;Tools - Options - OpenOffice.org Calc - Calculate&amp;#039;&amp;#039;&amp;#039; the setting for &amp;lt;i&amp;gt;Search criteria = and &amp;lt;&amp;gt; must apply to whole cells&amp;lt;/i&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
=== Example: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;yo&amp;quot;; &amp;quot;Yoyo&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;. The search is case-sensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;cho&amp;quot;; &amp;quot;choochoo&amp;quot;; 2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
: NOTE:  This is an error condition, which must be &amp;#039;handled&amp;#039; if used as the argument to another function.&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; which is not very useful, therefore we could use either &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISERROR()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISNUMBER()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; for example:&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISERROR( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;ERR: Missing Substring&amp;quot;, &amp;quot;Substring Present&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISNUMBER( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: NOTE:  In practice, it may be more maintainable to use ISNUMBER() to avoid negative logic, and it is more indicative of the evaluation desired:  if the substring has a position, then ISNUMBER() is TRUE, else ISNUMBER() is FALSE.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/SeeAlso|&lt;br /&gt;
* [[Documentation/How_Tos/Calc: REPLACE function|REPLACE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SEARCH function|SEARCH]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SUBSTITUTE function|SUBSTITUTE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: EXACT function|EXACT]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}&lt;br /&gt;
[[Category: Documentation/Reference/Calc/Text functions]]&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_SEARCH_function&amp;diff=229288</id>
		<title>Documentation/How Tos/Calc: SEARCH function</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_SEARCH_function&amp;diff=229288"/>
		<updated>2013-07-18T15:25:54Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/MasterTOC&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=&amp;lt;div style=&amp;quot;padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;&amp;quot;&amp;gt;CALC FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Text_functions|&amp;lt;div style=&amp;quot;font-size: 140%;&amp;quot;&amp;gt;Text Functions]]&lt;br /&gt;
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_SUBSTITUTE_function&lt;br /&gt;
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_RIGHT_function&lt;br /&gt;
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Statistical_functions&lt;br /&gt;
|ShowNextPart=block|NextPart=Documentation/Reference/Calc_functions&lt;br /&gt;
|toccontent= &amp;lt;div style=&amp;quot;padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;&amp;quot;&amp;gt;FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_BASE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Base]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CHAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Char]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CLEAN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Clean]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CODE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Code]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CONCATENATE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Concatenate]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_DOLLAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Dollar]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_EXACT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Exact]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIND_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Find]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIXED_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Fixed]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEFT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Left]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Len]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LOWER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Lower]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_MID_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Mid]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_PROPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Proper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPLACE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Replace]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Rept]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_RIGHT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Right]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SEARCH_function|&amp;lt;div style=&amp;quot;font-size: 120%; border-style: double; border-color:#778899;&amp;quot;&amp;gt;Search]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SUBSTITUTE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Substitute]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_T_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;T]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TEXT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Text]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TRIM_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Trim]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_UPPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Upper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_VALUE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Value]]&lt;br /&gt;
}}__TOC__&lt;br /&gt;
&lt;br /&gt;
== SEARCH ==&lt;br /&gt;
Returns the position of a string of text within another string. &lt;br /&gt;
&lt;br /&gt;
=== Syntax: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;SEARCH(findtext; texttosearch; startposition)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns the character position of the first occurrence of &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;findtext&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; within &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;texttosearch&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;startposition&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (optional) is the position from which the search starts.&lt;br /&gt;
&lt;br /&gt;
: The search is &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; case-sensitive.&lt;br /&gt;
&lt;br /&gt;
: The search will use regular expressions, if they are enabled (&amp;#039;&amp;#039;&amp;#039;Tools - Options - OpenOffice.org Calc - Calculate&amp;#039;&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
: A failed search gives the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; error.&lt;br /&gt;
&lt;br /&gt;
: In &amp;#039;&amp;#039;&amp;#039;Tools - Options - OpenOffice.org Calc - Calculate&amp;#039;&amp;#039;&amp;#039; the setting for &amp;lt;i&amp;gt;Search criteria = and &amp;lt;&amp;gt;must apply to whole cells&amp;lt;/i&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
=== Example: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;SEARCH(&amp;quot;yo&amp;quot;; &amp;quot;Yoyo&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;. The search is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;SEARCH(&amp;quot;cho&amp;quot;; &amp;quot;choochoo&amp;quot;; 2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;SEARCH(&amp;quot;t.n&amp;quot;; &amp;quot;often&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;, if regular expressions are enabled. The &amp;quot;.&amp;quot; stands for any single character in a regular expression, so &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;t.n&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; matches &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ten&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;SEARCH(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
: NOTE:  This is an error condition, which must be &amp;#039;handled&amp;#039; if used as the argument to another function.&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( SEARCH(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; which is not very useful, therefore we could use either &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISERROR()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISNUMBER()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; for example:&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISERROR( SEARCH(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;ERR: Missing Substring&amp;quot;, &amp;quot;Substring Present&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the SEARCH() function.&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISNUMBER( SEARCH(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the SEARCH() function.&lt;br /&gt;
:: NOTE:  In practice, it may be more maintainable to use ISNUMBER() to avoid negative logic, and it is more indicative of the evaluation desired:  if the substring has a position, then ISNUMBER() is TRUE, else ISNUMBER() is FALSE.&lt;br /&gt;
{{Documentation/SeeAlso|&lt;br /&gt;
* [[Documentation/How_Tos/Calc: REPLACE function|REPLACE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: FIND function|FIND]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SUBSTITUTE function|SUBSTITUTE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: EXACT function|EXACT]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Regular Expressions in Calc|Regular Expressions in Calc]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}&lt;br /&gt;
[[Category: Documentation/Reference/Calc/Text functions]]&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229287</id>
		<title>Documentation/How Tos/Calc: FIND function</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229287"/>
		<updated>2013-07-18T15:24:34Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/MasterTOC&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=&amp;lt;div style=&amp;quot;padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;&amp;quot;&amp;gt;CALC FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Text_functions|&amp;lt;div style=&amp;quot;font-size: 140%;&amp;quot;&amp;gt;Text Functions]]&lt;br /&gt;
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_FIXED_function&lt;br /&gt;
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_EXACT_function&lt;br /&gt;
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Statistical_functions&lt;br /&gt;
|ShowNextPart=block|NextPart=Documentation/Reference/Calc_functions&lt;br /&gt;
|toccontent= &amp;lt;div style=&amp;quot;padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;&amp;quot;&amp;gt;FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_BASE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Base]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CHAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Char]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CLEAN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Clean]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CODE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Code]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CONCATENATE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Concatenate]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_DOLLAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Dollar]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_EXACT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Exact]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIND_function|&amp;lt;div style=&amp;quot;font-size: 120%; border-style: double; border-color:#778899;&amp;quot;&amp;gt;Find]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIXED_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Fixed]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEFT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Left]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Len]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LOWER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Lower]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_MID_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Mid]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_PROPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Proper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPLACE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Replace]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Rept]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_RIGHT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Right]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SEARCH_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Search]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SUBSTITUTE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Substitute]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_T_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;T]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TEXT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Text]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TRIM_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Trim]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_UPPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Upper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_VALUE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Value]]&lt;br /&gt;
}}__TOC__&lt;br /&gt;
== FIND ==&lt;br /&gt;
Returns the position of a string of text within another string. &lt;br /&gt;
&lt;br /&gt;
=== Syntax: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(findtext; texttosearch; startposition)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns the character position of the first occurrence of &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;findtext&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; within &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;texttosearch&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;startposition&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (optional) is the position from which the search starts.&lt;br /&gt;
&lt;br /&gt;
: The search is case-sensitive. For case-insensitive search, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
: The search will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; use regular expressions. For searching with regular expressions, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
: A failed search gives the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; error.&lt;br /&gt;
&lt;br /&gt;
: In &amp;#039;&amp;#039;&amp;#039;Tools - Options - OpenOffice.org Calc - Calculate&amp;#039;&amp;#039;&amp;#039; the setting for &amp;lt;i&amp;gt;Search criteria = and &amp;lt;&amp;gt; must apply to whole cells&amp;lt;/i&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
=== Example: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;yo&amp;quot;; &amp;quot;Yoyo&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;cho&amp;quot;; &amp;quot;choochoo&amp;quot;; 2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
: NOTE:  This is an error condition, which must be &amp;#039;handled&amp;#039; if used as the argument to another function.&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; which is not very useful, therefore we could use either &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISERROR()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISNUMBER()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; for example:&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISERROR( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;ERR: Missing Substring&amp;quot;, &amp;quot;Substring Present&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISNUMBER( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: NOTE:  In practice, it may be more maintainable to use ISNUMBER() to avoid negative logic, and it is more indicative of the evaluation desired:  if the substring has a position, then ISNUMBER() is TRUE, else ISNUMBER() is FALSE.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/SeeAlso|&lt;br /&gt;
* [[Documentation/How_Tos/Calc: REPLACE function|REPLACE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SEARCH function|SEARCH]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SUBSTITUTE function|SUBSTITUTE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: EXACT function|EXACT]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}&lt;br /&gt;
[[Category: Documentation/Reference/Calc/Text functions]]&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229286</id>
		<title>Documentation/How Tos/Calc: FIND function</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229286"/>
		<updated>2013-07-18T15:22:38Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Missed some periods &amp;#039;.&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/MasterTOC&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=&amp;lt;div style=&amp;quot;padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;&amp;quot;&amp;gt;CALC FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Text_functions|&amp;lt;div style=&amp;quot;font-size: 140%;&amp;quot;&amp;gt;Text Functions]]&lt;br /&gt;
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_FIXED_function&lt;br /&gt;
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_EXACT_function&lt;br /&gt;
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Statistical_functions&lt;br /&gt;
|ShowNextPart=block|NextPart=Documentation/Reference/Calc_functions&lt;br /&gt;
|toccontent= &amp;lt;div style=&amp;quot;padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;&amp;quot;&amp;gt;FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_BASE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Base]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CHAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Char]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CLEAN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Clean]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CODE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Code]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CONCATENATE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Concatenate]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_DOLLAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Dollar]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_EXACT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Exact]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIND_function|&amp;lt;div style=&amp;quot;font-size: 120%; border-style: double; border-color:#778899;&amp;quot;&amp;gt;Find]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIXED_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Fixed]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEFT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Left]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Len]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LOWER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Lower]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_MID_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Mid]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_PROPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Proper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPLACE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Replace]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Rept]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_RIGHT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Right]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SEARCH_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Search]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SUBSTITUTE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Substitute]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_T_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;T]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TEXT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Text]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TRIM_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Trim]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_UPPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Upper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_VALUE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Value]]&lt;br /&gt;
}}__TOC__&lt;br /&gt;
== FIND ==&lt;br /&gt;
Returns the position of a string of text within another string. &lt;br /&gt;
&lt;br /&gt;
=== Syntax: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(findtext; texttosearch; startposition)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns the character position of the first occurrence of &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;findtext&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; within &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;texttosearch&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;startposition&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (optional) is the position from which the search starts.&lt;br /&gt;
&lt;br /&gt;
: The search is case-sensitive. For case-insensitive search, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
: The search will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; use regular expressions. For searching with regular expressions, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
: A failed search gives the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; error.&lt;br /&gt;
&lt;br /&gt;
: In &amp;#039;&amp;#039;&amp;#039;Tools - Options - OpenOffice.org Calc - Calculate&amp;#039;&amp;#039;&amp;#039; the setting for &amp;lt;i&amp;gt;Search criteria = and &amp;lt;&amp;gt; must apply to whole cells&amp;lt;/i&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
=== Example: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;yo&amp;quot;; &amp;quot;Yoyo&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;cho&amp;quot;; &amp;quot;choochoo&amp;quot;; 2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
: NOTE:  This is an error condition, which must be &amp;#039;handled&amp;#039; if used as the argument to another function.&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; which is not very useful, therefore we could use either &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISERROR()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISNUMBER()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; for example:&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISERROR( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;ERR: Missing Substring&amp;quot;, &amp;quot;Substring Present&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISNUMBER( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: NOTE:  In practice, it may be more maintainable to use ISNUMBER() to avoid negative logic, and it is more indicitive of the evaluation desired:  if the substring has a position, then ISNUMBER() is TRUE, else ISNUMBER() is FALSE.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/SeeAlso|&lt;br /&gt;
* [[Documentation/How_Tos/Calc: REPLACE function|REPLACE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SEARCH function|SEARCH]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SUBSTITUTE function|SUBSTITUTE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: EXACT function|EXACT]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}&lt;br /&gt;
[[Category: Documentation/Reference/Calc/Text functions]]&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229285</id>
		<title>Documentation/How Tos/Calc: FIND function</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_FIND_function&amp;diff=229285"/>
		<updated>2013-07-18T15:21:25Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Indicated that the function does not use regex; referred to SEARCH() for case-insensitive and regex searching; added note for =/&amp;lt;&amp;gt; setting, to be consistent with SEARCH() documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/MasterTOC&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=&amp;lt;div style=&amp;quot;padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;&amp;quot;&amp;gt;CALC FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Text_functions|&amp;lt;div style=&amp;quot;font-size: 140%;&amp;quot;&amp;gt;Text Functions]]&lt;br /&gt;
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_FIXED_function&lt;br /&gt;
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_EXACT_function&lt;br /&gt;
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Statistical_functions&lt;br /&gt;
|ShowNextPart=block|NextPart=Documentation/Reference/Calc_functions&lt;br /&gt;
|toccontent= &amp;lt;div style=&amp;quot;padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;&amp;quot;&amp;gt;FUNCTIONS&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_BASE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Base]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CHAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Char]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CLEAN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Clean]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CODE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Code]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_CONCATENATE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Concatenate]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_DOLLAR_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Dollar]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_EXACT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Exact]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIND_function|&amp;lt;div style=&amp;quot;font-size: 120%; border-style: double; border-color:#778899;&amp;quot;&amp;gt;Find]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_FIXED_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Fixed]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEFT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Left]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LEN_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Len]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_LOWER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Lower]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_MID_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Mid]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_PROPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Proper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPLACE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Replace]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_REPT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Rept]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_RIGHT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Right]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SEARCH_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Search]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_SUBSTITUTE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Substitute]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_T_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;T]] &lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TEXT_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Text]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_TRIM_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Trim]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_UPPER_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Upper]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc:_VALUE_function|&amp;lt;div style=&amp;quot;font-size: 120%;&amp;quot;&amp;gt;Value]]&lt;br /&gt;
}}__TOC__&lt;br /&gt;
== FIND ==&lt;br /&gt;
Returns the position of a string of text within another string. &lt;br /&gt;
&lt;br /&gt;
=== Syntax: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(findtext; texttosearch; startposition)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns the character position of the first occurrence of &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;findtext&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; within &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;texttosearch&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;startposition&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (optional) is the position from which the search starts.&lt;br /&gt;
&lt;br /&gt;
: The search is case-sensitive. For case-insensitive search, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: The search will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; use regular expressions. For searching with regular expressions, see &amp;#039;&amp;#039;&amp;#039;SEARCH()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
: A failed search gives the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; error.&lt;br /&gt;
&lt;br /&gt;
: In &amp;#039;&amp;#039;&amp;#039;Tools - Options - OpenOffice.org Calc - Calculate&amp;#039;&amp;#039;&amp;#039; the setting for &amp;lt;i&amp;gt;Search criteria = and &amp;lt;&amp;gt; must apply to whole cells&amp;lt;/i&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
=== Example: ===&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;yo&amp;quot;; &amp;quot;Yoyo&amp;quot;)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;cho&amp;quot;; &amp;quot;choochoo&amp;quot;; 2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
: NOTE:  This is an error condition, which must be &amp;#039;handled&amp;#039; if used as the argument to another function.&lt;br /&gt;
: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;#VALUE!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; which is not very useful, therefore we could use either &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISERROR()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;ISNUMBER()&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; for example:&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISERROR( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;ERR: Missing Substring&amp;quot;, &amp;quot;Substring Present&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;IF( ISNUMBER( FIND(&amp;quot;xyz&amp;quot;,&amp;quot;abcdef&amp;quot;,1) ) , &amp;quot;Substring Present&amp;quot;, &amp;quot;ERR: Missing Substring&amp;quot; )&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
::: returns &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;quot;ERR: Missing Substring&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; (... allowing the IF() to function, and not propagating the error from the FIND() function.&lt;br /&gt;
:: NOTE:  In practice, it may be more maintainable to use ISNUMBER() to avoid negative logic, and it is more indicitive of the evaluation desired:  if the substring has a position, then ISNUMBER() is TRUE, else ISNUMBER() is FALSE.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/SeeAlso|&lt;br /&gt;
* [[Documentation/How_Tos/Calc: REPLACE function|REPLACE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SEARCH function|SEARCH]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: SUBSTITUTE function|SUBSTITUTE]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: EXACT function|EXACT]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]&lt;br /&gt;
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}&lt;br /&gt;
[[Category: Documentation/Reference/Calc/Text functions]]&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/BASIC_Guide/Strings_(Runtime_Library)&amp;diff=229147</id>
		<title>Documentation/BASIC Guide/Strings (Runtime Library)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/BASIC_Guide/Strings_(Runtime_Library)&amp;diff=229147"/>
		<updated>2013-07-15T21:17:19Z</updated>

		<summary type="html">&lt;p&gt;GreatBigBore: Changed return value name because it suggested that the return value from InStr is a string. It is a number, not a string. Changed parameter name for clarity.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/BASICGuideTOC/v2&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=Documentation/BASIC Guide/Conversion Functions (Runtime Library)&lt;br /&gt;
|NextPage=Documentation/BASIC Guide/Date and Time (Runtime Library)&lt;br /&gt;
|runtime=block&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Strings ({{OOo}} BASIC Runtime Library)}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
== Working with Sets of Characters ==&lt;br /&gt;
&lt;br /&gt;
When administering strings, {{OOo}} Basic uses the set of Unicode characters. The &amp;lt;tt&amp;gt;Asc&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Chr&amp;lt;/tt&amp;gt; functions allow the Unicode value belonging to a character to be established and/or the corresponding character to be found for a Unicode value. The following expressions assign the various Unicode values to the code variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Code = Asc(&amp;quot;A&amp;quot;)         &amp;#039; Latin letter A (Unicode-value 65)&lt;br /&gt;
Code = Asc(&amp;quot;€&amp;quot;)         &amp;#039; Euro character (Unicode-value 8364)&lt;br /&gt;
Code = Asc(&amp;quot;Л&amp;quot;)         &amp;#039; Cyrillic letter Л (Unicode-value 1083)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conversely, the expression &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
MyString = Chr(13)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ensures that the &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt; string is initialized with the value of the number &amp;lt;tt&amp;gt;13&amp;lt;/tt&amp;gt;, which stands for a hard line break.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Chr&amp;lt;/tt&amp;gt; command is often used in Basic languages to insert control characters in a string. The assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
MyString = Chr(9) + &amp;quot;This is a test&amp;quot; + Chr(13)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore ensures that the text is preceded by a tab character (Unicode-value 9) and that a hard line break (Unicode-value 13) is added after the text. &lt;br /&gt;
&lt;br /&gt;
== Accessing Parts of a String ==&lt;br /&gt;
&lt;br /&gt;
{{OOo}} Basic provides three functions that return partial strings, plus a length function: &lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Left(MyString, Length)&amp;lt;/tt&amp;gt;:returns the first &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; characters of &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Right(MyString, Length)&amp;lt;/tt&amp;gt;:returns the last &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; characters of &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Mid(MyString, Start, Length)&amp;lt;/tt&amp;gt;:returns first &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; characters of &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt; as of the &amp;lt;tt&amp;gt;Start&amp;lt;/tt&amp;gt; position.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Len(MyString)&amp;lt;/tt&amp;gt;:returns the number of characters in &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Unlike array subscripts, character positions in a string start with &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;. Here are a few example calls for the named functions: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyString As String&lt;br /&gt;
Dim MyResult As String&lt;br /&gt;
Dim MyLen As Integer&lt;br /&gt;
&lt;br /&gt;
MyString = &amp;quot;This is a small test&amp;quot;&lt;br /&gt;
MyResult = Left(MyString,5)      &amp;#039; Provides the string &amp;quot;This &amp;quot;&lt;br /&gt;
MyResult = Right(MyString, 5)    &amp;#039; Provides the string &amp;quot; test&amp;quot;&lt;br /&gt;
MyResult = Mid(MyString, 8, 5)   &amp;#039; Provides the string &amp;quot; a sm&amp;quot;&lt;br /&gt;
MyLen = Len(MyString)            &amp;#039; Provides the value 20&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Search and Replace ==&lt;br /&gt;
&lt;br /&gt;
{{OOo}} Basic provides the &amp;lt;tt&amp;gt;InStr&amp;lt;/tt&amp;gt; function for searching for a partial string within another string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
PositionOfMatch = InStr(MyString, StringToFind)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;StringToFind&amp;lt;/tt&amp;gt; parameter specifies the string to be searched for within &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt;. The function returns a number that contains the position at which the &amp;lt;tt&amp;gt;StringToFind&amp;lt;/tt&amp;gt; first appears within &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt;; a return value of zero indicates no match. If you want to find other matches for the string, the function also provides the opportunity to specify an optional start position from which {{OOo}} Basic begins the search. In this case, the syntax of the function is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
PositionOfMatch = InStr(StartPosition, MyString, StringToFind)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the previous examples, &amp;lt;tt&amp;gt;InStr&amp;lt;/tt&amp;gt; ignores uppercase and lowercase characters. To change the search so that &amp;lt;tt&amp;gt;InStr&amp;lt;/tt&amp;gt; is case sensitive, add the parameter &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
PositionOfMatch = InStr(MyString, StringToFind, 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the previous functions for editing strings, programmers can search for and replace one string in another string: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Function Replace(Source As String, Search As String, NewPart As String)&lt;br /&gt;
  Dim Result As String&lt;br /&gt;
  Dim StartPos As Long&lt;br /&gt;
  Dim CurrentPos As Long&lt;br /&gt;
&lt;br /&gt;
  Result = &amp;quot;&amp;quot;&lt;br /&gt;
  StartPos = 1&lt;br /&gt;
  CurrentPos = 1&lt;br /&gt;
&lt;br /&gt;
  If Search = &amp;quot;&amp;quot; Then&lt;br /&gt;
    Result = Source&lt;br /&gt;
  Else &lt;br /&gt;
    Do While CurrentPos &amp;lt;&amp;gt; 0&lt;br /&gt;
      CurrentPos = InStr(StartPos, Source, Search)&lt;br /&gt;
      If CurrentPos &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
        Result = Result + Mid(Source, StartPos, _&lt;br /&gt;
        CurrentPos - StartPos)&lt;br /&gt;
        Result = Result + NewPart&lt;br /&gt;
        StartPos = CurrentPos + Len(Search)&lt;br /&gt;
      Else&lt;br /&gt;
        Result = Result + Mid(Source, StartPos, Len(Source))&lt;br /&gt;
      End If                &amp;#039; Position &amp;lt;&amp;gt; 0&lt;br /&gt;
    Loop &lt;br /&gt;
  End If &lt;br /&gt;
&lt;br /&gt;
  Replace = Result&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function searches through the transferred &amp;lt;tt&amp;gt;Search&amp;lt;/tt&amp;gt; string in a loop by means of &amp;lt;tt&amp;gt;InStr&amp;lt;/tt&amp;gt; in the original term &amp;lt;tt&amp;gt;Source&amp;lt;/tt&amp;gt;. If it finds the search term, it takes the part before the expression and writes it to the &amp;lt;tt&amp;gt;Result&amp;lt;/tt&amp;gt; return buffer. It adds the &amp;lt;tt&amp;gt;NewPart&amp;lt;/tt&amp;gt; section at the point of the search term &amp;lt;tt&amp;gt;Search&amp;lt;/tt&amp;gt;. If no more matches are found for the search term, the function establishes the part of the string still remaining and adds this to the return buffer. It returns the string produced in this way as the result of the replacement process.&lt;br /&gt;
&lt;br /&gt;
Since replacing parts of character sequences is one of the most frequently used functions, the &amp;lt;tt&amp;gt;Mid&amp;lt;/tt&amp;gt; function in {{OOo}} Basic has been extended so that this task is performed automatically. The following example replaces three characters with the string &amp;lt;tt&amp;gt;is&amp;lt;/tt&amp;gt; from the sixth position of the &amp;lt;tt&amp;gt;MyString&amp;lt;/tt&amp;gt; string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyString As String&lt;br /&gt;
 &lt;br /&gt;
MyString = &amp;quot;This was my text&amp;quot;&lt;br /&gt;
Mid(MyString, 6, 3, &amp;quot;is&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or this much simpler function can be used. First it splits &amp;quot;Source&amp;quot; dividing it at all &amp;quot;Search&amp;quot;, and joins the parts back with &amp;quot;NewPart&amp;quot;. So Replace(&amp;quot;This is a test&amp;quot;, &amp;quot; &amp;quot;, &amp;quot;_&amp;quot;) yields &amp;quot;This_is_a_test&amp;quot; :D&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Function Replace(Source As String, Search As String, NewPart As String)&lt;br /&gt;
  Dim Result As String  &lt;br /&gt;
  Result = join(split(Source, Search), NewPart)&lt;br /&gt;
  Replace = Result&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|When it is used with 4 arguments, to replace a sub-string in a string, &amp;lt;tt&amp;gt;Mid&amp;lt;/tt&amp;gt; is an &amp;#039;&amp;#039;&amp;#039;instruction&amp;#039;&amp;#039;&amp;#039;, not a function : it does not return any value !}}&lt;br /&gt;
&lt;br /&gt;
== Formatting Strings ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Format&amp;lt;/tt&amp;gt; function formats numbers as a string. To do this, the function expects a &amp;lt;tt&amp;gt;Format&amp;lt;/tt&amp;gt; expression to be specified, which is then used as the template for formatting the numbers. Each place holder within the template ensures that this item is formatted correspondingly in the output value. The five most important place holders within a template are the zero (&amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;), pound sign (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;), period (&amp;lt;tt&amp;gt;.&amp;lt;/tt&amp;gt;), comma (&amp;lt;tt&amp;gt;,&amp;lt;/tt&amp;gt;) and dollar sign (&amp;lt;tt&amp;gt;$&amp;lt;/tt&amp;gt;) characters. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; character within the template ensures that a number is always placed at the corresponding point. If a number is not provided, 0 is displayed in its place. &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;.&amp;lt;/tt&amp;gt; stands for the decimal point symbol defined by the operating system in the country-specific settings.&lt;br /&gt;
&lt;br /&gt;
The example below shows how the &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;.&amp;lt;/tt&amp;gt; characters can define the digits after the decimal point in an expression:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
MyFormat = &amp;quot;0.00&amp;quot;&lt;br /&gt;
MyString = Format(-1579.8, MyFormat)     &amp;#039; Provides &amp;quot;-1579,80&amp;quot;&lt;br /&gt;
MyString = Format(1579.8, MyFormat)      &amp;#039; Provides &amp;quot;1579,80&amp;quot;&lt;br /&gt;
MyString = Format(0.4, MyFormat)         &amp;#039; Provides &amp;quot;0,40&amp;quot;&lt;br /&gt;
MyString = Format(0.434, MyFormat)       &amp;#039; Provides &amp;quot;0,43&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the same way, zeros can be added in front of a number to achieve the desired length:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
MyFormat = &amp;quot;0000.00&amp;quot;&lt;br /&gt;
MyString = Format(-1579.8, MyFormat)     &amp;#039; Provides &amp;quot;-1579,80&amp;quot;&lt;br /&gt;
MyString = Format(1579.8, MyFormat)      &amp;#039; Provides &amp;quot;1579,80&amp;quot;&lt;br /&gt;
MyString = Format(0.4, MyFormat)         &amp;#039; Provides &amp;quot;0000,40&amp;quot;&lt;br /&gt;
MyString = Format(0.434, MyFormat)       &amp;#039; Provides &amp;quot;0000,43&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;,&amp;lt;/tt&amp;gt; represents the character that the operating system uses for a thousands separator, and the &amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt; stands for a digit or place that is only displayed if it is required by the input string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
MyFormat = &amp;quot;#,##0.00&amp;quot;&lt;br /&gt;
MyString = Format(-1579.8, MyFormat)     &amp;#039; Provides &amp;quot;-1.579,80&amp;quot;&lt;br /&gt;
MyString = Format(1579.8, MyFormat)      &amp;#039; Provides &amp;quot;1.579,80&amp;quot;&lt;br /&gt;
MyString = Format(0.4, MyFormat)         &amp;#039; Provides &amp;quot;0,40&amp;quot;&lt;br /&gt;
MyString = Format(0.434, MyFormat)       &amp;#039; Provides &amp;quot;0,43&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In place of the &amp;lt;tt&amp;gt;$&amp;lt;/tt&amp;gt; place holder, the &amp;lt;tt&amp;gt;Format&amp;lt;/tt&amp;gt; function displays the relevant currency symbol defined by the system (this example assumes a European locale has been defined):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
MyFormat = &amp;quot;#,##0.00 $&amp;quot;   &lt;br /&gt;
MyString = Format(-1579.8, MyFormat)     &amp;#039; Provides &amp;quot;-1.579,80 €&amp;quot; &lt;br /&gt;
MyString = Format(1579.8, MyFormat)      &amp;#039; Provides &amp;quot;1.579,80 €&amp;quot; &lt;br /&gt;
MyString = Format(0.4, MyFormat)         &amp;#039; Provides &amp;quot;0,40 €&amp;quot; &lt;br /&gt;
MyString = Format(0.434, MyFormat)       &amp;#039; Provides &amp;quot;0,43 €&amp;quot; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format instructions used in VBA for formatting date and time details can also be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub main&lt;br /&gt;
    dim myDate as date&lt;br /&gt;
    myDate = &amp;quot;01/06/98&amp;quot;&lt;br /&gt;
    TestStr = Format(myDate, &amp;quot;mm-dd-yyyy&amp;quot;) &amp;#039; 01-06-1998&lt;br /&gt;
    MsgBox TestStr&lt;br /&gt;
end sub &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{{InterWiki Languages BasicGuide|articletitle=Documentation/BASIC Guide/Strings (Runtime Library)}}&lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>GreatBigBore</name></author>
	</entry>
</feed>