Logical Functions

All of these functions return true or false, so they're great as part of Boolean expressions in either case functions or aggregate functions.

function
example

 

definition

even( k )

Returns true if the argument is an even integer.
Example: even(3) gives false

odd( k )

Returns true if the argument is an odd integer.
Example: odd(3) gives true

exists( a )

Returns true for cases where a has a value. In this case, if a is absent or missing, it returns false.

includes(s, sub)

Returns true if the second string is a substring of the first.
Example: includes("the", "he") gives true.

inRange(a, min, max)

Returns true if the first argument is between the other two. The range includes the lower bound but excludes the upper.
Example: inRange(a, 2, 5) gives true if a is 2, 3, or pi; false if a is 0, 5, or 100

isNumber( x)

Returns true if the argument is a number.
false
if x if "frog" or #TYPE#; true if x is 6.28 or Inf

 

Categories of Functions