Open In App

Excel SORT Function

Last Updated: 17 Jun, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Explore the power of your Excel data with our easy-to-follow guide on Excel Sort Function. Whether you’re a beginner or an experienced professional, learning Excel’s sorting and filtering tools can enhance your workflow and provide valuable insights. This article explores each step, ensuring you can organize your data efficiently and effectively. With our tips, you’ll be able to sort anything from simple lists to complex data sets. Let’s discover how Excel can transform your data analysis tasks and save you time. Remember, a well-sorted spreadsheet is the first step toward data-driven decision-making.

How-to-Sort-Data-in-Excel

Excel SORT Function

What Is Excel Sort Function

The Excel SORT function is a powerful tool that allows you to sort the contents of a range or array in ascending or descending order. Remember, the SORT Function sorts your data without disturbing the original data set. It’s a great tool for organizing and analyzing data in Excel. Here’s a brief overview of its syntax and usage:

Syntax: =SORT(array, [sort_index], [sort_order], [by_col])1234

  • Array: This is the range or array you want to sort234.
  • Sort_index (optional): This is the column number you want to sort by. The default is 1234.
  • Sort_order (optional): This allows you to select between ascending (1) and descending (-1) order. The default is ascending order234.
  • By_col (optional): This allows you to select between sorting by column (TRUE) and sorting by row (FALSE). The default is FALSE234.

The SORT function returns a dynamic array of results. If values in the source data change, the result from SORT will update automatically. This function is part of a class of functions called dynamic arrays. For example, to sort a range by the first column in ascending order, you would use: =SORT(range) or =SORT(range,1,1). To sort by the second column in descending order, you would use: =SORT(range,2,-1).

Basic Excel SORT Formula

Read below to learn the basic formula for sorting data in Excel in ascending and descending order given for your reference,

Excel Formula to Sort in Ascending Order

Remember, these formulas will sort the numbers in the specified range in ascending order, without disturbing the original data set. In Excel, you can use the SORT function to sort data in ascending order. Here’s how you can do it:

To sort values in column B from smallest to largest, here’s the MS Excel formula to use:

=SORT(A2:B8, 2, 1) Random numbers and cells

Excel Formula to Sort in Descending Order

To sort a range of data in descending order in Excel, set the sort_order argument to -1 like this:

=SORT(A2:B8, 2, -1) Random numbers and cells

How to Sort Data in Excel Using Formula

Sorting data in Excel using formulas allows for the dynamic and automated organization of data without manual intervention. This technique leverages functions like `SORT` and `SEQUENCE` to efficiently arrange data in ascending or descending order based on specified criteria. Read below to learn more about typical uses of the SORT function in Microsoft Excel,

How to Sort One Column in Excel

To sort by column in Excel, set the by_col argument to TRUE. In this case, sort_index will represent a row, not a column. Read the given below article to learn the process of Sorting one Column in Excel.

How to Sort One Column in Excel

How to Sort Multiple Columns in Excel

When working with complex data models, you may often need a multi-level sort. Supply array constants for the sort_index and sort_order arguments. You can also read the below article to know the whole procedure of ‘Sorting multiple Columns in Excel’.

How to Sort Multiple Columns in Excel

Sort and Filter in Excel

When you need to filter data based on specific criteria and sort the output, you can use the `SORT` and `FILTER` functions together.

Syntax: SORT(FILTER(array, criteria_range=criteria), [sort_index], [sort_order], [by_col])

Excel SORT Function Not Working

If your `SORT` formula in Microsoft Excel isn’t working, it could be due to several reasons. These tips should help you troubleshoot issues with sorting data in Excel using formulas.

  1. #NAME? error: This happens in older Excel versions. The `SORT` function only works in Excel 365 and Excel 2021. In older versions, you will get a #NAME? error.
  2. #SPILL! error: This occurs when something is blocking the spill range. Ensure all cells in the spill range are empty and not merged. Remove any blockages to fix this.
  3. #VALUE! error: Check the `sort_index` and `sort_order` arguments. The `sort_index` shouldn’t be higher than the number of columns in the array, and `sort_order` should be either 1 (ascending) or -1 (descending).
  4. #REF! error: This happens if the source workbook is closed. Both the source and the destination workbooks need to be open for the `SORT` function to work.

Read More

Conclusion

In conclusion, learning the Excel SORT function is a powerful tool that can transform your data analysis and decision-making processes. By understanding how to use this function, you can organize your data in a way that’s meaningful and easy to understand. Whether you’re sorting simple lists or complex data sets, the SORT function is your key to unlocking the full potential of Excel. Start using the SORT function today and see the difference it can make in your data management tasks. Remember, when it comes to data analysis in Excel, a well-sorted dataset is the first step toward success.

MS Excel Sort Function – FAQs

How to use NS Excel sort function?

Use the SORT function like this: =SORT(array, sort_index, sort_order), where array is the data range, sort_index is the column number to sort by, and sort_order is 1 for ascending or -1 for descending.

Can Excel automatically sort data?

Yes, Excel can automatically sort data using the SORT function. It dynamically updates the sorted data when the source data changes.

How to SORTBY list in Excel?

Use the SORTBY function: =SORTBY(array, by_array, [sort_order]), where array is the data range, by_array is the range to sort by, and sort_order is optional (1 for ascending, -1 for descending).

How do I use SORTBY in Excel?

To use SORTBY, input the function with your data range and the criteria range, like so: =SORTBY(A1:A10, B1:B10, 1) to sort A1:A10 by B1:B10 in ascending order.

What are sorting methods?

Sorting methods in Excel include:

  • Ascending Order: Sorts data from smallest to largest.
  • Descending Order: Sorts data from largest to smallest.
  • Custom Order: Sorts data based on a user-defined list.
  • Sort by Multiple Columns: Sorts data using multiple criteria.
  • Dynamic Array Sorting: Automatically sorts data using functions like SORT and SORTBY.


News
Improve
Discuss
Do you want to advertise with us?Click here to know more

Excel VLOOKUP Function - Excel Guide for Beginners

article_img
How to do Vlookup in Excel - Quick StepsPrepare Your DataEnter the VLOOKUP Formula >>Press EnterUse a Cell Reference for Flexibility Copy the Formula for Multiple RowsThe VLOOKUP function is one of the most widely used tools in Excel for looking up and retrieving data from a table. Whether you’re working with a single sheet or multiple workbooks, VLOOKUP allows you to search for a value in one column and return a related value from another. If you're new to Excel or still getting the hang of formulas, this guide is for you. We will cover everything from the basics of how VLOOKUP works to practical examples that show how to search data across sheets, troubleshoot common issues, and master the VLOOKUP formula for any task.Excel VLOOKUP FunctionWhat is the VLOOKUP Function in ExcelThe term VLOOKUP stands for Vertical Lookup. It is designed to search for a specific value in the first column of a table (lookup column) and retrieve corresponding data from a different column in the same row.Syntax of VLOOKUP FormulaVLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])Arguments:1. lookup_value: The value you want to search for (e.g., a specific ID, name, or product code).
Read More

Editing Excel Macros in Excel

article_img
Excel Macro is a set of actions that can be recorded, saved, used multiple times. This feature saves us a lot of time when dealing with repetitive tasks and huge data sets. We can always make changes to an existing Macro in Excel. There are two ways to record and run macros: Excel Commands Excel Visual Basic for Applications(VBA).1. Copying a Macro Code We can reuse the existing macro code while creating new Macros. For example, if you have existing macros created using the record function, we can reuse the code to write new macros. To open the code follow the below steps: Select Tools --> Macros --> Visual Basic Editor. Copy code from the existing macros(use Command + C) and paste(use Command + V) in the new macro2. Renaming a Macro Follow the below steps to rename a Macro in Excel: Select Tools --> Macros --> Visual Basic Editor. Select name on the left plane.Edit the name.3. Deleting a Macro Follow the below steps to delete a macro in Excel: Select Tools --> Macros --> Macros... Select the macro to be deleted. Click on the minus(-) symbol at the bottom.Select yes to delete the macro.
Read More

Best Microsoft Excel High-Paying Jobs with Excel Skills in 2024

