LASTINDEXOF function

The Klipfolio LASTINDEXOF function returns a vector of data containing the first index position of the last occurrence of 'search text'. If occurrence is provided, the first index position of that occurrence starting from the end of the data is returned.

The syntax for the LASTINDEXOF function is:

LASTINDEXOF (text, search text , occurrence)

Parameters

text the data set vector
search text the text you want to find scalar
occurrence Optional. The first index position you want to return scalar

LASTINDEXOF example

Let's look at a LASTINDEXOF function example.

 

A

1 white/123/dog

The following example is based on the above text from an Excel spreadsheet:

SUBSTRING( A:A , ( LASTINDEXOF( A:A , "/" ) + 1 ) , to ) 

-> [dog]

Related links: