---
title: "Sort a table by sales with SORT | PracticeExcel"
description: "Practice the SORT function in a live spreadsheet: sort a table by sales, highest first."
canonical_url: "https://practiceexcelonline.com/practice/sort-and-unique/sort-function"
locale: en
meta:
  "og:description": "Practice the SORT function in a live spreadsheet: sort a table by sales, highest first."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_Sort%2Ba%2Btable%2Bby%2Bsales%2Bwith%2BSORT%2Cdescription_~UHJhY3RpY2UgdGhlIFNPUlQgZnVuY3Rpb24gaW4gYSBsaXZlIHNwcmVhZHNoZWV0OiBzb3J0IGEgdGFibGUgYnkgc2FsZXMsIGhpZ2hlc3QgZmlyc3Qu%2Ceyebrow_SORT%2Band%2BUNIQUE%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJEIiwiRSJdLCJyb3dzIjpbeyJuIjoxLCJjZWxscyI6WyJSZXAiLCJTYWxlcyIsIlJlcCIsIlNhbGVzIl19LHsibiI6MiwiY2VsbHMiOlsiQW5uIiwiNDIwIiwiIiwiIl19LHsibiI6MywiY2VsbHMiOlsiQmVuIiwiMzEwIiwiIiwiIl19LHsibiI6NCwiY2VsbHMiOlsiQ3kiLCIxNTAiLCIiLCIiXX0seyJuIjo1LCJjZWxscyI6WyJEaSIsIjUwMCIsIiIsIiJdfSx7Im4iOjYsImNlbGxzIjpbIkVkIiwiMjYwIiwiIiwiIl19XSwidGFyZ2V0IjpbMSwyXX19%2Cp_Ii9wcmFjdGljZS9zb3J0LWFuZC11bmlxdWUvc29ydC1mdW5jdGlvbiI%2Cs__5mU1RLu-2GqeMNl.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Sort a table by sales with SORT | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_Sort%2Ba%2Btable%2Bby%2Bsales%2Bwith%2BSORT%2Cdescription_~UHJhY3RpY2UgdGhlIFNPUlQgZnVuY3Rpb24gaW4gYSBsaXZlIHNwcmVhZHNoZWV0OiBzb3J0IGEgdGFibGUgYnkgc2FsZXMsIGhpZ2hlc3QgZmlyc3Qu%2Ceyebrow_SORT%2Band%2BUNIQUE%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJEIiwiRSJdLCJyb3dzIjpbeyJuIjoxLCJjZWxscyI6WyJSZXAiLCJTYWxlcyIsIlJlcCIsIlNhbGVzIl19LHsibiI6MiwiY2VsbHMiOlsiQW5uIiwiNDIwIiwiIiwiIl19LHsibiI6MywiY2VsbHMiOlsiQmVuIiwiMzEwIiwiIiwiIl19LHsibiI6NCwiY2VsbHMiOlsiQ3kiLCIxNTAiLCIiLCIiXX0seyJuIjo1LCJjZWxscyI6WyJEaSIsIjUwMCIsIiIsIiJdfSx7Im4iOjYsImNlbGxzIjpbIkVkIiwiMjYwIiwiIiwiIl19XSwidGFyZ2V0IjpbMSwyXX19%2Cp_Ii9wcmFjdGljZS9zb3J0LWFuZC11bmlxdWUvc29ydC1mdW5jdGlvbiI%2Cs__5mU1RLu-2GqeMNl.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **Sort a table by sales with SORT**

In D2, return the table A2:B6 sorted by sales, highest first. SORT takes the range, the column to sort by (2) and the order (-1 for descending).

D2fx

|  | A | B | C | D | E | F |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | Rep | Sales |  | Rep | Sales | |
| 2 | Ann | 420 |  |  |  | |
| 3 | Ben | 310 |  |  |  | |
| 4 | Cy | 150 |  |  |  | |
| 5 | Di | 500 |  |  |  | |
| 6 | Ed | 260 |  |  |  | |
| 7 |  |  |  |  |  | |
| 8 |  |  |  |  |  | |

Need help?

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#webpage","description":"Practice the SORT function in a live spreadsheet: sort a table by sales, highest first.","name":"Sort a table by sales with SORT","url":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"mainEntity":[{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#/schema/question/1"},{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/practice/sort-and-unique/sort-function"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel practice exercises","item":"https://practiceexcelonline.com/practice","position":2},{"@type":"ListItem","name":"SORT and UNIQUE","item":"https://practiceexcelonline.com/practice/sort-and-unique","position":3},{"@type":"ListItem","name":"Sort a table by sales with SORT","position":4}]},{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I sort with a formula in Excel?","acceptedAnswer":{"@type":"Answer","text":"=SORT(A2:B6,2,-1) returns A2:B6 sorted by its second column in descending order. Use 1 or leave out the last argument for ascending."}},{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"Is SORT the same in Google Sheets?","acceptedAnswer":{"@type":"Answer","text":"Almost. In Google Sheets the third argument is TRUE for ascending or FALSE for descending, so the same sort is =SORT(A2:B6,2,FALSE)."}},{"@id":"https://practiceexcelonline.com/practice/sort-and-unique/sort-function#/schema/learning-resource/1","@type":"LearningResource","description":"Practice the SORT function in a live spreadsheet: sort a table by sales, highest first.","educationalLevel":"intermediate","isAccessibleForFree":true,"learningResourceType":"exercise","name":"Sort a table by sales with SORT","teaches":"SORT and UNIQUE"},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
