<-- Previous || Up || Next -->

Net Profit Calc Function
Math Financial Class

Public Function NetProfitCalc( _
      Optional ByVal vNetProfit As Variant _
    , Optional ByVal vUnitsSold As Variant _
    , Optional ByVal vProductionCost As Variant _
    , Optional ByVal vSalePrice As Variant _
    , Optional ByVal vTaxRate As Variant _
    ) As Variant

"Net Profit Calculator"
Perform a calculation involving the Net Profit equation.
Solve for the Null argument.
If all arguments non-null, return True if the expression is valid.

    NetProfitCalc(Null, 50, 75, 100, 0.4) = 750
    NetProfitCalc(750, Null, 75, 100, 0.4) = 50
    NetProfitCalc(750, 50, Null, 100, 0.4) = 75
    NetProfitCalc(750, 50, 75, Null, 0.4) = 100
    NetProfitCalc(750, 50, 75, 100, Null) = 0.4
    NetProfitCalc(750, 50, 75, 100, 0.4) = True ' #6
    NetProfitCalc(1000, 50, 75, 100, 0.4) = False ' #7
    IsNull(NetProfitCalc(Null, Null, 75, 100, 0.4)) = True ' #8
See also:
    GrossProfitCalc Function
Summary: This function solves for the argument which is missing or Null or cannot be fixed up to a number. If all arguments are numeric, then this function will return True if the arguments are consistent with the definition of Gross Profit as in example #6, and it will return False if they are not as in example #7. Function will return Null if two or more of the arguments are missing or Null or cannot be fixed up to a number as in example #8.
vNetProfit: Net Profit (after tax) amount as measured in currency (dollars in the US).
vUnitsSold: Number of units sold (a dimensionless measurement).
vProductionCost: The cost to produce each Unit as measured in currency.
vSalePrice: The selling price of each Unit as measured in currency.
vTaxRate: The Tax Rate as a ratio of the Sale Price. A tax rate of 0 (zero) means no taxes (might as well use the Gross Profit Margin calculator function instead) and a rate of .38 (for example) would correspond to a 38% tax bracket.
Note: Function will generate an error if there are exactly two arguments that are Object pointers, Errors, or Arrays. Otherwise, it handles that situation gracefully by returning Null.
    NetProfit = UnitsSold * (SalePrice - ProductionCost) * (1 - TaxRate)
Note: This function uses the GrossProfitCalc function to help calculate the result.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.