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

Gross Profit Margin Calc Function
Math Financial Class

Public Function GrossProfitMarginCalc( _
      Optional ByVal vGrossProfitMargin As Variant _
    , Optional ByVal vPrice As Variant _
    , Optional ByVal vMarkupPercentage As Variant _
    ) As Variant

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

    GrossProfitMarginCalc(50, 35, Null) = 30
    GrossProfitMarginCalc(50, Null, 30) = 35
    GrossProfitMarginCalc(Null, 35, 30) = 50
    GrossProfitMarginCalc(50, 35, 30) = True ' #4
    GrossProfitMarginCalc(50, 40, 30) = False ' #5
    IsNull(GrossProfitMarginCalc(Null, Null, 30)) = True ' #6
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 #4, and it will return False if they are not as in example #5. 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 #6.
vGrossProfitMargin: Gross Profit Margin amount as measured in currency (dollars in the US).
vPrice: The price of each Unit as measured in currency.
vMarkupPercentage: The Markup Percentage as measured in percent (normally between 0 and 100). This number is a true percentage; therefore, 0 (zero) represents 0% and 100 represents 100%.
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.
    GrossProfitMargin = Price / (1 - MarkupPercentage / 100)

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