0

This formula works:

IF( AND(RecordType.Name = 'Solutions', 
DATEVALUE(Account.CreatedDate) <= TODAY() - 10, 
CreatedBy.Profile.Name = "Perkins Access Standard User",
ISPICKVAL( StageName , 'Won Completed'))  ,
"existing customer", "new customer")

But I need to add more stage names- Won Pending Start' and 'Won In Progress'

I tried this formula and it does not work-

IF(AND(RecordType.Name = 'Solutions', DATEVALUE(Account.CreatedDate) <= TODAY() - 10, 
CreatedBy.Profile.Name = "Perkins Access Standard User", 
ISPICKVAL( StageName , 'Won Completed'||'Won Pending Start' || 'Won In Progress'))
,"existing customer", "new customer")
  • am getting this error- Error: Incorrect parameter type for function 'or()'. Expected Boolean, received Text.

Is there another way to write this so it works? I'm new to formulas and for the life of me cannot figure this out!

3

That's not how you use ||; each value has to be compared individually. || is used to return true if at least one of two or more different Boolean values are true.

The traditional "shortcut" for this is to use CASE:

1 = CASE(StageName,"Won Completed",1,"Won Pending Start",1,"Won In Progress",1,0)

How case works is it finds the first even value that matches the first value, and returns the odd value afterwards. It returns the very last parameter if there are no matches. So, for example, if StageName is "Won Completed", case returns 1, and 1 = 1, but if StageName is "Lost", then case returns 0, and 0 = 1 is false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.