SORT Function in Excel: Sort Data With a Formula

⏱ 1 min readUpdated 28 September 2026

Dynamic ArrayLevel: ExpertAvailable in: Excel 365 / 2021+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. Power combo
  6. Related functions

SORT returns a sorted copy of a range; the original stays untouched and the result re-sorts as data changes.

Syntax

=SORT(array, [sort_index], [sort_order], [by_col])
Argument What it means
sort_index Which column to sort by (1 = first).
sort_order 1 ascending, −1 descending.

Examples

Example 1

=SORT(A2:E500, 5, -1)

By amount, largest first.

Example 2

=SORT(A2:E500, {2,5}, {1,-1})

By region A–Z, then amount high–low.

Power combo

=TAKE(SORT(A2:E500, 5, -1), 10)

Top 10 rows (TAKE needs the 2022 update).

SORTBY · FILTER · UNIQUE · TAKE

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong