# SEARCH

## Content

This function finds one text string within another text string and returns the position at which the specified text starts. The search is not case-sensitive.

## Syntax

`SEARCH(find_text, within_text, [start_num])`

## Arguments

This function has the following arguments:

| **Argument** | **Description** |
| -------- | ----------- |
| *find\_text* | The text that you want to find. |
| *within\_text* | The text in which you want to search for *find\_text*. |
| *start\_num* | [Optional] The character position in *withinText* at which to start the search. The first character is position 1. <br>If omitted, the search starts from the first character. |

## Remarks

* The function is not case-sensitive. Use the `FIND` function to perform a case-sensitive search.
* You can use the question mark (`?`) and asterisk (`*`) wildcard characters in *find\_text*. A question mark matches any single character, and an asterisk matches any sequence of characters.
* To search for an actual question mark or asterisk, type a tilde (`~`) before the character.
* If *find\_text* is not found, the function returns the `#VALUE!` error.
* If *start\_num* is less than or equal to 0 or greater than the length of *within\_text*, the function returns the `#VALUE!` error.

## Data Types

Accepts string and numeric data. 
Returns numeric data.

## Examples

```JavaScript
activeSheet.setFormula(0, 0, '=SEARCH("margin","Gross Margin")');// 7
activeSheet.setFormula(1, 0, '=SEARCH("m","Gross Margin",8)'); // #VALUE!
```