function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris Sanchez 5Chris Sanchez 5 

count number of items selected in a multipicklist

How can I create a rollup summary or formula field that will count the number of items selected in a multipicklist?  For example if the options in a multipicklist are apple, orange, and grape.  If apple and orange are selected the answer is 2.  It feels like it would be a rollup summary or formula field but really open to any way to make this work.  Thanks for your help.
Karan Shekhar KaulKaran Shekhar Kaul

Hi Chris,

I don't think rollup summary will help. You can create a formula but it will have harcoded values.

Create a formula with return type as number & add below formula.Hope this helps.

IF(INCLUDES( Multi_Picklist__c , "Apple"), 1, 0) +
IF(INCLUDES( Multi_Picklist__c , "Orange"), 1, 0) + 
IF(INCLUDES( Multi_Picklist__c , "Grape"), 1, 0)

Regards,

Karan

Karan Shekhar KaulKaran Shekhar Kaul
Hi Chris,

Please mark a correct answer if this solved your issue.