function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris ConfortiChris Conforti 

IF(TEXT( Formula Assistance

Hello - I am attempting to create a formula that will allow us to build metrics on case turn around time.  The formula will output a number based off of the "status" picklist selection.
There are two picklist options that can trigger the formula and I am having trouble figuring out how to have one formula that references a picklist field be able to take action on more than one picklist option.  
Below is what I have;

IF(TEXT(ThinkLP__Status__c) = "Verified True Variance", NOW() - CreatedDate, NULL)
OR(
IF(TEXT(ThinkLP__Status__c) = "Verified False Variance", NOW() - CreatedDate, NULL)

I have tried a number of different variations to the formual to no avail...any help is appreciated.

Thank You,
Christopher
Best Answer chosen by Chris Conforti
kaustav goswamikaustav goswami
First observation - for both the values you have the same value in the formula field - Now() - CreatedDate - then why are you trying to create two different if conditions.

If you are going to use the IF function and you need to get different values then you need to do it in a nested manner-

IF(
    ISPICKVAL(ThinkLP__Status__c,"Verified True Variance"),Now() - CreatedDate,
        IF(ISPICKVAL(ThinkLP__Status__c,"Verified False Variance")),Now()-LastModifiedDate,Null
)
If for both the conditions you need Now() - CreatedDate then simply go for the OR clause in the if expression
IF(ISPICKVAL(ThinkLP__Status__c,"Verified True Variance") || ISPICKVAL(ThinkLP__Status__c,"Verified False Variance"),Now()-CreatedDate(),Null)


Thanks,
Kaustav

All Answers

kaustav goswamikaustav goswami
First observation - for both the values you have the same value in the formula field - Now() - CreatedDate - then why are you trying to create two different if conditions.

If you are going to use the IF function and you need to get different values then you need to do it in a nested manner-

IF(
    ISPICKVAL(ThinkLP__Status__c,"Verified True Variance"),Now() - CreatedDate,
        IF(ISPICKVAL(ThinkLP__Status__c,"Verified False Variance")),Now()-LastModifiedDate,Null
)
If for both the conditions you need Now() - CreatedDate then simply go for the OR clause in the if expression
IF(ISPICKVAL(ThinkLP__Status__c,"Verified True Variance") || ISPICKVAL(ThinkLP__Status__c,"Verified False Variance"),Now()-CreatedDate(),Null)


Thanks,
Kaustav
This was selected as the best answer
Chris ConfortiChris Conforti
I removed the () After createddate and it is working perfectly!
You help is much appreciated!