Skip to main content
Solved

COUNTALL(Multiple Options) always returns 1

  • Nov 20, 2015 12:18 PM UTC
  • 4 replies
  • 144 views

Forum|alt.badge.img+4

Expected behaviour: return the number of selected items.

Best answer by Simon_Brown

IF( LEN({FieldName}) = 0, 0, LEN(CONCATENATE(",", {FieldName})) - LEN(SUBSTITUTE({FieldName}, “,”, “”)))

As a workaround, this formula works for me, but none of the multiple options can have a “,” in.

It returns 0 if there’s nothing there, otherwise it compares the length of the multiple options string with the length of the same string without the commas.

View original
This topic has been closed for replies.

4 replies

Forum|alt.badge.img+3
  • Participating Frequently
  • Dec 4, 2015 11:45 PM UTC

That happens because we currently only support numbers, text and dates in the formulas. The multiple options get converted to a text string, so the count becomes 1. At some point we’ll support all types and there’ll definitely be a way to count the number of selected options.


  • New Participant
  • Answer
  • Jul 17, 2016 2:24 PM UTC

IF( LEN({FieldName}) = 0, 0, LEN(CONCATENATE(",", {FieldName})) - LEN(SUBSTITUTE({FieldName}, “,”, “”)))

As a workaround, this formula works for me, but none of the multiple options can have a “,” in.

It returns 0 if there’s nothing there, otherwise it compares the length of the multiple options string with the length of the same string without the commas.


  • New Participant
  • Dec 30, 2016 1:10 AM UTC

IF( LEN({FieldName}) = 0, 0, LEN(CONCATENATE(",", {FieldName})) - LEN(SUBSTITUTE({FieldName}, “,”, “”)))

As a workaround, this formula works for me, but none of the multiple options can have a “,” in.

It returns 0 if there’s nothing there, otherwise it compares the length of the multiple options string with the length of the same string without the commas.


This works surprisingly well. Feels like crazy over engineering for what should just work with the COUNTA or COUNTALL functions.


IF( LEN({FieldName}) = 0, 0, LEN(CONCATENATE(",", {FieldName})) - LEN(SUBSTITUTE({FieldName}, “,”, “”)))

As a workaround, this formula works for me, but none of the multiple options can have a “,” in.

It returns 0 if there’s nothing there, otherwise it compares the length of the multiple options string with the length of the same string without the commas.


Very clever - thanks for this hack!