ValueCountSpecific ( lst ; value )

ValueCount ( FilterValues ( lst ; value ) )

 

Ben Miller and I came up with this tiny little function to tell us how many times a specific value occurs in a list. It’s smart enough to consider full values (carriage-return delimited), rather than partial text strings.

In the 2nd example, we see that the function treats the carriage return as an “OR”, such that we’re searching for how many “Will” OR “Tim” occur in the list.

In the 4th example the function returns zero, because there is no value matching “Will¶Tim” exactly.  To find how many times “Will” is followed immediately by “Tim”, I think we’d want a tidy recursive function.

ValueCountSpecific

Leave a Reply