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
Bob_zBob_z 

Percentage formula not calculating correctly

I'm having a problem with getting a formula field to calculate the correct percentage. I have 3 fields    Cost (currency field) Number of Months(Number Field) Retainer(Percent Field)

I'm trying to create a formula that shows the results of
Cost__c * Number_Of_Months__c - Retainer__c

But when i view the Total__c field, My formula is only reducing the amount by the number I enter into the retainer field.

So I enter 1,000 into the cost field and 5 in the number of months  field and 5 percent in the retainer field  my return value is $4,999.95 not 4,750. Can any one help me with this formula? 
Best Answer chosen by Bob_z
~Onkar~Onkar
Try to use

(Cost__c * Number_Of_Months__c) - ((Cost__c * Number_Of_Months__c) * Retainer__c)

All Answers

~Onkar~Onkar
Try to use

(Cost__c * Number_Of_Months__c) - ((Cost__c * Number_Of_Months__c) * Retainer__c)
This was selected as the best answer
Bob_zBob_z
Hi Onkar,

Thank you for helping me. This formula seems to be calculating correctly. Can you explain to me why this formula works plese? 
~Onkar~Onkar
Hi Bob,  

In your formula missing the primary value for percentage calculation.  

Here is output for your formula.

Cost__c * Number_Of_Months__c - Retainer__c 

Cost__c * Number_Of_Months__c = 1000 * 5 = 5000

Retainer__c  = 5% (5/100 = .05)

so combine all   5000 - 0.05 = 4,999.95