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

Gross Profit Calc Function
Math Financial Class

Public Function GrossProfitCalc( _
      Optional ByVal vGrossProfit As Variant _
    , Optional ByVal vUnitsSold As Variant _
    , Optional ByVal vProductionCost As Variant _
    , Optional ByVal vSalePrice As Variant _
    ) As Variant

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

Examples:
    GrossProfitCalc(Null, 125, 34, 50) = 2000
    GrossProfitCalc(2000, Null, 34, 50) = 125
    GrossProfitCalc(2000, 125, Null, 50) = 34
    GrossProfitCalc(2000, 125, 34, Null) = 50
    GrossProfitCalc(2000, 125, 34, 50) = True ' #5
    GrossProfitCalc(2000, 125, 34, 49) = False ' #6
    IsNull(GrossProfitCalc(Null, 125, Null, 50)) = True ' #7
See also:
    GrossProfitMarginCalc Function
    NetProfitCalc 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 #5, and it will return False if they are not as in example #6. 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 #7.
vGrossProfit: Gross Profit 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.
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.
Definition:
    GrossProfit = UnitsSold * (SalePrice - ProductionCost)

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