I’ve seen a lot of ugly ways to count the number of words in a comma separated list, most of them involve an overly complicated macro. There is an easier way. Just add a field to your table, then you want to use the LENGTH function to count your comma separated list, and the LENGTH and COMPRESS function to count the string with your commas removed. This will give you the number of words in the list:
list_count = length(comma_list)-length(compress(comma_list,”,”));
February 11, 2016
Nice code, but the result is the number of commas in the string. For the number of words we should add one.
February 2, 2017
ever heard of the COUNTW function?, dumbass.