Function Math Financial Class

GrossProfitMarginCalc

"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.

Signature (Visual Basic / VBA)

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

Code Examples

    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
    GrossProfitMargin = Price / (1 - MarkupPercentage / 100)

Parameters

Parameter Description
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%.

Notes & Version History

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.
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.