6. Tables, Sorting and Filtering
6.3 The Total Row
Put a summary at the bottom of the Table
A fictional dispatch report starts with ten orders and a total of ₹2,870. A teammate filters the order list to Pune and sees ₹544 in the bottom row. Another colleague asks whether money has disappeared from the worksheet. The answer depends on the formula in the bottom row. It can be a summary of the current view while the grand total still covers all ten records.
Use a new scratch copy of the chapter's Dispatch data for the first lab. The shops, amounts and service records are invented exercises inspired by Blinkit and Amazon Now. They do not describe real company results or internal processes. The separate pickup sheet in Lab 2 uses made-up values to explore missing numeric entries.
Recognize a Total Row as its own Table part
An Excel Table can contain a row of field names, several data records and a dedicated Total Row. That last row holds summary formulas or labels. It is not a new order or customer record. A plain named field reference, such as tblDispatch[Amount], reads the data without including the summary cell.
The Table's Total Row option displays this extra row near the data. You can choose an aggregation such as Sum or Average separately under each field. An aggregation turns several entries into one result. You can also enter a custom formula where an available default does not express the needed calculation. Inspect the formula bar so you know how that value is produced.
Turn on the Total Row and inspect each choice
- Click a cell inside your Table. Find the contextual Table design controls. On Windows builds, the control is usually under Table Design in the style options. On Mac, the Table or Table Design tab contains Table options. Microsoft's current instructions also show a Total Row option for Excel for the web.
- Enable Total Row. Look for the new summary row at the bottom. Some cells may be empty or have a default or remembered summary. Verify the contents instead of assuming every column gets a Sum.
- Select the Total Row cell beneath the field you need to summarize. Use the menu there to choose the aggregation. Pick Sum for Amount, Average for elapsed minutes, and Count for populated order identifiers. Confirm that the selected function counts text IDs if this field has them.
- Select the generated result and inspect the formula bar. In Microsoft's documented example, choosing Sum creates a structured
SUBTOTAL(109,...)formula. The 109 code specifies a sum that excludes filtered-out and manually hidden rows. Read the actual formula from your client.
Read the function number as two choices
The number first specifies the operation, such as Sum, Count or Average. It also chooses how manually hidden rows are treated. Both variants drop rows excluded by a filter. An ordinary sum without SUBTOTAL still reads its referenced numeric data regardless of that filter. Choose one calculation and test it against a view you can verify by hand.
| Operation | Includes manually hidden | Excludes manually hidden | Typical field |
|---|---|---|---|
| Sum | 9 | 109 | Numeric order amount |
| Average | 1 | 101 | Numeric elapsed minutes |
| Count numbers | 2 | 102 | Recorded numeric durations |
| Count occupied cells | 3 | 103 | Populated text order IDs |
For a familiar dropdown result, you might see =SUBTOTAL(109,[Amount]) inside the Table. The bracketed Amount field names its data. On a separate report tab, use the full Table name in the reference. The summary row cannot serve as evidence about its population unless you know which code and which field it actually uses.
Lab 1 · Compare totals before and after selecting a group
Use the ten original Dispatch orders in a new workbook copy. Create tblDispatch from A1:I11 with the existing labels. Enable the Total Row. Arrange a summary tab called Checks for external comparisons, so its cells remain visible while you filter rows on Dispatch.
Build three summaries within the Total Row
- In the Amount Total Row cell choose Sum, or enter the Table subtotal using function number 109 if your client provides the corresponding formula feature. All rows start visible. Confirm ₹2,870.
- In the Mins summary cell choose Average and check its function number. The visible average with manually hidden rows excluded uses 101. With all ten recorded times visible, the expected result is 12.8 minutes.
- In the Order ID summary use Count of occupied entries. Verify by inspecting its function number or choosing
=SUBTOTAL(103,[Order ID])in the Total Row. These IDs are text, so a formula counting only numbers would give zero. The expected count is ten before filtering. - On Checks compute
=SUM(tblDispatch[Amount])and=COUNT(tblDispatch[Mins]). These all-row controls give ₹2,870 and ten. They will help you spot when a lower amount is simply a view change.
Check the filters one at a time
- Filter City to Pune. Its visible amounts come from rows ordinarily identified as BLK-1001, AMN-1003, BLK-1006 and BLK-1009. Their four amounts sum to ₹544. Their four times sum to 44, averaging 11.
- With Pune active, filter Status to Delivered. The cancelled Pune order of ₹220 and thirteen minutes disappears from the visible results. The three remaining amounts total ₹324, their three times total 31, and their mean is about 10.33. Verify the all-row sum still shows ₹2,870.
- Clear City and Status. Filter Platform to Blinkit alone. The seven matching orders total ₹2,333 and have an average of about 12.57 minutes. Then switch Platform to Amazon Now alone. The three matching orders total ₹537 and average about 13.33 minutes.
- Clear Platform. Confirm the original totals and counts in the all-visible state. A filter changes the view. The data range and numeric entries remain available as the controls confirm.
| Table view | Visible Amount (₹) | Average Mins | Visible IDs |
|---|---|---|---|
| All | 2870 | 12.80 | 10 |
| Pune | 544 | 11.00 | 4 |
| Pune and Delivered | 324 | 10.33 | 3 |
| Blinkit | 2333 | 12.57 | 7 |
| Amazon Now | 537 | 13.33 | 3 |
Trace which order amount leaves the subtotal
Read the starting Total Row
With all ten orders visible, the amount subtotal and the all-row sum both give ₹2,870. The visible ID count is ten.
Filter to Pune
Four Pune orders remain visible. Their subtotal is ₹544 and their average time is eleven minutes.
Add the Delivered filter
The ₹220 cancelled order is now hidden, leaving ₹324 and three IDs. The all-row sum on Checks remains ₹2,870.
Restore the full view
Clear the city and status filters. The subtotal returns to ₹2,870. Verify the ₹220 order is back in view.
Distinguish filter-hidden and manually hidden records
With only the City filter set to Pune, the four matching orders total ₹544. Leave that filter on and, in a scratch workbook, manually hide the actual worksheet row containing AMN-1003. This is the order with amount ₹110 and fourteen elapsed minutes. Use the row hide control, rather than a second condition in the Table filter.
- The 109 amount subtotal now gives ₹434. If your count uses 103, three IDs remain. A 101 average gives ten minutes, because the other three timings are nine, eight and thirteen.
- In a separate check cell use
=SUBTOTAL(9,tblDispatch[Amount]). It gives ₹544. The other cities excluded by AutoFilter do not contribute. The manually hidden Pune amount still contributes for function number 9. - Compare the ordinary
=SUM(tblDispatch[Amount]). It still gives ₹2,870 because all the original table data remains in the reference. This is the grand comparison, independent of the current visibility of the order. - Clear the filters and make all the original rows visible again. Confirm the expected baseline count and totals. The experiment changes row visibility only.
Use this difference when choosing a reporting policy. A teammate may hide a row temporarily while studying the report. If the amount must change with everything a viewer hides, 109 is appropriate for a sum. If the grand amount must always be reproducible regardless of visible rows, keep its ordinary structured reference and label it accordingly.
Lab 2 · Keep an order count and a timing count side by side
A fictional Swiggy-inspired pickup sheet has some orders with measured transfer times and one delivered order waiting for a timing update. A summary that counts all delivered orders should count that row. An average should use only eligible numeric times. Make both choices visible in the Total Row or in a separate view check.
On a new tab named Pickup, create headers in A1 through F1 as shown. The fixture intentionally uses a verified numeric zero on one record and a truly empty cell on another. The zero represents a valid recorded value for this classroom measure. Use a scratch worksheet so unexpected results can be investigated without changing a live report.
| A Order ID | B City | C Qty | D Amount | E Mins | F Status |
|---|---|---|---|---|---|
| PU-001 | Pune | 2 | 60 | 6 | Delivered |
| PU-002 | Nashik | 3 | 120 | 0 | Delivered |
| PU-003 | Pune | 1 | 80 | Leave empty | Delivered |
| PU-004 | Nashik | 2 | 160 | 12 | Cancelled |
Choose three fields for different kinds of evidence
- Create a Table named
tblPickupover A1:F5. Enable its Total Row. Use a 103 subtotal beneath Order ID, a 109 subtotal beneath Amount and a 101 subtotal beneath Mins. - All four orders are visible to start. Verify four IDs and ₹420. The three numeric durations are six, zero and twelve; together they sum to eighteen and average to six.
- Set the Status filter to Delivered. The ID count becomes three and the Amount subtotal becomes ₹260. The measured durations in that view are six and zero. Their mean is three minutes. The missing duration is a separate input state, so it does not increase the numeric denominator.
- In a separate worksheet cell use
=SUBTOTAL(102,tblPickup[Mins]). It gives two numeric minutes entries. Compare this with the visible ID subtotal of three. Show both measures next to the average so a reader knows how many orders were actually measured. - With Delivered still active, filter City to Pune. Two matching IDs remain, with a visible amount of ₹140. Only one of their durations is recorded, six minutes. The average is six and the numeric timing count is one.
Verify a missing value without inventing a timing
In the filtered Pune group, give the missing timing a verified value of twelve for a practice variation. There are still two delivered Pune orders, amount ₹140, and now two numeric timings. The mean becomes nine. Restore the missing entry afterward. Only timing coverage and its average should change. The amount and the population of visible orders should stay the same.
When you handle the original data, leave the missing field empty until a source supplies the measurement. Typing zero to make a report appear complete would supply a real numeric value to the denominator and change its meaning. If someone needs a completeness measure, show numeric timing count compared against the number of eligible order records.
Write a custom summary when a dropdown cannot express the rule
Keep tblPickup from Lab 2 and clear the City filter while leaving Delivered. Suppose a teammate needs amount per listed unit in the visible view. Calculate it as the visible amount divided by visible quantity. Summing the three amounts gives ₹260. Their quantities are two, three and one, adding to six. Under the fictional definition, the result is about ₹43.33 per listed unit.
Build and audit the two pieces separately
- Use
=SUBTOTAL(109,tblPickup[Qty])on the checks tab or select a Sum in the Qty Total Row cell. Verify six visible units. Counting three visible IDs would answer a different question. - Use
=SUBTOTAL(109,tblPickup[Amount])and verify 260. Both source columns describe the same table rows and use the same visibility rule. - Divide one by the other in a labeled summary cell. If there are no visible units, the ratio has no numeric result under this definition. An explicit condition can show the text No visible units. Keep the amount and quantity subtotal cells easy to examine.
=IF(SUBTOTAL(109,tblPickup[Qty])=0,"No visible units",SUBTOTAL(109,tblPickup[Amount])/SUBTOTAL(109,tblPickup[Qty]))
On the original active Delivered view that returns about ₹43.33. If you isolate Delivered Pune, the amount is 140 and the quantity is three, or about ₹46.67 per unit. A report with a helper label for two measures makes it possible to see which values changed when you add the city choice.
You can place a custom result in an appropriate Total Row cell when that layout helps readers. The row itself does not decide which records the expression should use. If a custom calculation contains an ordinary SUM, it can ignore filter visibility by design. Name it clearly and test a filter before presenting it as a visible-only measure.
Add a new record without using the summary row as data
The Total Row belongs to the Table, and it occupies a separate position after the data. A new order belongs in the body. If you paste data into a summary row, you can overwrite the calculations instead of extending the list. Pick a supported insertion or resize method and verify where the row landed.
Run a controlled append in Pickup
- Return to the original four pickup orders and clear filters. Verify the missing timing on PU-003 is still empty. Note the formulas in the existing Total Row before changing its display.
- On a disposable copy, toggle the Total Row off temporarily. This makes the original end of the data easy to inspect. Enter PU-005, Pune, quantity four, amount 200, ten minutes and Delivered into the next data row. Confirm that row joined tblPickup. If needed, explicitly expand the Table over the new row.
- Turn the Total Row on again. Microsoft documents that it can remember the earlier formulas when toggled. Inspect the actual restored results. If a cell is empty or no longer uses the intended function, set that summary again. The Total Row should occupy the row below the five data records, and its summaries should refer to the body.
- Verify ₹620 and five IDs for the all-visible state. Four numeric times are now six, zero, twelve and ten. Their mean is seven. If the average uses the total record count as the denominator, it would answer a different question.
- Filter Status to Delivered. The visible amount is now ₹460, with four order IDs and three numeric times. The mean is sixteen divided by three, or about 5.33 minutes. The ratio of visible amount to units is ₹46 because the delivered quantities sum to ten.
This append recreates an important test for repeated reporting. The body gains one record and the Total Row still describes the view. The grand and selected summaries must now both account for the new data where relevant. Keep a separate reference to the four-record baseline so you can explain the changed measures.
Interpret an empty view differently from a real zero
On a scratch copy of the original pickup table, use a numerical amount filter greater than 1,000. None of the four rows has that amount. The visible ID count is zero and the visible sum is zero. An average of the displayed numeric times has no observations to divide by. If the result represents a report on an empty group, a separate explanatory label can be more useful than a guessed average.
Use a direct check for the denominator. For this lesson it is a count of visible numeric time entries. Show No visible numeric timings when that count is zero. Otherwise, compute the visible average according to the selected policy. This condition handles an expected empty group without discarding evidence of unrelated workbook defects.
=IF(SUBTOTAL(102,tblPickup[Mins])=0,"No visible numeric timings",SUBTOTAL(101,tblPickup[Mins]))
Clear the amount filter and keep only Delivered Nashik. PU-002 has a numeric timing of zero and one measured record. The formula now returns a numeric zero, which is a meaningful observed average in the exercise. The previous result was a text message because the number of observed timings was zero. Test both cases when a zero could otherwise be ambiguous.
Combine group measurements with their correct counts
When one reader joins two views into a single report, keep the numbers and their populations together. Two platform totals can be combined by addition when the corresponding order groups are disjoint and complete. Two averages require more information. Their per-group denominators are often different. Use the matching count and amount for each group before creating a combined result.
Try the pickup timing variation where PU-003 has been measured at twelve minutes. In the Delivered Pune view the two measured times are six and twelve and their mean is nine. In the Delivered Nashik view one time is zero and the mean is zero. Taking the ordinary average of those two displayed averages would give 4.5 minutes. The per-order combined mean is the sum of all three recorded times divided by three, or six minutes.
Recognize what is safe to add
- Sum a group count and another group count only when they describe disjoint selections of the same kind of records. One order counted twice will change the combined population.
- To combine means over measured orders, use the group's sum of durations and measured count. A count of all IDs and a count of numeric timings may differ.
- Keep the working precision available. A displayed decimal rounded for readability may contain less precision than the numeric result used to compute a combined summary.
- If a table has several subtotal lines outside its body, check whether another formula would include already summarized values along with the individual records. That can double-count results. An ordinary data-only Table reference helps define the correct source.
Check a formula that was copied across the summary row
On the original four-order Pickup fixture, put Sum beneath Qty and Sum beneath Amount. They both use a 109 subtotal, but pull different fields. With all rows visible, Qty equals eight and Amount equals ₹420. In a scratch copy, use this easy contrast to see what a normal formula copy and a horizontal fill do.
- Record the displayed Qty formula and its result. If it was inserted from the menu, it may read
=SUBTOTAL(109,[Qty])in the Total Row. Confirm that the data result is eight units. - In the scratch copy, copy that Total Row formula and paste it over the next Total Row cell beneath Amount. Microsoft documents that normal copy and paste can keep the original structured column reference. When it still names Qty, it shows eight under a rupee column. Restore the correct Amount formula afterward.
- If your client exposes the documented fill handle, try dragging the Qty formula one column right instead. The Total Row instructions describe adjusting the structured column reference when using this fill action. Inspect whether the result now names Amount and returns ₹420.
- If the actions are unavailable or behave differently in your client, choose Sum separately from the dropdowns or type the two references explicitly, and verify eight and ₹420. The crucial step is to establish which column the expression reads after you put it in place.
Look for the same issue in custom formulas. A result in the right worksheet cell can still read the wrong structured field. Check both the label and the expression, especially when Qty and Amount are adjacent and each returns a valid numeric total.
Distinguish the Total Row from other summary layouts
A summary attached to an active Table
The Total Row provides one place to show selected calculations for that Table. It can respond to the current view when its formulas use the appropriate SUBTOTAL variants. It can also hold a custom measure when the report requires it. A Total Row by itself does not create a separate breakdown for all cities simultaneously.
Group totals alongside individual records
The worksheet Subtotal command produces summary rows within a normal range at changes in a chosen field. Sorting records by that field first helps keep one group together. It can also add an outline so readers can collapse the details. Use the dedicated Subtotal command lesson for that layout. Keeping a structured source separate can be useful when the main workbook still needs a growing Table.
An external report with a fixed group
A formula using SUMIFS can show a particular city even when the view is set to a different city. On Dispatch, test Pune delivered as a fixed ₹324 beside a currently visible subtotal. Switch the active City filter to Nashik and remove other conditions if needed. The fixed Pune result remains ₹324. Based on the original table's two Nashik orders, the newly visible amount is ₹360. The two figures refer to different groups and can both be useful.
When a colleague needs a side-by-side count for each city, use an explicit summary area, a suitable PivotTable or another grouping method later in the course. Give the view-dependent Total Row one job. Keep the group report's definition where a reader can inspect it.
Review a Total Row before sending a screenshot or workbook
A view may look complete in a cropped image even when filters remain active. A bottom row showing ₹544 can be correct for Pune and misleading if it is forwarded as yesterday's gross. Check the dataset, filter state, formula and heading as a unit. Preserve enough context for the intended reader to interpret the value.
- Check which row you selected. The last data row and the Total Row have different roles. A pasted source value can overwrite the latter. Confirm new records and verify the final summary cell.
- Check the named fields. A count under Order ID should count occupied text IDs. A count under Mins intended for measurement coverage should count numeric values. A report can include both if the source has missing durations.
- Check the filter icons and hidden rows. Read each active filter and note any manually hidden rows. The reported 109 sum can differ from a 9 sum because of a manual hide even when the filter selections match.
- Check the full-column controls. Show the independent grand amount on a separate tab. If the visible total changes and the full-column sum changes unexpectedly, verify whether the dataset itself changed at the same time.
- Check the labels and types. Name a rupee amount, number of IDs and elapsed time explicitly. If no numeric timings are eligible, decide how to report that state rather than presenting it as a measured zero.
For a handoff test, ask the next learner to create the original Pune view and then clear it. They should reproduce ₹544 and ₹2,870. If they cannot, compare the actual formulas and active filters before revising the exercise. A short workflow note with an expected numeric result makes this easier to verify than an unlabeled image.
Check what a saved group summary can reproduce
Suppose a fictional classroom manager wants yesterday's Pune report saved beside today's changing Table. Decide whether the number should always recalculate from the full current workbook, follow the current selected view, or retain yesterday's checked result. A copied formula that still refers to the working Table may change when records are appended. A dated, values-only snapshot can preserve the previously approved figures, while the source workbook keeps the calculations used to produce them.
Record the measure, filter and source together
- Set the known original workbook to Pune and Delivered. Record three visible IDs, ₹324 and about 10.33 elapsed minutes. Give each number a label that includes its unit. Write the two filter conditions on the same saved report.
- On a different scratch tab record the separate grand source amount of ₹2,870 and source count of ten. If you save the filtered value alone, the recipient needs a way to tell it describes a subset. The grand comparison gives a clear cross-check.
- Clear the view and verify its Total Row returns to its full-group readings. The approved snapshot should still show the prior three-row group if you saved those results as values in a separate copy. A formula link would have different behavior.
- To make a living Pune-delivered figure, keep a formula with explicit criteria instead. It stays at ₹324 when the filter state alone changes and can respond to a verified new matching order. Show the three types of report in separate, carefully labeled cells.
Preserve a documented test for a changed record as well as a changed view. A new delivered Pune order of ₹367 should raise the relevant fixed-criteria figure to ₹691 once it belongs to the Table. If the sheet is currently filtered to another city, its visible subtotal does not answer that same question. The formula, dataset version and report context tell the next person what changed.
When reading the result back, ask which statement a reader could make responsibly. “The visible list contains three original delivered Pune orders” follows from the fixture. “The company made ₹324 across every order” would misuse the population and the practice data. Exact Excel arithmetic still depends on accurate descriptions of what the result represents.
Keep a short record of the report's calculations, especially if more than one Total Row cell uses a custom formula. A label beside the saved measurement can state that manually hidden rows were excluded. The reader can then understand the discrepancy if an ordinary group SUMIFS includes those rows when they reproduce the report.
Quiz · identify what the bottom row measures
What does filtering Dispatch to Pune do to a 109 total and an ordinary structured SUM?
The subtotal becomes ₹544 because it follows the included view. The structured SUM stays ₹2,870 because it references all original Amount data. The filter leaves the records stored in the Table.
What stays in the 9 subtotal when the ₹110 Pune order is manually hidden?
The manually hidden amount remains included, so the 9 subtotal stays ₹544. A 109 subtotal excludes that row and gives ₹434. Both ignore the other cities filtered out.
Which subtotal count should you use for populated text order IDs?
Use the occupied-cell count, such as 103 when manually hidden rows should be excluded. A numeric count like 102 would ignore the text IDs. Verify that there is one nonempty ID for each record.
Why are there three delivered pickup orders but only two numeric timings?
One delivered record has an empty timing cell. Zero on the other record is an actual number and counts as an observation. The average is six plus zero divided by two, giving three minutes.
Does enabling the Total Row make every formula follow filters?
The selected formula defines the behavior. A default SUBTOTAL can respond to visibility. A custom ordinary SUM describes all selected data regardless of the view. Check the formula itself.
When should an average result show a message for no data?
When the numeric observations in the intended view are absent. Check the numeric count. A valid observed time of zero should still produce a numeric zero when it is the only eligible measurement.
Interview practice · prove the visible total
How does a Total Row differ from an ordinary worksheet summary cell?
It is a dedicated part of an Excel Table with per-column summary choices. An external cell can use the same kinds of functions, but it occupies a separate area. I would show the filter-responsive Table result and a grand all-row result together when both matter.
How would you verify a Total Row when adding new data?
I would make sure an added record joined the table's data body, then inspect the Total Row formulas and expected change. In the Pickup fixture, adding PU-005 raises the all-visible amount from ₹420 to ₹620 and adds one visible ID.
Why would you count numeric timings separately from order IDs?
An order can exist without a measured time. The ID count tells me the population of records. The numeric count tells me the observations the average can use. I would show both when coverage is incomplete.
How would you check an unexpected low subtotal?
I would look at active filters, manually hidden rows, the function number and the amount field. Then I would compare one expected group and the all-row control. This helps distinguish a legitimate narrower view from a formula or membership defect.
What would you check before reporting amount per visible unit?
I would use the same visibility policy for both source measures, sum the eligible amounts and quantities, and verify the denominator is nonzero. I would test one known filter and an empty group separately.
Six cards for a Total Row check
- Summary part The Total Row belongs after the data rows. Named data-column references leave it out.
- Formula Verify the selected calculation under each field. The row can display an ordinary sum, a subtotal or a custom result.
- Visibility Both subtotal numbering groups exclude filtered rows. The high-number group also excludes manually hidden rows.
- Counts Count text IDs as occupied cells and measured numeric times as numbers. Report either count with its unit.
- Append Make sure a new record joined the body and verify that the Total Row moved to the proper position.
- Proof Compare an all-row amount, a visible subtotal and a known record group before sharing.
Continue with multi-level and custom sorting. The SUBTOTAL and AGGREGATE lesson goes deeper into visibility, error handling and nested summaries.
Microsoft references
Continue practising: explore the existing Excel Task Hub for additional exercises.