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

SORTBY

The SORTBY function sorts an array based on the values in another array.

SORTBY(array, sort-by-array, sort-order, sort-by-array…)

array: The array to sort.

sort-by-array: The array 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-array…: Optionally include another array to sort by.

sort-order…: If an optional sort-by-array… is included, sort-order… is 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.

Notes

Examples

Enter 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

=SORTBY(A2:C11, C2:C11, 1) returns the sorted array below:

Amanda

Comic

20

Amanda

Fiction

21

Julian

Comic

22

Brandon

Fiction

23

Sofia

Fiction

31

Gregory

Non-Fiction

32

Julian

Comic

44

Sofia

Non-Fiction

49

Julian

Comic

55

Gregory

Non-Fiction

55

See alsoFILTERSORT
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.