Ravindra BagaleCourses & study guides मराठी Track your progress

6. Tables, Sorting and Filtering

Excel

6.9 Group and Outline

Open the details only when the question needs them

A shop lead opens a half-year report and wants to compare two stores. Three monthly columns per quarter make even a small worksheet wider than they need. On the next call, the same lead needs February’s value to check an unusual change. Separate files for monthly, quarterly and half-year views would give the team three copies to maintain. An outline lets them use the same report, starting from a compact view and opening the relevant details when they have a question.

In a worksheet, a group is a block of consecutive rows or columns whose visibility can be changed together. An outline is the collection of those groups and their controls. A minus button collapses an exposed group. A plus button expands a collapsed group. The level numbers let you show a similar depth of detail across multiple groups at once. Column controls appear above the grid. Row controls appear along the side where you read the row numbers.

Use the names and numbers here as practice only. The store plan belongs to fictional Konkan Fresh Mart and draws on examples from familiar grocery apps such as Blinkit. The second lab uses imaginary dispatch shift data in a scenario inspired by Swiggy. Neither workbook describes how those companies run their operations.

Choose the direction and scope deliberately

  • Group columns when parallel fields run left to right. In a planning sheet, you can group month details while keeping quarter totals available. The whole worksheet columns are affected, including any other tables that happen to use those column letters.
  • Group rows when successive records or summary sections run down the sheet. In a dispatch report, hide daily work details and keep the weekly totals visible. Read which row numbers the group covers before applying it. Other cells in those same rows also move out of view.
  • Nest a group when someone needs more than one depth of detail. A half-year view can contain two quarter groups. At the broadest depth, only the half-year total remains visible. At the next depth, the quarter totals appear. At the largest depth, the month values appear.
  • Keep adjacent blocks distinct. A summary field outside each detail block makes it easier to understand where one group ends and another begins. If you group all detail including their summary in a single block, the reader loses the exact cell they wanted to see when they collapse it.

Connect the number labels to the report design

The lower numbered outline levels show broader information. Higher levels show more detail. The actual fields visible at level 1 depend on what you left outside all groups. In a sheet with one group per quarter and no outer half-year group, the quarter summaries remain visible at level 1. In a sheet where the two quarter groups are inside a larger group, the quarter summaries may be inside the outer group. Level 1 then retains only the columns outside that outer boundary. Describe the visible fields by name rather than telling the reader that one level universally shows a grand total.

Microsoft documents worksheet outlines with up to eight levels. The examples use at most three. A report with too many levels can require the reader to expand several unrelated areas to find one value. Use enough levels to support the questions people actually ask. In the quarter sheet, reading half-year, quarter and month information maps cleanly to three depths.

Keep the mechanism separate from sort, filter and freeze

These actions solve different sheet-reading and calculation problems.
GoalChooseWhat happens
Hide or open a fixed block when neededOutline groupSelected row or column blocks expand and collapse.
Show records that meet a field conditionAutoFilterRows that fail the condition are temporarily hidden.
Keep an ID or heading visible while scrollingFreeze PanesThe chosen part of the worksheet stays in view as you scroll.
Insert an amount after each group of ordered recordsSubtotal commandNew summary rows and an outline are added to the report copy.

Manual Group works on blocks you select. It does not inspect a customer ID or sum values by category. That is why it is equally useful for grouping text notes, month columns or a line of calculations. The Subtotal command can create an outline while inserting new summary rows, as in the previous lesson. Manual Group can work with summary formulas already written by the report’s author. Sorting or filtering can be useful elsewhere in the workbook, but neither is required to build the static blocks in these labs.

Find the appropriate Group controls

In desktop Excel use the Group command on Data, normally in the Outline area. Select row numbers or column letters when you already know which axis to group. If your selection is only a cell rectangle, the Group dialog can ask whether it should group Rows or Columns. The full rows or columns across the worksheet are what will collapse. If a group includes the wrong axis, expand it and use Ungroup on the exact section before rebuilding it.

