Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Custom expression

Avatar

Level 1

Hey all

 

I have a field on a custom form with 9 multiple choice answers. The formula only displays the value for 1 picked answer but obviously does not 'add' the total if more than 2 values are picked. Formula is as follows:

IF({DE:How are we measuring the success of this content?} = "All", 9,
IF({DE:How are we measuring the success of this content?} = "Organic traffic", 8,
IF({DE:How are we measuring the success of this content?} = "Organic rankings", 7,
IF({DE:How are we measuring the success of this content?} = "Organic visibility", 8,
IF({DE:How are we measuring the success of this content?} = "Conversions / CTA", 8,
IF({DE:How are we measuring the success of this content?} = "Improved user experience", 7,
IF({DE:How are we measuring the success of this content?} = "Links acquired", 6,
IF({DE:How are we measuring the success of this content?} = "Engagement", 7,
IF({DE:How are we measuring the success of this content?} = "None", 5, 0)))))))))

If anyone could advise/help with a 'SUM' expression that would give a total when more than 1 value is selected that would be great.

Thanks
4 Replies

Avatar

Level 1

Thanks, in the meantime I've worked out this as the solution:

 

SUM(IF(CONTAINS("All", {DE:How are we measuring the success of this content?}),9,0),
IF(CONTAINS("Organic traffic", {DE:How are we measuring the success of this content?}),8,0),
IF(CONTAINS("Organic rankings", {DE:How are we measuring the success of this content?}),7,0),
IF(CONTAINS("Organic visibility", {DE:How are we measuring the success of this content?}),8,0),
IF(CONTAINS("Conversions / CTA", {DE:How are we measuring the success of this content?}),8,0),
IF(CONTAINS("Improved user experience", {DE:How are we measuring the success of this content?}),7,0),
IF(CONTAINS("Links acquired", {DE:How are we measuring the success of this content?}),6,0),
IF(CONTAINS("Engagement", {DE:How are we measuring the success of this content?}),7,0),
IF(CONTAINS("None", {DE:How are we measuring the success of this content?}),5,0))

Avatar

Level 2

 

Very nice @AndyKent: your "SUM(IF(CONTAINS(...)))" solution to add up multi-selected values is how I was going to suggest you solve it, too.

 

And @Rafal_Bainie, thanks for the tag; yesterday, I made some improvements to that how to sort multi-selected values technique, which I'll update under that related thread.

 

Regards,

Doug

 

 

Avatar

Level 8

I was going to answer with the same thing, @AndyKent. If(CONTAINS( is the way to go! I use this in a report of mine too.