Grouping lets you collapse and expand rows or columns to focus on the data you need

Grouping in a spreadsheet hides or shows entire sections of rows or columns with a single click. Instead of scrolling through hundreds of line items, you can collapse them into one row, then expand only the sections you want to examine. Most spreadsheets — Excel, Google Sheets, LibreOffice Calc — have this feature built in, though the steps differ slightly between them.

Grouping works best when your data has a clear structure: months within a year, product categories within regions, or expense types within departments. The spreadsheet needs to see that structure before it can group. If your data is scattered randomly, grouping won't help — but if it's organized in blocks, grouping can turn a wall of numbers into something you can actually navigate.

Key Takeaways

  • Grouping hides or shows entire rows or columns at once, letting you focus on summary rows without scrolling past detail.
  • Your data must be organized in blocks — all January data together, all February data together — before grouping will work.
  • Excel and Google Sheets have grouping built in, but you access it through different menus and the steps are not identical.
  • Grouped data shows outline buttons (usually numbered 1, 2, 3) on the left or top edge that let you collapse or expand each section.
  • If grouping doesn't appear as an option, your data may be too scattered or you may need to sort it first.

How to group rows in Excel

Start by selecting the rows you want to group together. Click the row number on the left side of the first row in your group, then hold Shift and click the last row number in that group. All rows between them will highlight in blue.

With those rows selected, go to the Data tab at the top of the screen. Look for the Group button — it's usually in the middle of the ribbon, often with a small arrow next to it. Click it. Excel will draw a bracket on the left side of your selected rows and add a minus sign (−) button next to the bracket. Click that minus sign to collapse the group and hide those rows. Click the plus sign (+) that appears to expand them again.

Repeat this for each section you want to group. If you have monthly data, select all January rows and group them, then select all February rows and group those separately. Once you've grouped multiple sections, Excel adds outline buttons numbered 1, 2, 3 at the very top left. Click button 2 to show only the summary rows (the ones between groups). Click button 3 to show everything.

How to group rows in Google Sheets

Google Sheets grouping works the same way but lives in a different menu. Select your rows the same way: click the first row number, hold Shift, click the last row number. The rows will highlight.

Go to the Data menu at the top and select Group rows. A menu will pop up asking which rows to group — it should already show your selection. Click Group. Google Sheets adds a minus sign button on the left side. Click it to collapse the group. Click the plus sign to expand.

For multiple groups, repeat the process for each section. Google Sheets will add outline buttons on the left (usually showing 1, 2, 3, 4 depending on how many levels you've created). These work the same way as Excel: click 2 to show only the top level, click 3 to show two levels, and so on.

How to group columns instead of rows

Grouping columns works identically to grouping rows, except you select columns instead. Click the column letter at the top (A, B, C), then hold Shift and click the last column letter in your group. The columns will highlight.

In Excel, go to Data > Group. In Google Sheets, go to Data > Group columns. A bracket will appear above your selected columns with a minus sign button. Click it to hide those columns, click the plus sign to show them again.

Column grouping is useful when you have data organized by quarter (Q1 columns together, Q2 columns together) or by data type (all revenue columns together, all expense columns together). You can then collapse an entire quarter to see just the summary column, or collapse expense details to focus on revenue.

What to do if grouping isn't working

The most common reason grouping fails is that your data isn't organized in continuous blocks. If you have January data in rows 2–10, then a blank row, then February data in rows 12–20, grouping won't recognize the structure. Sort your data first so all related rows sit next to each other with no gaps.

Another reason is that you've selected non-consecutive rows. Grouping requires you to select rows that sit directly next to each other. If you need to group rows 2–5 and rows 10–15 separately, you must group them in two separate actions, not all at once.

If the Group button is grayed out or missing entirely, check that you're on the Data tab (Excel) or that you've selected at least two rows (both programs require a minimum selection). In Google Sheets, grouping only works on rows and columns, not on individual cells.

How to ungroup or remove grouping

To remove a group, select any row within that group and go to Data > Ungroup (Excel) or Data > Ungroup rows (Google Sheets). The bracket and buttons disappear, and all rows return to normal view.

If you have multiple groups and want to remove all of them at once, select all your data first (Ctrl+A or Cmd+A), then go to Data > Ungroup. Every group in the sheet will be removed. You can also click the outline buttons to collapse everything to level 1, then manually ungroup from there if you want to keep some groups and remove others.

When grouping makes sense and when it doesn't

Grouping shines when you have a summary row or column that sits at the end of each section. For example, if each month ends with a total row, you can group all the detail rows above it, then use the outline buttons to show only the monthly totals. This turns a 365-row spreadsheet into something you can scan in seconds.

Grouping is less useful if your data has no natural summary points or if you need to see all the detail all the time. It's also not the right tool if you need to filter data — use filtering instead if you want to show only rows that match certain criteria. Grouping is about organization and navigation, not about hiding data based on values.

Frequently Asked Questions

Can I group rows and columns at the same time?

Yes. Group your rows first, then group your columns. The outline buttons will appear on both the left (for rows) and the top (for columns), and you can collapse or expand each independently. This is useful for large tables where you want to focus on a specific region and time period at once.

What do the outline numbers (1, 2, 3) mean?

Each number represents a level of detail. Button 1 shows only the outermost structure (usually just summary rows). Button 2 shows one level deeper. Button 3 shows two levels deeper, and so on. The exact number of buttons depends on how many nested groups you've created. Click the number that matches the detail level you want to see.

Can I group non-consecutive rows?

No. Grouping requires rows to sit directly next to each other. If your data is scattered, sort it first so all related rows are together, then group. You can create multiple separate groups, but each group must be a continuous block.

Does grouping change my data or just hide it?

Grouping only hides rows or columns — it doesn't delete or move anything. When you collapse a group, the data is still there; it's just not visible. Expand the group again and everything reappears exactly as it was. Grouping is purely a viewing tool.

Will grouping work in LibreOffice Calc?

Yes. Select your rows, go to Data > Group and Outline > Group. LibreOffice works the same way as Excel, with brackets and outline buttons on the left. The menu path is slightly different, but the result is identical.