Function Math Reals Class

Percent

Returns X percent of Y.

Signature (Visual Basic / VBA)

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

Code Example

    Percent(50, 16) = 8
    Percent(25, 16) = 4
    Percent(20, 25) = 5

Parameters

Parameter Description
vX Percentage of vY that is returned. This number usually represents a part of the whole and it is usually between 0 and 100. 1% is represented by 1 and 100% is represented by 100; NOT 1% represented by .01 NOR 100% represented by 1. Function returns Null if vX is Null or cannot be fixed up to a number.
vY The quantity of which vX percent is returned. This number usually represents the whole. Function returns Null if vX is Null or cannot be fixed up to a number.