# Greater than 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 greater than the second value.

Returns whether the first value is greater than the second value. 2 > 32 > 3 returns FALSE, as does "a" > "B""a" > "B". Text string comparisons are case-insensitive.

This operator also works with arrays. { 5, 7 } > 6{ 5; 7 } > 6 returns the array { FALSE, TRUE }{ FALSE; TRUE } (equivalent to { 5 > 6, 7 > 6 }{ 5 > 6; 7 > 6 }) and { 5, 7 } > { 6, 10 }{ 5; 7 } > { 6; 10 } returns the array { FALSE, FALSE }{ FALSE; FALSE } (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 { 4 }{ 4 }:

FILTER({ 2, 4 }, { 2, 4 } > 3)FILTER({ 2; 4 }; { 2; 4 } > 3)

2 is left out, because it is not greater than 3.

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

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

## 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 FALSE.

2 > 22 > 2

Returns FALSE.

TRUE > FALSETRUE > FALSE

Returns TRUE.

"a" > "B""a" > "B"

Returns FALSE. Text string comparisons are case-insensitive.

"A" > "b""A" > "b"

Returns FALSE. Text string comparisons are case-insensitive.

{ 5, 7 } > 6{ 5; 7 } > 6

Returns the array { FALSE, TRUE }{ FALSE; TRUE }, equivalent to { 5 > 6, 7 > 6 }{ 5 > 6; 7 > 6 }.

{ 5, 7 } > { 6, 10 }{ 5; 7 } > { 6; 10 }

Returns the array { FALSE, FALSE }{ FALSE; FALSE }, 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 { 4 }{ 4 }. 2 is left out, because it is not greater than 3.