This tutorial demonstrates how to keep rows together during a sort in Excel and Google Sheets.
Sort and Keep Rows Together
When sorting data by a column in Excel, you must expand the selection to keep rows together. In this example, you have data in Columns B–G, and you want to sort it by Total Sales (Column G) from largest to smallest.
- Select Column G (click on the letter G in the column heading). Then in the Ribbon, go to Home > Sort & Filter > Sort Largest to Smallest.
- In the Sort Warning window, select Expand the selection, and click Sort.
Sort and Keep Rows Together in Google Sheets
- Select the data range you want to sort (B2:G9), and go to Data > Sort range.
- In the pop-up window, check Data has header row, choose Total Sales under the Sort by menu, select Z → A, and click Sort.
Now the data range is sorted by descending Total Sales, with all rows kept together.