Count Enumlist Instances in current Form

YGY
Silver 1
Silver 1

Hello,

Have a form with and EnumList with {1-A1, 2-A2, 3-A4, 1-L1, 2-L2, 3-L3}

I would like to count how many times anything with โ€œ-Aโ€ is selected in a virtual column. It should count the options the users selected in the open form, so not in the spreadsheet yet.

Any help would be appreciated.

Thanks.

Solved Solved
0 9 670
1 ACCEPTED SOLUTION

Maybe try this. Convert the list to Text first, then split the Text back into a List, but on the characters โ€œ-Aโ€, then count the List.

COUNT( SPLIT( TEXT( [enumlist] ) , "-A" ) )

View solution in original post

9 REPLIES 9

Are the values you listed the only possible options there will ever be?

You could perhaps just do a simple brute-force expression:

0
+
IF( IN( "1-A1" , [enumlist] ) , 1 , 0 )
+
IF( IN( "2-A2" , [enumlist] ) , 1 , 0 )
+
IF( IN( "3-A4" , [enumlist] ) , 1 , 0 )

Thanks, but no - EnumList is dynamic, thatโ€™s why Iโ€™m trying to count if list item has โ€œ-Aโ€.

Maybe try this. Convert the list to Text first, then split the Text back into a List, but on the characters โ€œ-Aโ€, then count the List.

COUNT( SPLIT( TEXT( [enumlist] ) , "-A" ) )

Very close

It works, but starts off with 1 even if the EnumList is clear; choosing 4 options with โ€œ-A4โ€ gives a count of 5.

I can add a -1 to the end of the expression, but would rather notโ€ฆ any ideas?

Thank you again

Yes, do that. Why do you not want to?

Because I want to know/learn why thereโ€™s a 1

If you cut something 0 times, how many pieces do you have?
If you cut something 4 times, how many pieces do you have?

Thanksโ€ฆ makes sense

Top Labels in this Space