Microsoft also documents row and column grouping in Excel for the web. Use the Data grouping controls visible on your device for the manual labs. The interface and options can vary. An automatic outline based on existing formula layout, or settings for putting summaries to the left or above, should be done in a desktop client that exposes those commands. The lab uses the ordinary layout with column summaries on the right and row summaries below. The examples use ribbon controls so they do not depend on a particular keyboard layout or operating system shortcut.

Lab 1. Make a half-year report with expandable quarters

Create a blank worksheet named Stores in a practice workbook. Use numbers for the monthly rupee amounts, and put formulas in the quarter and half-year total columns. The longer version of the original two-store example introduces an outer group. Build the initial one-quarter group first so you can verify the boundary before creating both quarters and the wider outline.

Stores A1:J3. Enter the six month values. E, I and J are calculated separately for each store.
Store (A)Jan (B)Feb (C)Mar (D)Q1 (E)Apr (F)May (G)Jun (H)Q2 (I)H1 (J)
Kothrud420003950045200126700440004100046000131000257700
Baner380004120040100119300405004330042900126700246000

Set up the calculation before changing visibility

  1. Finish the formulas. In E2 enter =SUM(B2:D2). In I2 enter =SUM(F2:H2). In J2 enter =SUM(E2,I2). Copy each of the three formulas to the corresponding row 3 cell. Check the displayed results above. They represent all months, whether a particular group is collapsed or open.
  2. Try a group for the first quarter alone. Select column letters B through D and choose Data → Group. When you collapse that group, Jan, Feb and Mar disappear from view. Store and Q1 remain visible, as do the second-quarter fields that have not yet been grouped. Q1 should still say ₹126,700 for Kothrud and ₹119,300 for Baner.
  3. Restore and ungroup the trial block. Use the plus control above the group, and verify February values ₹39,500 and ₹41,200. With all three detail columns visible, select B:D and choose Ungroup. Check that the three month headers are present and the group control is gone. Its formulas and values remain in the same cells.
  4. Build the outer group. Group B:I so that both quarters’ fields and totals are inside it. Keep A and J outside. Leave the group expanded while selecting the inner ranges. Group B:D for Q1 and F:H for Q2. E and I are outside the month blocks and inside the outer group. This arrangement lets you choose all months, only quarter totals, or only half-year totals.
  5. Read the column letters when checking each level. Level 1 shows A and J, the store names and H1 values. Level 2 adds E and I. Level 3 also shows the months. If H1 disappears at level 1, verify you grouped through I and left J outside. If Q1 disappears at level 2, verify you grouped B:D in that inner block and left E outside it.
Level 1 shows Store and Half-year. Level 2 adds Q1 and Q2 totals. Level 3 also shows all six months.
The two quarter totals sit inside the half-year group but outside their own three-month blocks.

Reveal only the columns needed for the next question

  1. Compare the stores over six months

    Use the outer view. Store and H1 remain visible. The totals are ₹257,700 for Kothrud and ₹246,000 for Baner.

  2. Compare the two quarters

    Use level 2. Q1 and Q2 join the view. Kothrud shows ₹126,700 in Q1 and ₹131,000 in Q2.

  3. Open the first quarter detail

    Expand just the first month group using plus. Read the Kothrud February value of ₹39,500. Second-quarter months can remain collapsed.

  4. Expand the whole worksheet report

    Use the highest column level. Six month inputs, two quarter results and the H1 formula remain at their original addresses.

Verify that a hidden detail still feeds its formula

With both month groups collapsed, Kothrud’s Q1 is still ₹126,700 because SUM(B2:D2) continues to reference all three months. Temporarily expand B:D in this scratch copy and change Kothrud February from ₹39,500 to ₹40,500. Collapse the group and verify the Q1 result becomes ₹127,700 and H1 becomes ₹258,700. Restore the source value at the end. A disappearance from the screen does not change the data feeding the formulas.