article_img
Are you ready to unlock a world of opportunities with Microsoft Excel? In today’s data-driven job market, mastering Excel is essential for launching a successful career, whether you're a fresher or an experienced professional. In this article, we will cover the high-paying Excel jobs available in 2024, including crucial roles like data analyst, business analyst, and many more. We'll explore the qualifications needed for these positions, along with salary estimations to help you understand your earning potential. Whether you’re looking for Excel jobs for freshers or seasoned professionals, we’ll also dive into options for Excel freelancing jobs and work-from-home jobs in Excel. Equip yourself with the knowledge to excel in your career and take the first step toward a lucrative future!Best Microsoft Excel High-Paying Jobs with Excel Skills in 2024Table of ContentWhy choose a career in ExcelWhy Excel Skills Are Essential for Your CareerEssential Excel Skills Required to Boost Your Resume Best Microsoft Excel High-Paying JobsFinancial AnalystsData AnalystAdministrative Assistant Accountants Project ManagersManagement ConsultantRetail Store ManagersBusiness Analyst Market Research A
Read More

AI in Excel: Top 20 Excel AI Tools in 2025 (Free/Paid)

article_img
The integration of AI in Excel is transforming the way professionals manage, analyze, and visualize data. Whether you're handling large datasets, performing financial analysis, or automating repetitive tasks, AI-powered tools can significantly improve efficiency and accuracy. In 2025, advanced Excel AI tools are making complex tasks easier by offering features like data cleaning, predictive analytics, smart automation, and AI-driven insights.In this guide, we’ve gathered a list of the top 20 Excel AI tools for 2025 that are reshaping how users interact with Excel.Table of ContentBest AI Tool in Excel: Top Picks for 2025Top 10 Free Excel AI Tools in 2025Top 10 Excel AI ToolsAI in Excel: OverviewIn Excel, an AI tool (Artificial Intelligence tool) refers to an add-in or extension that leverages artificial intelligence to enhance your spreadsheet experience. These tools can automate tasks, improve data analysis, and generally make you more productive.Excel has always been a powerful tool for data analysis, but with the integration of AI tools, it has transformed into a smarter, more intuitive platform.Best AI Tool in Excel: Top Picks for 2025Explore the below AI tools designed for auto
Read More

What Is the Difference Between VAR.S Function and VAR.P Function in Excel?

Functions in Excel are the pre-defined formulae used to obtain a certain value and to perform calculations using the specific value in a certain order. The basic functions are SUM, AVG, MAX, MIN, etc used for the range of cells. In order to obtain the correct results from the function, the correct syntax of the functions is required. In this article, we will discuss VAR.P FUNCTION & VAR.S FUNCTION, the difference between VAR.P FUNCTION & VAR.S FUNCTION, and demonstrate how to calculate each in an excel sheet. VAR.P Function The VAR.P function is classified as an Excel statistical function. This function returns the variance of a given set of values. This was introduced in the 2010 version of MS Excel.Variance is a statistical measure used across a range of values ​​to determine how much the values ​​differ from the mean. As a financial analyst, the VAR.P function helps me calculate sales variances. Portfolio managers often use this feature to measure and track portfolio risk. Formula of VAR.P Function =VAR.P(number1,[number2],...) number 1 (mandatory argument): This is the first argument corresponding to the population.  number 2 (optional arguments): where number arguments
Read More

How to Sort by Date in Excel?

article_img
Excel provides various types of sorting formats e.g. “sort A to Z”, “Sort Z to A”, “Sort by color” and “Sort by date” etc. Sorting in Excel is nothing but arranging data into some meaningful order to make it easier to understand, analyze, or visualize. Here, we will be discussing how to sort by Date in Excel whether it may be Years, Months, Days, or weeks. How to Sort by Date in Excel? How to Sort by Date in Excel?Chronological or reverse chronological order is the easiest way to sort data by date. This sorts the data in ascending or descending order. In Excel, you must have the dates in one single format to sort the data by date otherwise they do not always work. To sort the dates in chronological order follow the below steps: Step 1:  Select the dates which you want to sort in ascending or descending order. Step 2: Click Home tab -> Click on the arrow under Sort & Filter, and then click Sort Oldest to Newest. As a result, data is sorted from oldest to newest. Step 3:  If you want to sort dates from Newest to Oldest, then Click Home tab -> Click on the arrow under Sort & Filter, and then click Sort Newest to Oldest. As a result, data is sorted by newest to oldest. Ho
Read More

