0

I'd like to evaluate 3 pick-lists and then return a response depending on which are true (all three could be true at once).

So for example if SAQ Required, LUA Required and Construction Required all were marked yes, the formula would return a value of "SAQ LUA CONSTRUCTION". I came up with the below, but it only got me so far.

How do I return multiple values if many evaluate to true?

IF(ISPICKVAL(  SAQ_Required__c , 'yes'), 'SAQ',
IF(ISPICKVAL( LUA_Required__c , 'yes'), 'LUA',
IF(ISPICKVAL(Construction_Required__c, 'yes'), 'Construction',
' '
)))

1 Answer 1

1

As a note, I'd analyze why you're doing this and whether you really need it. You should be able to select the different combination of picklist values in reports/list view filters.

Either way, you can do either of these two things - but #1 is the option I would use.

Reference

  1. Concatenate the string based on the IF statements

enter image description here

IF(ISPICKVAL(SAQ_Required__c , 'yes'), 'SAQ ', '') &
IF(ISPICKVAL(LUA_Required__c , 'yes'), 'LUA ', '') & 
IF(ISPICKVAL(Construction_Required__c, 'yes'), 'Construction', '')

  1. You could also utilize AND to evaluate multiple requirements and catch all the possibilities. This is much more cumbersome and would get out of hand quickly with more values.

enter image description here

IF(
AND(
ISPICKVAL(SAQ_Required__c, 'yes'),
ISPICKVAL(LUA_Required__c, 'yes'),
ISPICKVAL(Construction_Required__c, 'yes')), 'SAQ LUA CONSTRUCTION',

IF(
AND(
ISPICKVAL(SAQ_Required__c, 'yes'),
ISPICKVAL(LUA_Required__c, 'yes')), 'SAQ LUA',

IF(
AND(
ISPICKVAL(SAQ_Required__c, 'yes'),
ISPICKVAL(Construction_Required__c, 'yes')), 'SAQ CONSTRUCTION',

IF(
AND(
ISPICKVAL(LUA_Required__c, 'yes'),
ISPICKVAL(Construction_Required__c, 'yes')), 'LUA CONSTRUCTION', '')
)))
4
  • Thanks Kris - I appreciate the 'why' question. I know this doens't look that logical, but the formula is really for reporting purposes only to make a dashboard populate accurately. When I try your logic I'm getting "Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 8" any idea the best way to resolve? Commented May 28, 2020 at 0:02
  • Which one were you using? #1 should work fine. I missed the IF statements in #2 but I've edited that. Commented May 28, 2020 at 0:07
  • #2 I'm still getting that error but can't figure out why. I did update your #2 since PICKVAL was misspelled, but that shouldn't be an issue - Still seeing " Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 8" Commented May 28, 2020 at 0:09
  • Ah that worked perfectly! Thank you Commented May 28, 2020 at 0:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .