Skip to main content
Solved

How to count collaborators?

  • Apr 25, 2017 5:18 AM UTC
  • 4 replies
  • 121 views

Question: I have a collaborator field with numerous collaborators per record, and I was hoping to add a field that would add up how many collaborators there are listed in that record. How would I do this?
Thank you!

Best answer by W_Vann_Hall

I have the same question here. Have you found a solution by now?

Regards


After kicking this around for a while, I discovered @Simon_Brown had posted a workaround a year ago:

IF( LEN(Collaborator) = 0, 0, LEN(CONCATENATE(",", Collaborator)) - LEN(SUBSTITUTE(Collaborator, ",", "")))

Only caveat is that none of your collaborator names can have an embedded comma. (I fiddled around some with ARRAYJOIN() in hopes of using an alternative separator character, but Airtable’s insistence on stringifying anything that’s not a text, number, or date field prevents that.) It’s ugly, but it seems to work pretty well on multi-selects, attachments, and any field allowing multiple values – with the comma caveat, as well.

View original
This topic has been closed for replies.

4 replies

  • New Participant
  • Jul 14, 2017 1:14 PM UTC

I have the same question here. Have you found a solution by now?

Regards


Forum|alt.badge.img+5
  • Inspiring
  • Answer
  • Jul 16, 2017 4:39 AM UTC

I have the same question here. Have you found a solution by now?

Regards


After kicking this around for a while, I discovered @Simon_Brown had posted a workaround a year ago:

IF( LEN(Collaborator) = 0, 0, LEN(CONCATENATE(",", Collaborator)) - LEN(SUBSTITUTE(Collaborator, ",", "")))

Only caveat is that none of your collaborator names can have an embedded comma. (I fiddled around some with ARRAYJOIN() in hopes of using an alternative separator character, but Airtable’s insistence on stringifying anything that’s not a text, number, or date field prevents that.) It’s ugly, but it seems to work pretty well on multi-selects, attachments, and any field allowing multiple values – with the comma caveat, as well.


  • New Participant
  • Jul 17, 2017 8:46 PM UTC

After kicking this around for a while, I discovered @Simon_Brown had posted a workaround a year ago:

IF( LEN(Collaborator) = 0, 0, LEN(CONCATENATE(",", Collaborator)) - LEN(SUBSTITUTE(Collaborator, ",", "")))

Only caveat is that none of your collaborator names can have an embedded comma. (I fiddled around some with ARRAYJOIN() in hopes of using an alternative separator character, but Airtable’s insistence on stringifying anything that’s not a text, number, or date field prevents that.) It’s ugly, but it seems to work pretty well on multi-selects, attachments, and any field allowing multiple values – with the comma caveat, as well.


Works like a charm! thanks for the help, would have never been able to solve myself :slightly_smiling_face:


Forum|alt.badge.img+1
  • New Participant
  • Oct 21, 2019 9:57 AM UTC

Thanks for that, very useful!

I don’t get why COUNTALL() can’t do that job. Any second with Airtable frustrates me :frowning: