Forum Discussion
How do I group multiple lines such that on Sort of the worksheet, the multiple lines stay together?
Hello All,
How do I group multiple lines such that on Sort of the worksheet, the multiple lines stay together?
Thanks in advance.
Andrew K
- NikolinoDEGold Contributor
Here is the step-by-step guide to grouping rows in Excel to keep them together when sorting the worksheet. This method works in all versions of Excel:
- Select the rows that you want to group. You can do this by either selecting the specific rows or by selecting the first row and holding the Shift key while selecting the last row of the group.
- In the Excel Ribbon, go to the "Data" tab (or "Home" tab in some versions) and locate the "Outline" or "Group" section.
- This will group the selected rows together, and a small plus sign (+) or minus sign (-) will appear next to the first row to indicate that it is grouped. Clicking on the plus sign will collapse the grouped rows, and clicking on the minus sign will expand them.
- Now, when you sort the worksheet, the grouped rows will stay together and move as a unit.
- To ungroup the rows, right-click on one of the grouped rows and choose "Ungroup" or "Ungroup Rows" from the context menu.
Note: When grouping rows in Excel, make sure that the rows you want to group are contiguous (i.e., they are immediately below each other). If they are not contiguous, you may need to move or copy the rows to be adjacent before grouping them.
You can also find the option to group rows on the "Data" tab in the Excel Ribbon. Select the rows you want to group, then click the "Group" button in the "Outline" or "Data Tools" group. Text and steps were edited with the help of AI.
- andrewwcteincCopper Contributor
- NikolinoDEGold Contributor
I'm glad I could help with your project.
I wish you continued success with Excel!
If this information helped you, please mark this post as "Correct answer" and/or click on Like button (hand with thumbs up), so that other members can see and benefit from this information later.
- marijtCopper Contributor
NikolinoDE any suggestion how to move the (+) Plus sign to the top of the grouped section? For some reason mine is appearing at the bottom.. Thanks!
- DimyzPlaceCopper Contributor
NikolinoDECan Excel group an entire spreadsheet by property number (cell A), so I don't have to group each property and its related entries individually? I have over 2,900+ properties with varying data that need to be grouped by their property numbers.