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

Is Within Plus Or Minus Of Function
Math Arithmetic Class

Public Function IsWithinPlusOrMinusOf( _
      ByVal vCheck As Variant _
    , ByVal vVariance As Variant _
    , ByVal vTarget As Variant _
    ) As Variant

Return True if vCheck is within plus or minus vVariance of vTarget; return False otherwise. Summary: True if vTarget - vVariance <= vCheck <= vTarget + vVariance.

Examples:
    IsWithinPlusOrMinusOf(53, 10, 55) = True
    IsWithinPlusOrMinusOf(45, 10, 55) = True
    IsWithinPlusOrMinusOf(35, 10, 55) = False
    IsWithinPlusOrMinusOf(75, 10, 55) = False
See also:
    IsBetween Function
    RangeComp Function
vCheck: The value that is checked to see if it is within the range from vTarget plus or minus vVariance. Function returns Null if vCheck is Null or cannot be fixed up to a number.

vTarget: The middle of the range of values against which vCheck is compared. Function returns Null if vTarget is Null or cannot be fixed up to a number.

vVariance: The middle of the range of values against which vVariance is compared. Function returns Null if vVariance is Null or cannot be fixed up to a number.

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