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 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 ' #8See also: GrossProfitCalc FunctionSummary: 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.
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.