The half-year formula adds two quarter totals. Using =SUM(B2:I2) would add the six month details and the two totals that already include those months. For Kothrud it would produce ₹515,400, twice the correct ₹257,700. This would happen even with the month columns collapsed. You can instead sum the six direct month cells using two ranges, =SUM(B2:D2,F2:H2). Verify that either correct approach agrees before deciding which series to show in the report.

Lab 2. Keep location totals visible while hiding shifts

On a fresh worksheet called Shifts, build an intentionally structured report. The eight shift rows are made-up data. All lines marked total are formulas, so do not paste their displayed numbers on top of the formulas when setting up the exercise. There is no separate sorting task because each detail block already sits within the region it belongs to. Check the exact references before grouping.

Enter Shifts A1:D16. Values in summary rows are expected formula results.
RowLocation (A)Report line (B)Orders (C)Handling min (D)
2EastMon shift1242
3EastTue shift1548
4EastWeek A total2790
5EastThu shift1039
6EastFri shift1445
7EastWeek B total2484
8EastLocation total51174
9WestMon shift832
10WestTue shift1143
11WestWeek A total1975
12WestThu shift1346
13WestFri shift1654
14WestWeek B total29100
15WestLocation total48175
16OverallTwo-location total99349

Build the formulas and verify the levels

  1. Keep the units clear. The order counts are numbers of orders. Handling min is a total number of staff minutes recorded for those orders. Put week totals in C4, C7, C11 and C14 using =SUM(C2:C3), =SUM(C5:C6), =SUM(C9:C10) and =SUM(C12:C13). Copy each formula one cell right into D for the handling-minute sum.
  2. Add the location and overall formulas. In C8 use =SUM(C4,C7). In C15 use =SUM(C11,C14). In C16 use =SUM(C8,C15). Copy these formulas one column right for D. The overall result is 99 orders and 349 minutes. Check those numbers against the eight individual shifts before making groups.
  3. Group the outer details. Select rows 2:7 and apply Group by Rows. Select rows 9:14 and apply it again. Level 1 should show rows 1, 8, 15 and 16 within the report. The heading, both location totals and overall total are always outside the collapsed groups.
  4. Group the four inner detail blocks. Expand all outer groups first. Add a separate group for each of 2:3, 5:6, 9:10 and 12:13. Week sums remain outside those four inner groups. With all four detail blocks collapsed at level 2, expect to see the header, four weekly totals, two location totals and the overall total. At level 3 read all eight shifts in addition to the other rows.
  5. Open one location without forcing the other open. Start at level 1, then use the plus control for East. Inspect its weekly results, and expand one of the inner groups to see its shift records. Follow the group bracket and summary position, especially where two group boundaries appear close together. West’s own total can stay in view with its details still collapsed.
Depth 1 shows East 51 orders, West 48 and overall 99. Depth 2 adds weekly results. Depth 3 adds eight shift rows.
Every deeper level adds a specific layer. The overall result still comes from the same orders and handling minutes.

Run a boundary test before handing over the outline

Imagine you include East row 8 in its outer group by selecting 2:8 instead of 2:7. Collapse that mistaken group and the 51-order total disappears with the details. On the correct sheet it stays visible. Check the row sequence at the two lowest levels to ensure totals remain outside the intended groups. If you build the mistaken group on a scratch copy, expand it and ungroup the exact block, verify the East total formula remains present, then rebuild 2:7.

Here is a separate formula reading check. Average handling time per order across the two locations is 349 minutes divided by 99 orders, about 3.53 minutes per order. It does not depend on which location is expanded. If the actual purpose is to compare the two locations, use the separate location totals: East is 174 divided by 51, about 3.41. West is 175 divided by 48, about 3.65. The worksheet group brings those bases together. Nothing in the outline recalculates the ratio from a new business population.

Try an automatic outline on a controlled copy

