6. Tables, Sorting and Filtering
6.10 Range vs Excel Table
Decide how the shape of a workbook should grow
The lesson starts with five grocery orders that total ₹916. A sixth comes in worth ₹150. On one workbook tab the new row appears directly below the existing records, but the total stays at ₹916. On another tab the same new order is a member of an Excel Table, and a total using the named Amount column becomes ₹1,066. Both arithmetic operations added the numbers they were given. The difference is how each reference decides which cells belong to the source.
A range is a selection of worksheet cells. A reference like D2:D6 identifies a particular sheet region. An Excel Table is a workbook object associated with its own rectangle, named fields and particular controls. Both store cells on a worksheet. A Table gives Excel additional information about which row is a header, which cells are data rows, and whether the list includes a special Total Row. Creating a Table changes that structure. Applying a fill color or a border to a range changes how it looks.
The order figures continue the imaginary source introduced in Chapter 3, inspired by grocery shopping experiences from Blinkit and Amazon Now. The second lab uses a separate media watch log inspired by Netflix. All records, times and reporting requirements are made up. Focus on exactly which records the worksheet and its reports include after an update.
Compare what you can do with both structures
Both structures can hold a clean list with one order per row. Both can be sorted and filtered. A flat range typically uses cell addresses such as D2:D6 in formulas. It can also use a defined name, which may refer to a fixed or dynamic source according to its definition. A Table normally gives you a name such as tblOrders and column references such as tblOrders[Amount]. Those names identify the Table and its current data field rather than forcing you to remember a column letter.
| Decision | Normal range | Excel Table |
|---|---|---|
| Record boundary | An address or defined name supplies the source shape. | A named object supplies a header, data body and optional summary. |
| Routine filters | Add a header filter to the rectangular list. | Header filters are available as part of the Table. |
| Per-row formula | Enter one formula and fill the intended rows. | Calculated-column behavior can fill the rule across Table rows. |
| Whole list total | Write a formula over the intended range. | Use a structured formula or enable the built-in Total Row. |
| New records | A fixed reference may need extension; check the destination source. | Structured references follow the new size after actual Table expansion. |
| Several outputs from one formula | Use free grid cells with a supported dynamic array formula. | Use the Table as source and place the spilling formula outside it. |
Use the source’s business role to choose
- Growing delivery list. An Excel Table is a sensible source because its columns have consistent meanings and new records can become members. Verify the table’s name, boundaries and the fields used by the reports.
- Frozen five-record comparison. A deliberate fixed range may be right when you are teaching with an original cohort and want to compare it with later records. Give it a precise label. A dynamic reference would change the cohort every time you appended another row.
- Presentation template. A receipt or printable form can use a layout-oriented range with titles, spaces and individually arranged formulas. Keep its inputs in their record source. Reference those values from the output form rather than forcing every visible title and printed note into a Table.
- Growing source and separate results. Use the Table for records and reserve grid space for an output that changes shape. The same file can contain a growing data object and a fixed presentation worksheet, each doing the job it is suited to.
Identify the structure with its controls
Click inside a colored list. If the client shows Table-specific controls, check its actual name and size. A copied Table’s colors can remain after conversion to a range. Likewise, a normal range can receive filter arrows through Data → Filter. Neither banded colors nor filter arrows alone prove there is an Excel Table. Use the feature controls and test the reference on a scratch sheet.
Use the worksheet view controls when the reader must keep particular labels in sight during a long scroll. Table field names support formula references and filter menus, and the workbook still needs a suitable reading layout. If the whole worksheet needs certain rows or columns to stay in view, choose an explicit Freeze Panes layout and check it separately. Neither header behavior guarantees the selected record block has the right boundary.
Lab 1. Compare one new order in two equivalent worksheets
Set up a practice workbook with RangeOrders, TableOrders and Check tabs. Use the same data on both order sheets, in A1:D6. Keep the summary formulas on Check so the test does not accidentally type something beneath the Table or inside a filter range. These five order IDs should appear once each on both tabs.
| Order ID | City | Qty | Amount |
|---|---|---|---|
| BLK-1001 | Pune | 2 | 64 |
| BLK-1002 | Nashik | 3 | 270 |
| AMN-1003 | Pune | 1 | 110 |
| BLK-1004 | Nagpur | 2 | 240 |
| AMN-1005 | Kolhapur | 4 | 232 |
Test a reference before and after conversion
- Write the existing controls first. In Check enter
=SUM(RangeOrders!D2:D6)and=SUM(TableOrders!D2:D6)into two cells. Both return ₹916. The number 6 is a boundary in each formula. Make a note of the formulas before creating the Table. - Create the Table on one tab. In TableOrders select A1:D6, then choose Insert → Table. Confirm headers. Where supported, name it
tblOrdersvia its Table controls. If that name is already used, choosetblRangeTestOrdersand update formulas that refer to it. The ordinary range on RangeOrders remains unchanged. - Add a structured control. In a third Check cell use
=SUM(tblOrders[Amount]). The new formula also returns ₹916. Conversion does not rewrite an existing A1 reference into a structured reference automatically. Open the second formula and verify it still points to its original explicitly bounded cells. - Append an identical order on both tabs. Keep the Table Total Row off for this step. Type the following values in A7:D7 on both order sheets: BLK-1006, Pune, 5, 150. Verify TableOrders has six actual Table data rows, for example by checking its address in Resize Table where supported. If it stayed a five-row Table, resize it deliberately to include A7:D7 and check again.
- Read the three count and amount outcomes. Both fixed formulas still read ₹916 because D7 is outside their references. The structured sum reads ₹1,066.
=COUNTA(tblOrders[Order ID])should return 6. Use an independent manual check by adding the six amounts so you can tell whether the correct number from the source actually reached the result.
Follow a new member through the workbook
Start with two displays of the same list
There are five source orders and ₹916 on each worksheet.
Create a named Table on one sheet
The new structured sum still gives ₹916. Existing fixed references are still ordinary formulas.
Append ₹150 as a verified Table member
The named Amount field now sums to ₹1,066. The fixed five-row amount does not change.
Turn on the Total Row and choose a view
It gives ₹1,066 with no filter or manual hide. A Pune filter makes it summarize the three visible Pune amounts, worth ₹324.
Check the Total Row and what conversion preserves
In TableOrders enable the Total Row and choose Sum under Amount. With no filters or manual hides it should show ₹1,066. Then select only Pune on City. The three Pune records have amounts 64, 110 and 150, adding to ₹324. The default Total Row sum follows the visible records through a SUBTOTAL operation. The structured SUM on Check still reads ₹1,066 because it reads the full named data column.
Clear the City filter, confirm all six records and keep the Total Row on for this check. On the practice TableOrders tab use Convert to Range through the appropriate Table controls for your client. The rows and the applied formatting remain. Table features are removed, and Excel rewrites structured references as equivalent cell references. For example, the former Total Row at D8 should now reference the ordinary amount cells D2:D7 through a subtotal formula. Inspect the displayed formula and its scope. Check may show a sheet-qualified or absolute reference depending on where the rewritten formula is used.
The older fixed formula aimed at TableOrders D2:D6 still reads ₹916. The rewritten structured control on Check reads ₹1,066 from D2:D7. That value still agrees with the six records, but there is no longer a named Table object to grow. On this scratch tab, clear the former summary cells in A8:D8 after reading them. Put a new fictional order, KFM-007, Nashik, 2, 88, into row 8. The converted control stays at ₹1,066 until you extend the reference. A manually expanded all-order sum should read ₹1,154. Verify the updated row count is seven. This comparison isolates the consequence of changing the data structure without relying on whether stripes remain visible.
Lab 2. Trace a growing Table into separate reports
A media club wants to summarize a fictional streaming watch log by device. They also want a workshop list of sessions over 30 minutes. The exercise uses a Netflix-inspired context with invented session IDs and values. The same four initial rows feed three things: a source total, a PivotTable by device and an optional formula extract. The Table is the source object in each case, but how you verify updates differs.
| Watch ID | Device | Program | Minutes |
|---|---|---|---|
| WV-01 | TV | Campus Crew | 48 |
| WV-02 | Phone | City Walk | 44 |
| WV-03 | Laptop | Sketchbook | 30 |
| WV-04 | TV | City Walk | 32 |
Build the source and make its consumers explicit
- Create the Table. Select A1:D5, use Insert → Table with headers and name it
tblWatchif your client offers the name field. Put=SUM(tblWatch[Minutes])on a separate check sheet. Expect 154 minutes and four distinct IDs in the data. - Create the device report. On a client with PivotTable creation, choose the Table as a source and put a PivotTable on a new worksheet. A PivotTable summarizes a set of records by selected fields. Here put Device into Rows and put Minutes into Values. Confirm that Values uses Sum. If it shows Count, check the minutes are numbers and inspect the summary setting. The initial amounts should be Laptop 30, Phone 44 and TV 80, with grand total 154.
- Make a second kind of output. If
FILTERis available in your client, put the following formula into a clear grid region on a tab called LongSessions. Leave enough empty rows and four columns to the right including the formula’s first output cell. To see the labels above the output, copy the four source headings into A1:D1, then enter the formula in A2.
=FILTER(tblWatch[[Watch ID]:[Minutes]],tblWatch[Minutes]>30,"No matching sessions")
The first argument asks for four columns, from Watch ID through Minutes. The second argument returns a TRUE or FALSE check for each data row. The referenced columns belong to the same Table, so the output rows and condition rows are aligned. Greater than 30 excludes the laptop session of exactly 30 minutes. The other three sessions are WV-01, WV-02 and WV-04. Their combined duration is 124 minutes. If FILTER is unavailable, predict those rows by hand and build a verified copy using the Minutes column’s Number Filter in a scratch Table.
Append one record, then verify each consumer
- On WatchLog append WV-05, TV, Campus Crew, 55 in A6:D6 immediately below the last Table data row, with no Total Row active. Confirm its actual membership with the boundary and a count. Check that the amount formula now shows 209 minutes. Merely seeing a blue border around neighboring cells is less useful than checking the named Table contains the right ID.
- Inspect the PivotTable’s source to confirm it is the named Table. Use Refresh and verify it now shows TV 135, Laptop 30 and Phone 44, grand total 209. Some Excel configurations can refresh automatically. For this exercise, explicitly refresh or verify that the refresh has happened before trusting an updated result. If the PivotTable source is fixed to A1:D5, updating its data from the same address will still omit WV-05.
- Check the clear grid area for the formula output. There should be four long sessions, including WV-05, totaling 179 minutes. If a note or old output occupies the next destination row, Excel can report a spill error. Move the note to a separate place in this practice workbook and verify the formula fills the correct area. A dynamic result is separate from the four source fields in their own Table.
- Keep the workshop’s intended report definition visible. The source check describes all five sessions. The PivotTable groups all five sessions by device after refresh. The FILTER extract deliberately shows four rows because 30 minutes is not above the cutoff. Three numbers can be correct even when their populations differ.
Check boundaries when adding cells beside a Table
Microsoft describes expanding a Table by typing right below it or next to it, pasting adjacent data, inserting Table rows or columns, or using Resize Table. These actions have a boundary. There cannot be two Excel Tables occupying the same cells. Leaving an empty separator row between a source and new data can leave that new data outside the Table. If a Total Row is turned on, add a row inside the data area, such as by inserting a Table row above the Total Row, or temporarily turn off the Total Row while appending and then verify it. Do not build a loose record beneath an existing summary and assume the summary includes it.
Handle extra source fields intentionally
Suppose a CSV export sends five fields while WatchLog currently has four. If you paste a new record in A7:E7, Microsoft documents that extra columns in that row paste do not become Table columns automatically when the pasted row is wider than the Table. If E is a field the workbook should keep, give it an explicit header and resize or add the column deliberately. Verify the new fields in the Table design and your PivotTable Fields list after refresh. If the report should retain only four fields, create a four-column import from verified data. Reconcile the ID and amount fields so there is no accidental column shift.
Adding a field within the same Table can change a downstream formula that references a consecutive span of fields. The LongSessions formula asks for every field from Watch ID through Minutes. If you insert something between those columns, that span can become wider. Check the headings you copied above the spill. They may now describe the old four-column layout. For a report that should always have exactly four fields, design its selected output columns explicitly and verify a representative appended source record after each field change.
Keep a dynamic summary out of the Table’s footprint
Use a side or separate worksheet region large enough for the largest result you expect. Excel’s dynamic array behavior can spill multiple outputs, which means it places them in neighboring cells from one formula. Spilled array formulas are unsupported inside Excel Tables. A one-result formula per record belongs inside the Table as a calculated column. A formula returning the entire list of long sessions belongs outside the Table. Make sure the source can expand without covering the output. This source-versus-output split is also useful in Chapter 9’s dynamic array exercises.
Test growth with a wider import and a mistaken data type
Separate membership from valid numeric data
Return to a saved copy of the four-session watch list. On WatchLog append WV-05 with its usual ID, Device and Program, but enter the minutes as '55 to make Excel store that number-looking value as text. Confirm first that the fifth row really did join the Table. A nonempty count of Watch ID now gives 5. The structured SUM over Minutes can still give 154 because the fifth value is text in the referenced cells. This is a different failure from a row sitting outside the source. Checking only the total would make the two failures look alike.
- Count the named Minutes field with
=COUNT(tblWatch[Minutes]). It reports four numeric cells. Check the fifth row withISNUMBERand compare it with a known numeric cell in the original list. - In the scratch copy replace the imported text with numeric 55 and verify the Table boundary stays the same. The ID count stays 5, the numeric count becomes 5 and the total becomes 209. You repaired the field’s stored value while leaving the membership unchanged.
- Review the category and duration in the refreshed report. The TV figure should be 135. If the minutes column contains imported errors, blanks or text, a report can choose or produce a different calculation depending on its settings. Inspect the actual configured summary before expecting it to recover merely because the Table row count is correct.
Keep the workbook’s original values in a committed source and perform corrections in a reviewed import or scratch copy when practicing. A stored value can look right even if its type is wrong. A Table defines which row belongs, and a formula decides what data types it uses. Name your checks by the question they answer: Source IDs, Numeric minutes and Total reported minutes.
Try an extra field without assuming it joined the schema
The schema is the set of fields your records are expected to contain. In WatchLog the original schema is Watch ID, Device, Program and Minutes. The club sends a new test record with a fifth field giving a cohort. In a copy where WV-05 is numeric and in the Table, paste WV-06, Phone, Sketchbook, 18, Workshop B into A7:E7. Match the four original field positions and keep the header above E independent until you inspect the result.
Using the documented adjacent paste behavior for a row wider than the Table, the new Watch ID and first four fields can enter the Table while the extra cell E7 stays outside its field boundary. Check the result in your Excel client. If necessary resize to A1:D7 first so the six intended records are in the four columns you are currently testing. The total should be 227 after adding the 18-minute session. The device report after refresh should show Phone 62, TV 135 and Laptop 30. The long-session extract still totals 179 from four rows because this new source row is only 18 minutes.
If you decide the cohort belongs in the record, type a heading Cohort in E1 and deliberately expand or add an Excel Table column covering E1:E7. Confirm the source address and check whether E7’s Workshop B belongs to the new named field. The preceding cohort cells can be empty until the club supplies valid values. A field newly added at the far right does not sit between Watch ID and Minutes, so the existing span of output columns in the long-session formula should still be four. Verify those output headings after resizing.
Distinguish appending from inserting within a fixed reference
In a separate copy of RangeOrders with only the original five records, try inserting a new worksheet row within the existing range, such as above the old row 5. Excel can expand an ordinary interval to include a row inserted between the cells it already references. Enter the ₹150 order in the inserted row. Inspect the fixed formula on Check. It should now cover D2:D7 and show ₹1,066 if Excel adjusted that reference. Contrast that specific insertion with the earlier append below D6, which left the original address unchanged. Do not conclude that every normal-range formula is incapable of adapting. The edit operation and actual formula determine the result. Verify both the final address and the displayed number.
Choose how a consumer handles missing new fields
A new Cohort field does not imply that all six original records have useful cohort information. A report by Cohort may put older records under a blank category. Keep that blank distinct from Workshop B unless the source owner verifies which cohort those sessions belong to. With this fixture, classifying all earlier entries as Workshop B would attribute 227 minutes to that group instead of the verified 18-minute row. A Table can expand the structure and carry values. It cannot validate a business label that the source never supplied.
Before demonstrating these changes in a workbook, make a short checklist of the three expected states. The original state has four records, four defined fields and 154 minutes. The regular appended state has five records, four fields and 209 minutes. A completed wide import can have six records, five fields and 227 minutes. Compare both record counts and column counts. Check the new field’s one known value and confirm that the long-session rule still tests Minutes. Those measures expose both record-boundary and field-boundary mistakes.
Check formulas, charts and summaries individually
Converting a source and seeing a correct Table total is only the first check. A downstream consumer in this lesson is a result that uses the source, such as a summary formula, chart or PivotTable. Each one has its own configured input. If an existing formula asks for D2:D6, it still reads five cells when the Table contains six. If an existing chart reads a separate four-row report, the new source record is visible only after the separate report incorporates it. Change the source used by each consumer deliberately where needed.
Run a controlled chart and source reconciliation
- On a scratch copy with only four original records, build a chart using the exact Watch ID and Minutes fields you want represented. At the original point, check that the chart source identifies WV-01 to WV-04 and the four durations 48, 44, 30 and 32. A chart over a fixed cell range and one built using Table data may look the same at that point.
- Append WV-05 and confirm the named source contains it. Look for a fifth label and value 55 in the chart. If the point is absent, inspect the chart’s data source or series references. Ensure they read the intended Table columns or extend the plotted reference. Confirm an ordinary data filter, chart setting or category mismatch did not hide the point.
- If the chart reads a PivotTable, verify its input grand total after refreshing. A device chart should have three device categories and its TV value should change from 80 to 135. A per-session chart should gain a fifth point. Both are based on the same change and have different expected shapes.
- Write the expected source size and grand amount on the check sheet. When several consumers disagree, identify which reference or refresh condition differs. Rebuilding every formula from scratch is less informative than checking one consumer at a time.
Use a frozen source when the measurement calls for one
Suppose the workshop compares today’s new session with the original four-session cohort. A fixed source of A1:D5 remains exactly that cohort. It should show 154 minutes even after WV-05 is added. Give it a name like Initial four sessions and document why the cutoff stays fixed. The live Table report can separately show all five and 209 minutes. The question tells you whether to use a boundary that grows or a range that remains small. A fixed range can be correct by design, and a fixed range mislabeled All sessions can be incorrect for the same data.
When a club uses a Table for input and a recap sheet for a meeting, it can retain the live report for further data entry and produce a checked snapshot for a particular date. Before sharing the snapshot, paste or export the agreed values as appropriate and confirm the source count and displayed headings. The recipient should be able to tell what time period and record population the document represents. A new Table row added later should not cause an earlier signed-off snapshot to appear to have changed.
Troubleshoot structure before rewriting arithmetic
- New ID is visible under the Table but total is unchanged. Check whether the ID is an actual data member and whether the summary reads the named field. Resize or insert the row appropriately and verify the count.
- Table styling survives but formulas look different. Check for a Convert to Range operation. Existing formula values remain calculated using equivalent addresses, where applicable. Expand a now-fixed source deliberately or recreate a Table and reroute the required references.
- Average or sum looks wrong after a filter. Read the formula type and decide whether it should summarize all referenced values or the current visible result. SUBTOTAL and SUM can both be appropriate on the same report.
- Calculation appears only on the original records. Inspect the calculated column and look for individual formula edits or blanks. Reapply the intended per-row formula in a practice copy and test through the final actual member.
- Formula result shows a spill error. Check that the anchor is outside the Table and that the whole intended output area is clear. Keep notes and charts out of the region that the result may need after growth.
- PivotTable shows the old total. Confirm the source is the named Table and refresh the report where needed. A refresh of the wrong fixed source still reads the old extent.
- Heading differs from what the formula names. Read the exact Table field including any spaces or currency symbols. The exercises deliberately use Amount and Minutes without currency symbols in their header. Formatting numeric values and naming a column are different actions.
Quiz. Predict what changes when the source grows
Where does the extra ₹150 appear after the first append?
It belongs to the sixth source record on each tab. The structured reference reads it after the Table expands and gives ₹1,066. Both fixed D2:D6 formulas still read the first five values at ₹916.
Can you identify a Table from banded colors alone?
No. The ordinary range can be styled and the old colors can remain after Convert to Range. Check the Table controls and name, then inspect the actual membership instead.
Why did an existing D2:D6 formula survive conversion unchanged?
Excel does not rewrite an ordinary cell reference into a structured one when it creates a Table. Add a separate structured formula when you want the current named data column’s full membership.
How do you check that the device PivotTable has read WV-05?
Confirm the source is tblWatch and refresh or verify automatic refresh. In the result, TV rises from 80 to 135 and the grand total becomes 209. Check the Table source total independently.
Why should LongSessions use a formula outside the Table?
FILTER can return several rows into adjacent cells. Spilled arrays must start in the ordinary grid outside an Excel Table. The formula can still refer to named fields inside the Table as its input.
Which order in the original watch experiment fails the duration rule?
WV-03 is 30 minutes exactly. The comparison requires greater than 30. It stays in the data source and in the Laptop PivotTable total even though it is outside the long-session list.
Interview practice. Explain how a workbook will grow
Would you use a Table for a permanent source of transactions?
Yes if the records have a consistent shape and you want to work with named fields and verifiable expansion. Put independent calculations and reports on an output sheet. Check the Table size, ensure the reported formulas use its named columns and refresh dependent reports where needed.
When is a fixed reference a useful choice?
When the reader needs a fixed cohort, such as the first four sessions captured at workshop start. The A1:D5 source continues to describe that cohort while the full Table grows. Include a label naming that population and an independent amount check.
What can go wrong converting a live workbook’s Table into a range?
Table-specific filtering, expansion and named references change, even if values and formatting continue to look familiar. Formulas can be rewritten as fixed ranges. Check references, charts, source queries and any PivotTables using that object in a copy before converting an active source.
How do you debug a Table-based report whose totals lag behind?
First verify the new source ID actually belongs to the Table. Compare a structured sum against a manual total. Then inspect each dependent formula, chart and PivotTable for a fixed range, filter or refresh requirement. Check one result at a time against expected IDs or categories.
How would you combine a growing transaction list with a printable invoice?
Keep the independent order records in the Table. Build the invoice layout in a normal grid region with its own titles and drawing space. Use named fields or formulas to retrieve the intended records and verify the printed numbers separately from the underlying Table’s format.
Revision cards
- Range. Uses worksheet coordinates or a defined name; a fixed reference can intentionally retain an earlier cohort.
- Table. Named fields point to its verified data members. The name gives the reference meaning beyond a letter.
- Append. Confirm the new row actually joined the Table and that the consumer references it.
- Total Row. A chosen SUBTOTAL sum can describe visible source records while an independent SUM describes the full field.
- Report refresh. A PivotTable needs the right source and an up-to-date result.
- Spill location. Reference a Table from a clear ordinary grid region when you need several output cells.
Microsoft references
Continue practising: explore the existing Excel Task Hub for additional exercises.