How to Sort by Number in Excel?

article_img
Excel is the world where you can organise your data. Organising data is a very big task especially when you are doing it on a large scale. In Excel, one can have around 17 million cells in one worksheet. So at this point, arranging the data in a systematic order is very important. If you are curious to know how to sort the data then this article is for you! In order to organise data, one should be aware of sorting. Now, what is sorting? In Excel sorting is a method to customise the order of the data. For example, If we are marinating a record of classroom's students then one can have the list in alphabetical order, also one can sort data by their birthdays. In Excel sorting comes in various ways, you can sort data by alphabet, numbers, date or time. Now, this article is more concerned about sorting by Number in Excel? How to sort by Number in Excel? We can sort the numerical data in two ways one is ascending order meaning arranging data from smallest value to biggest value, and the other way is descending order meaning arranging data from largest value to smallest value. In this article, we will sort the data from smallest to largest. Let's take sample data first! So this is a dat
Read More

How to Sort by the Last Name in Excel?

When you work on excel you'll probably be assigned a task to sort data alphabetically in ascending or descending order and it is quite an easy task to sort data using the first names in either of the order. It is the easiest task to be done in excel. But what if you are given a task to sort a list of names according to their last name in ascending or descending order. Quiet confusing, right?. This article will help you to understand the ways in which you can sort data according to the last name from the data set given to you in three ways by using built-in Microsoft Excel functions. Sort Using Flash FillFlash Fill is an addition to Microsoft Excel 2013 that will automatically fill your data when it senses a pattern. For example, Flash Fill can separate first and last names from a single column or combine first and last names from two different columns. Note: Flash Fill feature is added in MS Excel 2013 and it will be available in 2013 and later versions of excel. For Example: Step 1: Write the last name from the names given in the list to cell D1. Write at least 2 last names into column D. (as shown below). Step 2: Select both cells and hover the cursor over the bottom-right pa
Read More

A

How to Sort Subtotals in Excel

article_img
Sorting and adding subtotals is one of the features of Excel which is important for organizing and summarizing data in a structured manner. In this article, you will see the overview of Sorting and Adding Subtotals to Excel and then will discuss all the steps to perform, allowing you to take control of your datasets and derive valuable insights. What are Subtotals in Excel In Excel, the "Subtotal" is a function that calculates subtotals for a range of data based on a specified column. It's commonly used in large datasets to summarize data at different levels, such as groups or categories. The SUBTOTAL function can perform various aggregate functions like SUM, AVERAGE, COUNT, MAX, MIN, etc., and it automatically updates when the data changes. This function is helpful for creating organized reports or analyses, especially when dealing with extensive datasets. How to Sort Subtotals in Excel To arrange data based on subtotals, begin by inserting subtotals into the dataset. After you've added subtotals, you can sort the data while preserving its structure and ensuring that related data remains grouped together. For Example, You've the Following data: To group students and calculate subt
Read More

How to Sort Data in Excel: Easy Step by Step Process

article_img
Sorting data in Excel is a fundamental skill that can greatly enhance your data analysis capabilities. Whether you're dealing with a simple list or a complex dataset, knowing how to sort data in Excel can help you organize and make sense of your information quickly and efficiently. In this article, you will learn the easy, step-by-step process of sorting data in Excel. From basic alphabetical or numerical sorting to more advanced multi-level sorts, you'll learn how to manage your data like a pro. Know how to organize your data in Excel by using some sorting techniques. Microsoft Excel offers two widely used features: sorting and filtering. They are frequently used in data analysis to set up, organize, and subset your data according to particular criteria. You will discover how to sort data in Excel in this article. You will also get knowledge of data filtering. How to Sort Data in ExcelTable of Content What is Sorting in ExcelHow to Sort a Single Column in ExcelHow to Sort Multiple Columns in ExcelHow to Apply a Custom Sort in Excel Types of Filter in ExcelHow to Apply Filter in ExcelHow to Apply an Advanced Filter in ExcelWhat is Sorting in ExcelSorting is the process of arranging
Read More
three90RightbarBannerImg