Some desktop clients offer Auto Outline under Data → Group. It looks for a consistent layout where existing summary formulas refer to nearby details. It is most straightforward to test this on the small original quarter layout. On a separate scratch tab copy Store, Jan, Feb, Mar and the Q1 formula. Keep Store in A, the months in B:D and Q1 in E. Ensure the two Q1 cells use =SUM(B2:D2) and =SUM(B3:D3), and remove any old grouping from this copy first.

  1. Use a desktop client with Auto Outline visible. Set the summary orientation so the summary column is on the right of its month detail. In a Windows ribbon layout this setting is in the Outline dialog. The control name and placement can differ on other clients.
  2. Run Auto Outline on the simple list. In this layout you expect a column group for B:D. Check the control above those columns and collapse once. Store and Q1 should stay visible. Then expand and check each month input. The formula results should look the same at both depths.
  3. If the outline is absent or different, inspect the formulas and summary placement. A total typed as a number provides no nearby SUM relationship to infer. A mixture of summaries to the left and right may also make the model ambiguous. On the scratch sheet you can still explicitly group B:D to demonstrate the intended result.

Excel does not infer the business meaning of a field named Quarter. It recognizes worksheet structure. A summary formula pointing to cells on another sheet can be useful for the report, but it may provide no useful nearby visible group on the current sheet. For a complex report with several imported calculation chains, build the group boundaries manually once you know what each summary represents.

Plan a wider report before adding more groups

Decide which summaries should appear at each depth

Suppose the grocery lead needs a full-year view with months available on demand. Copy the Stores exercise so you can plan the layout without changing the two-store lab. The first half already ends in J. Put July through September in K:M, Q3 total in N, October through December in O:Q, Q4 total in R, H2 in S and Year in T. Each quarter summary goes beside its own month cells. Each half-year summary stays outside the half-year detail block. The two halves together sit under Year.

  • Annual view. Keep A and T outside a new outer B:S group. Collapse it to show each store’s annual figure.
  • Half-year view. Within the outer group, make B:I and K:R the two half-year detail groups. Keep J and S outside their own half-year groups. The next depth can show H1 and H2 beside Year.
  • Quarter view. Keep E, I, N and R outside their own month groups. The four month groups are B:D, F:H, K:M and O:Q. This depth shows the four quarter totals along with the broader annual and half-year context.
  • Monthly detail. The highest depth includes all twelve month inputs and the calculated summary columns. The original month cells stay in the same places within this expanded copy.

Clear the existing groups after fully expanding them on the scratch copy. Recreate outer, middle and inner groups in that order according to the new plan. Write the labels you expect at each depth before selecting anything. If three summary columns vanish unexpectedly, the written plan lets you identify which boundary is wrong. This design also avoids putting a quarter summary directly inside the three-column group whose result it reports.

Verify the numbers before relying on the outline

For one trial, use only Kothrud. Give it six new monthly values of 47,000, 43,500, 46,500, 50,000, 48,000 and 49,000. Put =SUM(K2:M2) in N2, =SUM(O2:Q2) in R2, =SUM(N2,R2) in S2 and =SUM(J2,S2) in T2. Q3 totals ₹137,000 and Q4 totals ₹147,000. H2 is ₹284,000. With H1 at ₹257,700, the annual figure should be ₹541,700. Test it at the broadest level and again with the monthly detail open. The two answers should be equal.

Use =SUM(B2:D2,F2:H2,K2:M2,O2:Q2) in a separate verification cell to check just the twelve months. It should agree with Year. This independent source scope matters because the same sheet has several depths of measures. If you sum B through S without distinguishing detail and summaries, you count the months once as detail, once in quarter totals and once in half-year totals. For Kothrud that mistaken sum is ₹1,625,100. The larger number is a formula reference problem even if the outline is perfectly structured.

Keep the target beside the appropriate period

