Excel SORT function

Returns a sorted range without changing the original data. In Spanish Excel it is called ORDENAR.

Syntax

English Excel

=SORT(array, [sort_index], [sort_order])

Spanish Excel (Mexico)

=ORDENAR(matriz, [índice_ordenación], [orden_ordenación])

Spanish Excel (Spain, Latin America)

=ORDENAR(matriz; [índice_ordenación]; [orden_ordenación])

ArgumentWhat it is
arrayThe range to sort.
sort_indexoptionalWhich column of the range decides; 1 by default.
sort_orderoptional1 ascending, -1 descending.

Example

SORT(range, column, order) returns the range sorted without touching the original data. The column is its number within the range (1, 2…); order is 1 for ascending and -1 for descending.

=SORT(A2:C11,3,-1)

Common mistake

Excel 365 and 2021 only. Combine it with UNIQUE or FILTER: SORT(UNIQUE(A2:A100)).

About Ads

This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.

Advertising
Loading ad...

Ads help us keep WebHerramientas free for everyone

Practice SORT

Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons

SORT

SORT(range, column, order) returns the range sorted without touching the original data. The column is its number within the range (1, 2…); order is 1 for ascending and -1 for descending.

Example=SORT(A2:C11,3,-1)ORDENAR = SORT

In E2, show the whole table (without headers) sorted from the highest sale to the lowest.

E2
ABCDEFGH
1SalespersonRegionAmountSales ranking
2CarmenNorth18,500
3JorgeSouth4,200
4LucíaNorth3,900
5AndrésCentral21,000
6PaolaSouth17,800
7RicardoNorth6,400
8ElenaCentral5,900
9MateoNorth19,900
10SofíaWest800
11DiegoCentral4,600
12

Tip: while typing, click a cell or drag across several to insert their reference.

Frequently asked questions

What is SORT called in Spanish?
In Spanish Excel it is ORDENAR. The formula =SORT(A2:C11,3,-1) is written =ORDENAR(A2:C11;3;-1) (or with commas in Mexico).
Why does SORT use semicolons in some Excel versions?
It depends on regional settings. Where the comma is the decimal mark (Spain, much of South America), Excel separates arguments with semicolons. English Excel and Mexican Spanish Excel use commas.
What is the most common SORT mistake?
Excel 365 and 2021 only. Combine it with UNIQUE or FILTER: SORT(UNIQUE(A2:A100)).