Rfind()

Home   Back   Next  

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

 

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

 

 

Function Format

 

RFIND(string, search string [, occurrence]) 

 

 

Return Value

 

RFIND() returns an integer 

 

 

Examples

 

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

 

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

 

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

 

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

 

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

 

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