For a separate target check, suppose the practice quarterly plan for Kothrud is ₹130,000. At the quarter-summary level, Q1 falls ₹3,300 short and Q2 exceeds the plan by ₹1,000. The quarter comparison still holds when months are hidden. If the lead asks which month contributed least to Q1, open B:D and identify February at ₹39,500. A target placed in one of the grouped columns could disappear at exactly the moment the audience wants it. Keep a summary target on the same reading level as its actual result or put a clearly labeled comparison on a separate sheet. Before adding additional target columns into the expandable layout, draw the new positions and test the boundaries again. Inserting a column in the middle of an existing group is a structural change worth checking before a presentation.

Keep a small contract for an expandable report

Document the starting view and how a reader opens one period. For example, start at the annual view for review, open the half-year level to compare J and S and expand only the needed quarter for month questions. If someone uses a screen reader or printed copy, offer a flat summary with exact labeled fields as an alternative way to read the same report. The groups describe visual presentation, so a meaningful heading and independent value check still matter when outline symbols are unavailable.

Moving from a quarter view to a year view does not necessarily require all four levels. If the report’s actual readers never open quarters, an outer annual group and manual month-level sections may be simpler. If they need to compare two different years, put those years under explicit header labels or separate tabs so “July” always refers to a specified year. The important design decision is which summary a person should see before they open the more detailed block.

Reset or share an outlined sheet without losing context

Expand before removing a group

Collapse and Ungroup are different actions. Collapse keeps the group available and hides its detail. Ungroup removes selected outline structure. To remove only the Q1 month block from the column lab, expand all column levels first. Select precisely B:D and use Ungroup. Verify that B:D no longer has an individual month-level control while the rest of the intended outline remains. If you remove the outer structure afterward, again expand all levels and check the selected block. Keep a copy before changing a nested layout where readers already rely on known controls.

Use Clear Outline, where available through the Ungroup controls, when you want to remove every outline on the worksheet. Clear Outline does not delete the source or the existing summary formulas. If you remove an outline while rows or columns are hidden, they can remain hidden after the symbols are gone. That is why “no more plus buttons” and “all details visible” are separate checks. After clearing, check that the header letters are continuous in the worksheet region you need. Use Unhide Rows or Unhide Columns on the relevant range to restore remaining manual or previously collapsed visibility as appropriate.

Verify which cells actually arrive in an independent copy

A colleague asking for only Store, Q1, Q2 and H1 is asking for four visible columns. Level 2 of the column lab displays A, E, I and J, but values in B:D and F:H are still stored. In Windows desktop Excel, explicitly select visible cells only using Home → Find & Select → Go To Special before copying a block that contains hidden fields. Other desktop clients can expose a different path. Excel for the web does not provide this visible-only selection for an ordinary range. You can copy the four summary columns separately or type the verified summary values into an empty output. Check on the destination whether only four expected fields are present. To make a static handoff, paste values when the receiver does not need source formula references.

In a scratch output, check there are two records and that the four headings are followed by the expected cells. Kothrud shows 126,700, 131,000 and 257,700. Baner shows 119,300, 126,700 and 246,000. The half-year amounts across both stores add to 503,700. The screenshot or copied display of this outline is a report of the visible columns. A workbook containing the original hidden detail still includes those values. Use the independent copy when a recipient should receive only the four agreed fields.

Decide whether to export a report or preserve an expandable workbook

A report worksheet is useful when the reader wants to expand a month while keeping formulas. A static export is useful when the reader only needs checked summary values from a specific date. Save the original worksheet on the agreed starting level and name its summary columns so the reader knows how to open details. If you hand over a flat copy, give it a version label and verify it contains no extra detail columns. Treat these as separate choices before anyone adds another value to the workbook.

