What it does
SORT and SORTBY return sorted dynamic arrays.
Syntax or pattern
=SORT(array, [sort_index], [sort_order]) / =SORTBY(array, by_array, [sort_order])5 practical examples
Sort names alphabetically
Sort a list from A to Z.
=SORT(A2:A100)Simple dynamic sorting.
Sort table by sales
Sort a table by the third column descending.
=SORT(Sales,3,-1)-1 sorts descending.
Sort by another column
Sort products by sales amount.
=SORTBY(Products,Products[Sales],-1)SORTBY can sort by a separate array.
Sort filtered rows
Filter and sort East sales.
=SORT(FILTER(Sales,Sales[Region]="East"),3,-1)Dynamic array functions combine well.
Sort by two columns
Sort by region then sales.
=SORTBY(Sales,Sales[Region],1,Sales[Amount],-1)Use multiple sort arrays.
Common mistakes to avoid
- Make sure spill ranges have empty space below or beside them.
- Use Excel Tables where possible for expanding source data.
- Older Excel versions may not support all dynamic array functions.
Related Excel examples
FAQ
What is a spill formula?
A spill formula returns multiple cells from one formula entered in a single cell.
Here are some ideas for you
Optional resources that may help if you are learning formulas, building reports, or working in spreadsheets often.
- Excel formula booksSee ideas
Practice formulas with structured examples you can keep beside your desk.
- Excel shortcut guidesSee ideas
Build speed with keyboard shortcuts for selection, formatting and navigation.
- Numeric keypadsSee ideas
Helpful if you enter many numbers on a laptop or compact keyboard.
- External monitorsSee ideas
Useful for viewing large worksheets, formulas and reference tables side by side.
- Desk notebooksSee ideas
Sketch formula logic, report ideas and table structures before building.
- Laptop standsSee ideas
Make long spreadsheet sessions more comfortable and ergonomic.
Some links in this section may be affiliate links. Choose only what is useful for your own work.