Charts and Objects in Spreadsheets
Senior 3 · ICT
Charts and Objects in Spreadsheets
Lesson 4 of 5
40 min
The student council runs a small shop that sells exercise books, pens and mathematical sets. Its treasurer keeps a sales list in Excel. Every week she adds rows at the bottom, copies the Amount formula down by hand, changes the SUM to include the new rows, and recolours alternate rows so the list is easy to read. One week she forgot to extend the SUM, and the council's report was 27,000 Rwf short.
Excel can turn a plain range into a table, an object that formats itself, grows by itself, copies its formulas by itself and totals itself.
Definition
Table (in Excel): a range of cells turned into one named object, with a header row, filter buttons and a style, that grows when rows or columns are added next to it.
Banded rows: alternate rows shaded in two colours, to guide the eye along a row.
Total row: an extra last row of a table where each column can show a sum, average, count, maximum or minimum.
Calculated column: a table column whose formula, typed once, is filled into every row automatically.
Structured reference: a formula reference that uses the table's and columns' names, such as Sales[Amount], instead of cell addresses such as D2:D6.
=$A$1:$D$6. Check it, and keep My table has headers ticked. Click OK.The shortcut Ctrl + T (or Insert → Table) does the same with the default style. A new Table Design tab appears whenever a cell in the table is selected.
Mock-up drawn by Ganzaa. Prices are in Rwf and the sales are illustrative.
| Feature | What happens |
|---|---|
| Self-formatting | Banded rows, a bold header and borders, which stay correct after sorting, filtering or adding rows. |
| Filter buttons | Every heading gets a ▾ button for sorting and filtering (S2 Unit 3). |
| Growing | Type in the row just below the table, or the column just to its right, and the table takes it in. |
| Calculated columns | Type a formula once in a column; Excel fills it into every row, including new ones. |
| Total row | Tick Table Design → Total Row; in each total cell, pick Sum, Average, Count, Max or Min from a list. |
| Headings that stay | Scroll down a long table and the headings replace the column letters A, B, C at the top. |
| Charts that keep up | A chart made from a table includes new rows automatically. |
Name your table. In Table Design → Table Name, replace “Table1” with a name without spaces, such as Sales. Formulas can then use it: =SUM(Sales[Amount]) adds the whole Amount column, however long it grows.
Worked example 1: a calculated column
The table Sales has the columns Item, Unit price and Qty sold. In D1 the treasurer types the heading Amount; the table grows to include column D. In D2 she types =, clicks B2, types * and clicks C2. Excel writes the formula with structured references:
=[@[Unit price]]*[@[Qty sold]]
“@” means “in this row”. Excel fills it down the whole column at once: exercise books , pens , and so on. When she adds “Eraser, 150, 60” in the row below, the table grows and the new Amount, 9,000, appears by itself.
Worked example 2: the total row and a filter
With Total Row ticked, the Amount total shows 141,500 Rwf (before the eraser was added). Now the council filters Unit price to show only items costing 300 Rwf or more: exercise books, rulers and mathematical sets.
The total row now shows Rwf. It uses the SUBTOTAL function, which ignores rows hidden by a filter. A plain =SUM(D2:D6) typed below the table would still show 141,500. Both are right; they answer different questions.
Warning
Common problems
Aldo James: how to use tables in Excel, a beginner's guide covering two ways to turn a range into a table, styles, the total row and how tables grow.
=MAX(Sales[Amount]). Which item does it point to?Practice
=SUM(Results[Mark]) means, and why it is better than =SUM(C2:C41) in a list that grows every term.Sources and credits