Troubleshoot one visibility problem at a time

  • The total disappears with the months. Check that Q1 is in E and the month group contains B:D alone. Expand, remove the wrong group on a scratch copy and recreate the boundary so the summary sits outside it.
  • A larger group opens but some details remain hidden. Inspect the inner controls. An inner month group may remain collapsed while the outer quarter totals show. Select the highest outline level if you need every outline detail open, and separately investigate any row or column still hidden for another reason.
  • A different block disappears elsewhere on the worksheet. Grouping a column changes visibility across that workbook sheet. Move independently viewed reports to their own tabs, or install the outline only on the report that needs it.
  • The values on another tab appear inconsistent with the visible overview. Check the formulas against the correct field addresses. A SUM that reads hidden detail can remain correct for an all-orders number, even while the report shows only its summary rows.
  • Records are hidden after clearing the outline. Check the sheet for other active filters and manual hides. Inspect the range around the missing row numbers or letters and unhide appropriate rows or columns. Review the original source count before concluding data was removed.
  • The controls show the wrong summary direction. Identify where the existing summary really sits. In a desktop client with Outline settings, set rows below or above and columns right or left to match your layout. This setting describes the outline’s summary location. It does not move your formulas to a new row or column by itself.

Quiz. Decide which cells should stay visible

Which columns should you group to reveal or conceal the Q1 months?

Group B:D. Those columns hold Jan, Feb and Mar. Keep column E outside so the Q1 amount stays visible when its month group collapses.

What does level 2 show in the nested Stores lab?

It adds Q1 and Q2 totals to the always visible Store and H1 columns. The month columns remain collapsed. Read A, E, I and J in the report.

Why does E2 still give ₹126,700 while February is hidden?

E2 sums B2:D2. Those three referenced amounts remain available to the formula while their columns are collapsed. The view does not remove the input from the calculation.

Which Shifts rows must remain outside the two outer detail groups?

Leave row 8, East’s total, and row 15, West’s total, outside their location groups. Also keep the header 1 and overall result 16 outside both. Group 2:7 and 9:14 to achieve that layout.

Why do you expand before selecting Clear Outline?

It makes the actual worksheet shape visible and avoids leaving details hidden when outline controls are removed. After clearing, confirm the expected rows and columns are visible. Use Unhide when a previous hide still applies.

What does Auto Outline need to recognize the Q1 detail block?

A formula in the summary field should reference nearby detail, with a consistent orientation. SUM over Jan through Mar, immediately to the right, expresses a useful pattern. A typed total alone does not identify which three values it summarizes.

Interview practice. Describe a report anyone can reopen

How does an outline differ from a filtered view?

An outline expands and collapses contiguous row or column blocks selected by the report author. Filtering decides which rows meet field conditions. A half-year report can use an outline to open detail months. An orders list can use a filter to show only selected city records.

How would you verify the nested half-year layout before sharing it?

Identify the intended visible headings at each level. The coarsest view has Store and H1. The next adds both quarter totals. The detailed view has all six months. Check a known February amount and verify the half-year result stays correct when a block collapses.

Why does summing every month and subtotal together double the half-year result?

Each quarter formula already adds its three months. A larger formula across B:I reads both those detail inputs and the two totals. Add the two quarter totals only, or read the six detail cells in two disjoint ranges. Confirm both routes agree.

How would you explain a missing group control above a column after ungrouping?

First determine whether the data is still hidden. Read the sequence of column letters and unhide the relevant range. Confirm the worksheet’s values and formulas before making a new group. A hidden column can remain in the workbook even after its outline control is gone.

What should be checked in a summary-only export?

Open the destination without hidden fields or filters. Verify its four headers, exact two store names, each amount and the combined half-year total. If the receiver expects a static snapshot, ensure the values do not depend on missing source formulas.

Revision cards

  • Group. Select consecutive full rows or columns to create a visible expand/collapse control.
  • Summary position. Place the summary outside the group it describes.
  • Levels. Lower shows broader results. Higher adds the available detail.
  • Formula scope. Collapsing a column does not remove it from an ordinary SUM.
  • Ungroup. Expand first, remove the selected structure and verify all intended detail is visible.
  • Handoff. Verify the destination includes only the fields intended for the reader.

Microsoft references