We start by retrieving our list from the column list and storing its value in the __List variable. Next, we retrieve the total length of our list using the LEN function and store this in the __Length variable. The next line where we calculate the __Length2 variable is where the magic happens. We use the SUBSTITUTE function to replace the delimiter in our list, in this case a comma, with nothing (double quotes side by side). We then determine the length of this modified string using the LEN function once again.
Once we have these two lengths, the number of items in our list is simply the length of our original list, __Length, minus the length of our modified list where we substituted nothing for our delimiters, __Length2. Given that we have substituted nothing for each of our delimiters, our modified string length, __Length2, is shorter than our original string length, __Length, by exactly the number of delimiters in our list, __List. We need to add 1 to this number to determine the number of items in the list since the number of delimiters in our list is always one less than the number of items in our list.