SORT
Array FormulasMaster the SORT function for dynamic array sorting in Excel 365. Sort data automatically without manual sort operations.
Syntax
SORT(array, [sort_index], [sort_order], [by_col])Parameters
arrayThe range or array to sort
sort_indexColumn or row number to sort by (default 1)
sort_order1=ascending (default), -1=descending
by_colFALSE=sort rows (default), TRUE=sort columns
Examples
=SORT(A2:C100)Sort by first column ascending
=SORT(A2:C100, 2, -1)Sort by second column descending
=SORT(FILTER(A2:C100, B2:B100>0), 3, 1)Filter then sort
Common Errors
#VALUE! - Sort index exceeds array dimensions
Pro Tips
Results spill automatically
Use SORTBY for more complex sorting
Combine with FILTER and UNIQUE for powerful data manipulation
Related Functions
Need Help with SORT?
Describe your specific use case and our AI will generate the perfect SORT formula for you.
Generate SORT Formula