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
SankarSankar 

Help Required for IF operatior in Formula

I am using the below formula 

 

IF(ISBLANK( VALUE( Currency__c )), Amount_Spent__c, Amount_Spent__c * 50)

 

Formula return type is a number.  Currency__c is a lookup and Amount_Spent__c is a number field. For true ie if Currency__c is blank then it returns the desired value. But for an false condition it is returnin #error.

 

What is wrong with this formula can any one help me.

 

Regards

Sankar

Best Answer chosen by Admin (Salesforce Developers) 
SankarSankar
Thanks chandra it worked

All Answers

MachhiMachhi

Hi,

 

It seems that the error is becuase of Value function. As you said, Currency__c is a lookup field. For some cases, the value in this lookup might be containing non-numeric value and hence the result. You can cross check this from the scenario where you are getting error.

On the other point, I think you should reformat your formula like as below:

IF(ISNULL(Currency__c), Amount_Spent__c, Amount_Spent__c * 50)

 

This will add more accuracy to your business logic.

 

Regards,

Chandrakant M

machhi_c_m@yahoo.com 

SankarSankar
Thanks chandra it worked
This was selected as the best answer
MachhiMachhi

Hi All,

 

Just for your reference, the solution is updated to handle all possible cases:

IF((ISBLANK(Currency__c) || ISNULL(Currency__c)), Amount_spent__c, Amount_spent__c * 50)

 

Regards,

Chandrakant M

machhi_c_m@yahoo.com