# SORT Function In Excel

In this post, you’ll learn about the SORT function in Excel and how you can use it in your excelsheet.

Entering a set of data in a sorted form is always preferred by everyone. Excel offers us a variety of sorting options. This post will give you some knowledge about the “SORT function in Excel”.

## Sorting in Excel

Arranging a set of data is “Sorting”. Changing the order of a set of data from Ascending to descending or from descending to ascending is “Sorting”, which can be done in Excel using various options. Excel offers a list of easy ways to sort the data. “SORT Function” is one among them. Let’s see how it works.

## SORT Function in Excel

Arranging a set of data is “Sorting.” For example, changing the order of a collection of data from Ascending to descending or descending to ascending is “Sorting,” which can be done in Excel using various options. Excel offers a list of easy ways to sort the data. “SORT Function” is one among them. Let’s see how it works.

## How does it work?

Here are some ways how the SORT Function works in Excel. it is explained with examples.

To sort data using the SORT Function, we require a syntax. The syntax works as a formula for sorting the data. The syntax is given below:

`=SORT(array,[short_index],[short_order],[by_col]`

After entering the required data in the columns, place the cursor on the particular column where you want the data to be entered by sorting.

When you decide on a particular column to paste the sorted data, place the cursor there and type “=SORT”. When you type so, you will get a list of options like, “sort_index”, “sort_order” etc.

Just type the syntax “=SORT (array)” (the array in the data is to be sorted). After typing “=SORT” just drag the required range of data that has to be sorted, the values will be entered automatically when you drag the range.

After this, just press enter and you will get the result as:

In this image, we can see that the “Name” column has been sorted in the “Sort 1” column in ascending order.

This is how the “SORT function” is used to sort the data in ascending order. Now let’s see how this function works for sorting the data in descending order. It is just the same way as used for ascending order. For ascending order we just dragged the data that has to be sorted and give entry. But as in for descending order, after dragging the data that has to be sorted give a comma. Type “-1”, which will sort the data in descending order.

Give enter and the result will be:

We can notice the “Country” column has been sorted in descending order in the “Sort 2” column. So the “SORT Function” provides a way to sort the data in descending order.

The SORT Function provides another way of sorting that is used to sort the data like first name and last name. Here are some examples of how it works.

There is no difference in the way of sorting except, there is a need for two columns, namely first name, and last name. Just in the same way which had been done in the above examples, type “=SORT” and drag & select the data that has to be sorted.

Give enter and we will get:

In this image, the name list had been sorted in ascending order. We can also do this in another way, by clicking on the “fx” in the formula bar that gives a dialogue box in which we can select the SORT Function in a list of option provided.

Hope this post was useful, and you got the information you needed. Thank you for reading.