Function Math Reals Class

PercentChange

Percent increase of Y over X.

Signature (Visual Basic / VBA)

Public Function PercentChange( _
      ByVal vX As Variant _
    , ByVal vY As Variant _
    ) As Variant

Code Example

    PercentChange(4, 12) = 200
    PercentChange(4, 8) = 100
    PercentChange(4, 6) = 50
    PercentChange(4, 2) = -50
    PercentChange(4, 1) = -75
    PercentChange(4, 0) = -100

Parameters

Parameter Description
vX The starting/original number. Function returns Null if vX is Null or cannot be fixed up to a number. Function returns Null if vX is 0 (zero).
vX The ending/final number. Function returns Null if vY is Null or cannot be fixed up to a number.