PositionValue is very similar to the FileMaker function, Position, except that it returns a value position instead of a character position.
PositionValue (text;searchValue;start;occurence)
Let ( [ adjustedText = "¶" & text & "¶" ; positionStart = Length ( LeftValues ( text ; start - 1 ) ) ] ;
If (
Position ( adjustedText ; "¶" & searchValue & "¶" ; PositionStart ; occurrence ) = 0 ; 0 ;
ValueCount ( Left ( text ; (Position ( adjustedText ; "¶" & searchValue & "¶" ; PositionStart ; occurrence ) - 1) + Length ( searchValue ) ) )
)
)
