Products, services, and OS functions
may not be available in this country.

SORT

The SORT function sorts an array.

SORT(array, sort-index, sort-order, sort-by)

array: The array to sort.

sort-index: A number to indicate the row or column to sort by.

sort-order: An indicator for desired sort order.

sort ascending (1 or omitted): Sort in ascending order. This is the default selection.

sort descending (-1): Sort in descending order.

sort-by: A boolean value of either TRUE or FALSE.

sort rows (FALSE or omitted): Sort by row. This is the default selection.

sort columns (TRUE): Sort by column.

Notes

Examples

Given the following data in cells A1:C11:

Sales Rep

Genre

Units

Amanda

Fiction

21

Brandon

Fiction

23

Sofia

Nonfiction

49

Julian

Comic

22

Gregory

Nonfiction

32

Julian

Comic

55

Julian

Comic

44

Sofia

Fiction

31

Amanda

Comic

20

Gregory

Nonfiction

55

=SORT(A2:C11, 3, 1,FALSE) returns the array sorted from least units sold to most units sold. See below:

Amanda

Comic

20

Amanda

Fiction

21

Julian

Comic

22

Brandon

Fiction

23

Sofia

Fiction

31

Gregory

Nonfiction

32

Julian

Comic

44

Sofia

Nonfiction

49

Julian

Comic

55

Gregory

Nonfiction

55

=SORT(A2:C11) returns the array sorted in alphabetical order. See below:

Amanda

Fiction

21

Amanda

Comic

20

Brandon

Fiction

23

Gregory

Nonfiction

32

Gregory

Nonfiction

55

Julian

Comic

22

Julian

Comic

55

Julian

Comic

44

Sofia

Nonfiction

49

Sofia

Fiction

31

See alsoFILTERSORTBY
Morty Proxy This is a proxified and sanitized view of the page, visit original site.
Helpful?
Character limit: 250
Maximum character limit is 250.
Thanks for your feedback.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.