8 Replies Latest reply: Apr 17, 2017 2:12 PM by Lyndon Mendoza RSS

    Margin of sold itens

    luis lima

      Hello people,


      Need help.


      I have two tables (Cost Table and Sold Table) as below, and I need to calculate the margin of the sold products.


      The tables are linked by "Product"



      Cost Table

      ProductColor.costQuant.costValue CostTotal Value Cost
      Prod 10Red10150,001.500,00
      Prod 10Blue5100,00500,00
      Prod 20Yellow375,00375,00
      Prod 30Red3120,00360,00




      Sold Table  

      ProductColorQuantValue SaleTotal Value  Sale
      Prod 10Blue3300,00900,00
      Prod 20Yellow1150,00150,00



      The correct margin for the sold products is


      Total Value Sale = 1.050 (3 x 300 + 1 x 150)

      Total Value Cost = 375  (3 x 100 + 1 x 75)

      Margin = 0,6429 or 64,29%


      But I can't find a formula to get those number


      Hope someone can help me.