# Less than or equal to operator (<=)

Value1 <= Value2

## Value1

Number, Logical, Text, Color, { Number }, { Logical }, { Text } or { Color }

The first value to compare.

## Value2

Number, Logical, Text, Color, { Number }, { Logical }, { Text } or { Color }

The second value to compare.

## Returns

Logical or { Logical }

Whether the first value is less than or equal to the second value.

Returns whether the first value is less than or equal to the second value. 2 <= 32 <= 3 returns TRUE, as does 2 <= 22 <= 2 and "a" < "B""a" < "B". Text string comparisons are case-insensitive.

This operator also works with arrays. { 5, 6 } <= 6{ 5; 6 } <= 6 returns the array { TRUE, TRUE }{ TRUE; TRUE } (equivalent to { 5 <= 6, 6 <= 6 }{ 5 <= 6; 6 <= 6 }) and { 5, 6 } <= { 6, 10 }{ 5; 6 } <= { 6; 10 } returns the array { TRUE, TRUE }{ TRUE; TRUE } (equivalent to { 5 <= 6, 7 <= 10 }{ 5 <= 6; 7 <= 10 }).

## FILTER, arrays and <=

The logical arrays returned by this operator are especially useful with functions like FILTER, which takes an array and returns another array only containing certain elements.

This formula returns the array { 2 }{ 2 }:

FILTER({ 2, 4 }, { 2, 4 } <= 3)FILTER({ 2; 4 }; { 2; 4 } <= 3)

4 is left out, because it is not less than or equal to 3.

The formula above works because { 2, 4 } <= 3{ 2; 4 } <= 3 is expanded to the array { TRUE, FALSE }{ TRUE; FALSE } by the `<=` operator. As such, the formula above is equivalent to this formula:

FILTER({ 2, 4 }, { TRUE, FALSE })FILTER({ 2; 4 }; { TRUE; FALSE })

## Comparison details

If two numbers are compared, the larger number is considered greater than the smaller number. If two logical values are compared, TRUE is considered greater than FALSE. If one of the two compared values is blank, the blank value is considered greater than the non-blank value.

Color values are compared by first converting them to the Hue-Saturation-Lightness-Alpha (HSLA) color space, as though the HSLA Calcapp function was used. (The "alpha" value denotes the extent to which the color is transparent or opaque.)

If two colors are compared which differ in terms of their alpha values, the less transparent color is considered greater than the other color. If they have the same alpha value, the hue is considered next, where a color with a greater hue value is considered greater than the other value. If they have the same alpha and hue values, the saturation is considered next, where a color with a greater saturation value is considered greater than the other value. Finally, if they have the same alpha, hue and saturation values, the lightness is considered, where a color with a greater lightness value is considered greater than the other value.

Text strings are compared using lexicographic ordering, which is mostly the same as dictionary order. Text strings are compared in a case-insensitive manner, which means that "a" <= "B""a" <= "B" returns TRUE, as does "A" <= "b""A" <= "b". This is different from how the SORT function works, which is case-sensitive.

When values of different types (say, numbers and text strings) are compared to one another, blank values are considered greater than numbers, which are considered greater than colors, which are considered greater than text strings, which in turn are considered greater than logical values.

## Examples

2 <= 32 <= 3

Returns TRUE.

2 <= 22 <= 2

Returns TRUE.

FALSE <= TRUEFALSE <= TRUE

Returns TRUE.

"a" <= "B""a" <= "B"

Returns TRUE. Text string comparisons are case-insensitive.

"A" <= "b""A" <= "b"

Returns TRUE. Text string comparisons are case-insensitive.

{ 5, 6 } <= 6{ 5; 6 } <= 6

Returns the array { TRUE, TRUE }{ TRUE; TRUE }, equivalent to { 5 <= 6, 6 <= 6 }{ 5 <= 6; 6 <= 6 }.

{ 5, 6 } <= { 6, 10 }{ 5; 6 } <= { 6; 10 }

Returns the array { TRUE, TRUE }{ TRUE; TRUE }, equivalent to { 5 <= 6, 7 <= 10 }{ 5 <= 6; 7 <= 10 }.

FILTER({ 2, 4 }, { 2, 4 } <= 3)FILTER({ 2; 4 }; { 2; 4 } <= 3)

Returns the array { 2 }{ 2 }. 4 is left out, because it is not less than or equal to 3.