Lfind()

Home   Back   Next  

Working with Formulas > Functions Used in Formulas > Text Functions > Lfind()

 

LFIND() searches for the search string in the other string. LFIND() returns the character index of the nth occurrence of the search string in the other string, starting from the left side of the string. If no occurrence number is specified, LFIND() returns the first occurrence, starting from the left side of the string. If the search string cannot be found or the occurrence number listed runs past the end of the input string, LFIND() returns zero.

 

NOTE: LFIND() is an alias for INSTR()

 

 

Function Format

 

LFIND(string, search string [, occurrence]) 

 

 

Return Value

 

LFIND() returns an integer 

 

 

Examples

 

LFIND("Green apples taste better than red apples and all other types of apples.", "apples") = 7 

 

LFIND("Green apples taste better than red apples and all other types of apples.", "oranges") = 0 

 

LFIND("Green apples taste better than red apples and all other types of apples.", "apples", 1) = 7 

 

LFIND("Green apples taste better than red apples and all other types of apples.", "apples", 2) = 36 

 

LFIND("Green apples taste better than red apples and all other types of apples.", "apples", 3) = 66 

 

LFIND("Green apples taste better than red apples and all other types of apples.", "apples", 4) = 0