FIND

Returns the index of the position in second string where the first string was found. The search starts after the specified position and if the start position is not passed then treats 0 as the start position. The function uses zero-based indexing.

Syntax

= FIND(find_val, within_val)

= FIND(find_val, within_val, start_position)

Parameters

find_val

A value which has to be found. The value can be specified as an integer (e.g., 37), a decimal value (e.g., 37.48), as a string (“word”), or as the value of a variable (e.g, UnitPrice).

within_val

A string which contains the text, the function is searching for. The value can be specified as an integer (e.g., 37), a decimal value (e.g., 37.48), as a string (“word”), or as the value of a variable (e.g, UnitPrice).

start_position (optional)

A positive integer which specifies the position for the function to start finding from.

Return Type

Integer.

In the case of an error, the function displays an error message: “FIND(find_val, within_val): Error message” or “FIND(find_val, within_val, start_position): Error message”.

Examples

Example

Returns

= FIND(“Speed”, “Iron Speed Designer”)

5

= FIND(“t”, “test”, 2)

3

= FIND(37, “2537”)

2

= FIND(“$”, “$37.2”)

0

= FIND(“,”, UnitPrice)

The position of “,” in the value of UnitPrice