SORTBY Function in Excel: Syntax, Examples & Practice

Learn the Excel SORTBY function: Sorts one range by another range. Try focused practice and download a free workbook.

Syntax

=SORTBY(array, by_array1, [sort_order1], …)

Available in Microsoft 365, Excel 2021 and Excel 2024 on desktop. Older perpetual releases may not support this function.

Worked example

RowA: EmployeeB: BranchC: Collection
2AmitMumbai45000
3PriyaPune62000
4RaviNashik38000
5NehaMumbai55000
=SORTBY(A2:C5,C2:C5,-1)

Expected result: Priya (62000), Neha (55000), Amit (45000), Ravi (38000)

The formula uses only the visible ranges. Array results need a clear output area in a compatible Excel version.

Professional use

Sort reports by calculated metrics without changing source data.

Practice SORTBY · Download practice .xlsx

Apply your skills

Explore MIS and finance projects

Questions and answers

How can I practise SORTBY?

Use the focused ten-question SORTBY lab, then download its workbook for ten additional function-specific tasks and an answer key. Core learning works without an account.

Which Excel version supports SORTBY?

Available in Microsoft 365, Excel 2021 and Excel 2024 on desktop. Older perpetual releases may not support this function.

Does the browser simulator replace Microsoft Excel?

No. It supports a selected set of formula behavior for practice. Native workbook recalculation, full function compatibility, PivotTables and external data features must be checked in your own Excel installation.

Interactive practice runs in your browser.