Zo6YN‖

Ra8Tv‖SORT

JkEQn‖Sorts the contents of a range or array.

note

JFZRF‖Enter the formula as an array formula.


ebLBc‖Syntax

DmRKh‖SORT(Range [; SortIndex [; SortOrder [; ByCol] ] ])

gmV6H‖Range: the range or array to sort.

WQaKY‖SortIndex: (optional). The number indicating the row or column to sort by.

P5DGG‖SortOrder: (optional). A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order.

5Vo8L‖ByCol: (optional). A logical value indicating the desired sort direction; FALSE to sort by row (default), TRUE to sort by column.

note

s37P8‖Any of the optional arguments can be omitted. An optional argument requires all preceding separators to be present.


GAZG2‖Examples

7qsFE‖Consider the following table

A

B

C

1

zqTYx‖Product Name

Sales

Revenue

2

ZyGBE‖pencil

20

65

3

rxh8K‖pen

35

85

4

UpTSC‖notebook

20

190

5

eBXBg‖book

17

180

6

NTJ7A‖pencil-case

jwABa‖not

cAKeZ‖not


hDBib‖Example with ascending order

MCbv5‖{=SORT(A2:C6;2;1)}

MBgRu‖Sort the range A2:C6 based on the second column in ascending order (Sales).

EQiyc‖book

17

180

AA3th‖pencil

20

65

zjCpK‖notebook

20

190

GDXFf‖pen

35

85

ofndu‖pencil-case

not

not


pvfNi‖Example with descending order

SC7Zw‖{=SORT(A2:C6;3;-1)}

FSrYH‖Sort the range A2:C6 based on the third column in descending order (Revenue).

5KSd6‖pencil-case

not

not

hHqSc‖notebook

20

190

Eh74E‖book

17

180

KGKEY‖pen

35

85

fjhFK‖pencil

20

65


XAFa7‖Technical information

tip

Lh98N‖This function is available since LibreOfficeDev 24.8.


7AVhU‖This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

COM.MICROSOFT.SORT