---
title: "How to Use the SORT Function in Excel — Griddy"
description: "SORT creates a live sorted copy of a range in Excel. Use it for dashboards, invoice lists, project reports, and clean review views."
canonical_url: "https://getgriddy.ai/blog/how-to-use-sort-function-in-excel/"
---

[Blog](https://getgriddy.ai/blog/)/Excel

Excel

# How to Use the SORT Function in Excel

SORT creates a live sorted copy of a range in Excel. Use it for dashboards, invoice lists, project reports, and clean review views.

Do this with AI

[Try Griddy free](https://app.getgriddy.ai/login?mode=register&next=%2F)

Start in your browser. Also works with Excel and Google Sheets.

[By Justin Freels](https://getgriddy.ai/about/)/Updated August 20, 2026/5 min read

SORT returns a sorted copy of a range. It does not rearrange the original data. Instead, it spills a new sorted view into nearby cells.

That makes it useful for dashboards and reports where the source table should stay untouched, but the review view needs to show highest value, earliest due date, or newest row first.

## The syntax

fx

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

- **array** - the range to sort
- **\[sort\_index\]** - which column number inside the array to sort by
- **\[sort\_order\]** - `1` for ascending, `-1` for descending
- **\[by\_col\]** - use `TRUE` to sort columns instead of rows; most sheets leave this blank

## Example: sort invoices by due date

Suppose `A2:F100` contains invoices:

- column A: invoice number
- column B: client
- column C: status
- column D: amount
- column E: due date
- column F: owner

To create a live view sorted by due date, use:

fx

`=SORT(A2:F100, 5, 1)`

The `5` means "sort by the fifth column in the selected range," which is due date. The `1` means ascending, so the earliest due dates appear first.

## Sort largest amounts first

To sort the same invoice table by amount from largest to smallest:

fx

`=SORT(A2:F100, 4, -1)`

The original table stays where it is. The formula output updates automatically when rows in the source range change.

WATCH OUT

SORT spills results into empty cells. If anything blocks the spill range, Excel returns a `#SPILL!` error.

## SORT vs manual sorting

Manual sorting changes the source table. That can be fine for one-off cleanup, but it is risky in a working model where other formulas, comments, or review views depend on the original order.

SORT is better when you want a repeatable view:

- overdue invoices by due date
- largest deals by value
- tasks by priority
- expenses by amount
- clients by next follow-up date

The source data can remain an ordinary entry table while the SORT formula powers the review area.

## When to use SORTBY instead

SORT works best when the sort column is inside the same range. If you need to sort by a separate helper column, or sort by several fields at once, use SORTBY.

For example, sort a table by due date ascending, then amount descending:

fx

`=SORTBY(A2:F100, E2:E100, 1, D2:D100, -1)`

That is often easier to read than trying to force several rules into a single SORT formula.

## Common issues

| Issue | Cause | Fix |
| --- | --- | --- |
| `#SPILL!` | Cells are blocking the output | Clear the destination area |
| Wrong column sorted | `sort_index` counts inside the selected array | Count from the first column in `array`, not from column A |
| Header row appears in the results | Header was included in the array | Start the array at the first data row |
| Need multiple sort rules | SORT is too limited for the job | Use SORTBY |

## The Griddy way

Sorted report views are useful, but they are easy to break when columns move.

> "Create a live view of unpaid invoices sorted by due date, with the largest overdue amounts at the top"

Griddy can build the sorted view from your current sheet and adjust the formula around your actual columns.

## Sources

- [Microsoft Support: SORT function](https://support.microsoft.com/en-us/excel/functions/sort-function)
- [Microsoft Support: Sort data in a range or table](https://support.microsoft.com/en-us/excel/get-started/sort-data-in-a-range-or-table)

Do this with AI

## Turn the instructions into a finished spreadsheet.

Tell Griddy what you need in plain English, then inspect and keep editing the result in the browser, Excel, or Google Sheets.

[Try Griddy free](https://app.getgriddy.ai/login?mode=register&next=%2F)Start in your browser. No download required.

Also works with[Excel](https://appsource.microsoft.com/en-us/product/office/wa200008745)[Google Sheets](https://workspace.google.com/marketplace/app/griddy/206105793696)

[All posts](https://getgriddy.ai/blog/)

Do this with AI

## Ask Griddy to do this for you.

Describe the result in plain English—no formula knowledge required.

[Try Griddy free](https://app.getgriddy.ai/login?mode=register&next=%2F)Start in your browser. No download required.

Also works with[Excel](https://appsource.microsoft.com/en-us/product/office/wa200008745)[Google Sheets](https://workspace.google.com/marketplace/app/griddy/206105793696)

About this guide

Written by Justin Freels, Founder, Griddy.

Updated August 20, 2026/5 min read
