Calculate selected items from Multi-Picklist - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Chantal LambertChantal Lambert 

Calculate selected items from Multi-Picklist

I want to create a Formula Field that will tell me how many items from a Multi-Picklist were selected, in order to get reporting (%) done and numbers for upper management.

I have tried building my formula based on others I have seen from Steve Molis or Jeff May (for other situations) but I am getting an error message: Error: Incorrect number of parameters for function 'CASE()'. Expected 2, received 1

CASE(
IF(INCLUDES(Aggregation_Offered__c, 'Item A'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item B'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item C'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item D'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item E'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item F'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item G'),1,0))

What am I missing here ?
Best Answer chosen by Chantal Lambert
Tony TrinhTony Trinh
Hi Chantal.

Remove the CASE:
IF(INCLUDES(Aggregation_Offered__c, 'Item A'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item B'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item C'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item D'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item E'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item F'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item G'),1,0)

All Answers

Tony TrinhTony Trinh
Hi Chantal.

Remove the CASE:
IF(INCLUDES(Aggregation_Offered__c, 'Item A'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item B'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item C'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item D'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item E'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item F'),1,0) + 
IF(INCLUDES(Aggregation_Offered__c, 'Item G'),1,0)
This was selected as the best answer
Steve MolisSteve Molis
I'm just gonna leave this here...

User-added image
Chantal LambertChantal Lambert
@Tony Trinh: it works, thank you !
@Steve Molis: I need to learn more about Dependent Picklists and Related Lists. I need to be able to pull numbers and for now, multi-picklist is my easiest solution... I do love Baby Seals though...