Custom Function:  ValueListIndex

Version 4

    Hi,

    Given a value list and a value in the list, this function returns the row number (one-based) of the value.

     

    example usage:

    $list = ValueListItems ( Get ( FileName ) ; "ColorList" )

    $row = ValueListIndex ( $list ; "Red" )

     

     

     

    Let(

      [

        padList = "¶" & valueList & "¶";

        padValue = "¶" & valueToFind & "¶";

        start = Position ( padList; padValue; 1; 1 );

        topPortion = Left ( padList; start )

      ];

      PatternCount ( topPortion; "¶" )

    )