SEARCH

The following section describes the syntax and usage of the SEARCH function in ActivityInfo.

Description

The SEARCH function is used to search a string (or text value) for a specific sub-string (or piece of text), and return the starting position of the sub-string if found. 

Syntax

SEARCH(substring, string, startIndex)

Argument Required Description
substring Yes The text value you wish to search for.
string Yes The text value you wish to search through.
startIndex No If desired, you can start the search at a specified index in the text string.

Result

  • The numeric value of the starting position of the sub-string, if found.
  • NA if the sub-string is not found.

Example

We will be using the SEARCH function to find the starting position of certain sub-string within another piece of text. Both the sub-string and the string will be given by a data column.

Arguments

We will be using two Text fields:

  • "Search Text" (with code "search_txt")
  • "Text" (with code "txt")

Formula

SEARCH(search_txt,txt)

Results