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
lizmijohnlizmijohn 

count of nymber of values selected in a multipicklist

Hi,

 

How to get the count of nymber of values selected in a multipicklist?

 

Eg: My multipicklist value has selected values as red/orange/green. Therefore the count field should get 3.

 

I am using PE edition. How can a formula or workflow be created for this?

 

Please help!

 

Thanks,

Liz

Best Answer chosen by Admin (Salesforce Developers) 
@anilbathula@@anilbathula@

Hi

try with this formula:-

IF(INCLUDES(Ur_picklist__c, "Red"),1,0)+
IF(INCLUDES(Ur_picklist__c, "Green"),1,0)+
IF(INCLUDES(Ur_picklist__c, "Orange"),1,0)

 

And make return type as number.

All Answers

@anilbathula@@anilbathula@

Hi

try with this formula:-

IF(INCLUDES(Ur_picklist__c, "Red"),1,0)+
IF(INCLUDES(Ur_picklist__c, "Green"),1,0)+
IF(INCLUDES(Ur_picklist__c, "Orange"),1,0)

 

And make return type as number.

This was selected as the best answer
AshishyadavAshishyadav
you can try this also
if( ISPICKVAL(picklist_field, "one"), if(ISPICKVAL(picklist_field, "two"), if(ISPICKVAL(picklist_field, "three"),3,2),2),1);

lizmijohnlizmijohn

Thanks Anil. it worked:-)