Name

inrange — Test if a numeric value is within to other values.

Syntax

inrange(number, lower, upper)
                

The INRANGE function has the following arguments:

number

The number or integer to test

lower

The lower limit of the range

upper

The upper limit of the range

Description

The inrange will test a number against a lower and upper limit. If the value is within the range the function returns true, otherwise false.

The function tests if the value is greater than or equal to the lower limit, and less than or equal to the upper limit, and is equivalent to:

limit ge lower and limit le upper
                

Examples

Formula

Description

Result

inrange(10, 2, 20)

Test if the value 10 is between 2 and 20 (inclusive)

true

inrange(2, 2, 20)

Test if the value 2 is between 2 and 20 (inclusive)

true

inrange(20.001, 2, 20)

Test if the value 20.001 is between 2 and 20 (inclusive)

false