# How to Sort Rows in Google Sheets [Best Practice]

Key Takeaways: How to Sort Rows in Google Sheets

To Sort Rows in Google Sheets

2. Click on a cell where you want the sorted data to appear.
3. Enter the following formula: =TRANSPOSE((SORT(TRANSPOSE(B3:H3), 3, FALSE))) Press Enter, and your data will be sorted row-wise.

Mostly we don’t sort rows, the general sorting is made according to columns data and not for rows, when you try to select a row and apply a normal sorting function on it, you will see it will be messed up. This is because the sort functionality is designed for columns only. But we have a manual method, or we can say a custom formula to sort our row or multiple rows accurately without messing it up. So today we will talk about that custom formula in this article, let’s go ahead,

If you have your data points in horizontal order and you want to sort them, then you can use the transpose function. Transpose function is nothing but a function that flip rows into columns, after transposing we will trigger a sorting function and then again, a transpose function to reset our rows. All these processes will work automatically in the background we just need to set up a transpose formula with the sort function to get our rows sorted accurately.

Let’s move to some basics and then we’ll move towards the practical procedure to learn how to sort rows in google sheets.

How to Sort Pivot Table in Google Sheets (Best Practice)

## Use Cases of Sort Rows in Google Sheets

Sorting data is very important either the data is small or large, sometimes we need sort function very frequently, so we may use auto sort, other times we are supposed to use various sorting functions to keep our data organized and arranged properly. We all have done a basic sort in our life, and it works on columns, really? can’t we sort horizontally? can’t we sort our rows? Unfortunately, we don’t have any built-in feature for sorting rows, because sorting is itself design for columns, so here we have a small trick to sort our rows accurately, a double transpose function with a sort function in between. It is very simple than it sounds like. We need to learn this function to sort our data horizontally in the form of rows without any tedious work.

• To sort single or multiple rows
• To sort data horizontally in any order

## How to Sort Rows in Google Sheets

Step 1

Open any data set with google sheets.

Now we want to sort this data horizontally not vertically. That means, we need to perform sort by rows in this case in google sheets.

Step 2

Click any cell and start writing formula.

Step 3

Write down the Transpose and Sort formula completely.

=TRANSPOSE((SORT(TRANSPOSE(B3:H3),3,false)))

### TRANSPOSE function in Google Sheets

• Transpose is the name of function
• Inside transpose sort function will be executed
• After sort we will repeat transpose to to reset to the original data
• Data range
• Row number
• Is_acsending

Step 4

Hit Enter, and your data will be cloned with row-wise sorting.

## How to Lock Rows in Google Sheets for Sorting

Locking rows when sorting is very easy method, you can freeze the rows or columns of your choice when sorting, so for this specific task – how to lock rows, we will select the row to be locked and then we will go to view in the main menu and then freeze, now we will select an option to lock the rows, if you want to select a header row then select any column in that row and then go to view and freeze and then freeze up to row 1. This is so simple.

To recap, we learned how to sort rows in google sheets, it’s a very not one of the common features and many people have never used this feature and most of us have never realized that standard sorting functions are only implemented to columns, after this article you have learned many things, and of course the transpose and sort combination to sort rows accurately without any redundancy or duplications. Note that, you can set order in the formula true means ascending (A-Z) and false means descending (Z-A), row number is nothing but the number of the row you are sorting, and rest are self-explanatory.

## Notes

• Understand all the arguments of the function properly
• Use true or false or ascending or descending order
• Must mention row number. In example row number is 2
• Never sort rows directly, it will mess up your data