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
Nick KeatesNick Keates 

How to calculate margin in Quotes

How to create a Gross Margin % field
Working in Quote and using Total Price and 2 custom fields TPQCost and INTCost, both of which roll up all Quoteline values in the Quote.
Want to express this as in COGS and as Gross Margin results. Working on Gross Margin  at the moment, and use this formula in Excel.
=(J1-(J2+J3)/J1
Where
J1 is Field Quote/Total price
J2 is Field Quote/TPQCost … “total external costs”
J3 is Field Quote/INTCost … “direct costs”
If I use a literal copy of Excel’s formula,  (TotalPrice -  (TPQ_Cost__c +  INTCost__c )) /TotalPrice is shows as 23,948,989.09% which is non sensical. Other formula with just one cost field gives same result.
Is there a formula that can provide a margin result?