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
crosariocrosario 

Help with editing Customized Formula

Good day:

 

I created a custom field called CR Needed for Goal. This basically takes the goal number (field CR Enrollment Goal) and substract it from the current enrollment number (field CR Enrollments Feb 2011 to Jan 2012) to tell the user how many they need to reach the goal every month until the goal is complete.

 

I just encounter a problem that when the number of monthly enrollments overceeds the yearly goal it shows negative and I really would like this number to be 0 so that the user know they have already reached the goal.

 

I am not very experience with formulas: below is a copy and paste of what I just worked on. The black font is the original formula and the red font is what I added to try to remove the negative number and make it 0.

 

CR_Enrolllment_Goal_del__c  -  CR_Enrollments_Feb_2011_to_Jan_2012__c  ( IF CR_Enrollments_Feb_2011_to_Jan_2012__c  is  >  CR_Enrolllment_Goal_del__c then  CR_Needed_for_Goal__c  = 0)

 

Any help with this will be appreciated, thank you in advance.

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

Try this one as below:


if(CR_Enrolllment_Goal_del__c - CR_Enrollments_Feb_2011_to_Jan_2012__c<0,0,CR_Enrolllment_Goal_del__c - CR_Enrollments_Feb_2011_to_Jan_2012__c)

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

Try this one as below:


if(CR_Enrolllment_Goal_del__c - CR_Enrollments_Feb_2011_to_Jan_2012__c<0,0,CR_Enrolllment_Goal_del__c - CR_Enrollments_Feb_2011_to_Jan_2012__c)

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

This was selected as the best answer
crosariocrosario

That worked beautifully thank you so much for helping me so fast. My users will be happy now.

crosariocrosario

I would like to add a final question, what would the formula be if the difference in number is higher than the goal and I wanted to show the positive number the user has excedeed the goal by instead of just a 0.

 

Thanks in advance.