0

I was trying to add some arithmetic inside of an IF function for a custom formula field and it didn't appear to like the syntax...

IF(AND(ISPICKVAL( Status,'In Progress'),ISPICKVAL( Priority ,'Critical')), NOW() - .00345, null)

Is there any way of doing something like this using a formula or am I better off implementing this with other functionality?

  • 4
    I think you need to write it as 0.00345 instead; it otherwise looks okay. – sfdcfox Jun 9 '16 at 20:55
0

As @sfdcfox said, it will compile with this:

 IF(AND(ISPICKVAL( Status,'In Progress'),ISPICKVAL( Priority ,'Critical')), NOW() - 0.00345, null)
| improve this answer | |
  • How would I implement multiple IF statements like this one? – VanAlfredo Jun 9 '16 at 22:09
  • @Santanu Boral how is it different from sfdcfox comment? – o-lexi Jun 9 '16 at 22:18
  • for instance IF(AND(ISPICKVAL( Status,'In Progress'),ISPICKVAL( Priority ,'high')), NOW() - 0.0069, null) – VanAlfredo Jun 9 '16 at 22:18
  • @VanAlfredo use nested IF formulas or CASE, it depend – o-lexi Jun 9 '16 at 22:21
  • IF(AND(ISPICKVAL(Status,'In Progress'),ISPICKVAL( Priority ,'Critical'),ISPICKVAL(Sub_Status_APS__c ,'Care')), NOW() - 0.00345, IF(AND(ISPICKVAL(Status,'In Progress'),ISPICKVAL( Priority ,'High'),ISPICKVAL(Sub_Status_APS__c ,'Care')),NOW() - 0.005175, IF(AND(ISPICKVAL(Status,'In Progress'),ISPICKVAL( Priority ,'Medium'),ISPICKVAL(Sub_Status_APS__c ,'Care')),NOW()- 0.0138,null))) – VanAlfredo Jun 10 '16 at 2:35

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.