# How to Use Excel SORT Function?

Excel SORT Function: When we handle huge data, there might be numerous entries stored in it. If they are stored unordered, then it is hard to arrange them in a specific order. Usually, we need to arrange the files or data in numerical or alphabetical order. So, that we can easily find the data we want from that huge entries. We all know there are many formulas and functions available in Excel that will reduce the manual tasks and complete them within seconds.

In case, you want to arrange your data in the Excel spreadsheet, we suggest you use the SORT function. It always arranges the text strings in alphabetical order and the numbers in ascending or descending order. In this article, we will describe how to use Excel SORT Function with its syntax, explanation, and example. Get an official version of MS Excel from the following link:

https://www.microsoft.com/en-in/microsoft-365/excel

## Description of SORT Function

• It is one of the built-in functions in Microsoft Excel.
• The SORT function sorts the input values of the range or array in ascending or descending order.
• It will sort the text strings in alphabetical order. This function always returns the dynamic array of results.

## Syntax

• Here, you will see the syntax of the SORT function.
• To apply this function on your spreadsheet, you have to select a cell and enter the formula in the following format.
• Once you enter the formula, just click on the button to get the result.

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

### Arguments Explanation

• Array – The input range to sort.
• sort_index – It is an optional one. The column index is used for sorting. Its default value is 1.
• sort_order – This option is also an optional one. Use 1 for ascending, and -1 for descending. By default, it will sort in ascending order.
• by_col – It is an optional one. Use the value TRUE to sort by column or FALSE to sort by row.

## Example

Here, we come up with a set of examples to explore how the SORT function works in the Excel worksheet.

• Initially, you have to open your Excel workbook on your PC and launch a worksheet that has data.
• In the below example image, you can see the input range in Column B. And, we will arrange them alphabetically using the SORT function.
• And, we have to apply the above-mentioned formula in a specific cell where you want to get the output and hit the  button.
• Once you have executed the formula, you will get the data in ascending order, as shown in the following image.
• Let’s see one more example to make it clear. In the following image, we have shown a range of numeric values, and they are neither in ascending nor descending order.
• We will arrange the values in descending order by using the below-mentioned formula. You need to execute the following formula and hit the button.

=SORT(B3:B7, 1, -1)

• Finally, you will get the output, as shown in the below screenshot.