Charts, sorting and data tools
Choosing and building the right chart, sorting and filtering a list, conditional formatting, data validation, and pivot tables.
Module contents
Charts
A chart is a graphical representation of worksheet data. Its purpose is comparison: a chart should make a relationship visible faster than the numbers can.
Parts of a chart
| Part | What it is |
|---|---|
| Chart area | The whole chart object |
| Plot area | The rectangle in which the data is drawn |
| Data series | One set of related values — usually one column or row |
| Data point | One value within a series — one bar, one slice |
| Category (X) axis | The labels being compared |
| Value (Y) axis | The scale against which values are measured |
| Legend | Which colour means which series |
| Chart title and axis titles | What is being shown, and in what units |
| Data labels | The numeric value printed on each point |
| Gridlines | Faint lines helping the eye read values |
| Trendline | A fitted line showing the overall direction |
Types, and what each is for
| Chart | Shows | Use when |
|---|---|---|
| Column | Comparison across categories | Comparing values between items — marks by subject |
| Bar | The same, horizontally | Category names are long |
| Line | Change over a continuous scale | Trend over time — sales by month |
| Pie | Each part as a share of one whole | Showing proportions of a single total |
| Doughnut | As pie, several rings | Comparing two sets of proportions |
| XY (scatter) | Relationship between two numeric variables | Testing whether two quantities are related |
| Area | Magnitude of change over time | Cumulative totals |
| Stacked column | Composition within each category | Both the total and its parts |
| Combo | Two series of different kinds or scales | Sales as columns with a percentage as a line |
| Radar | Several measures for one item | Comparing profiles |
The two rules that decide most questions. A pie chart shows parts of one whole, so it needs a single series whose values are all positive and mean something added together — and it becomes unreadable beyond about six slices. A line chart implies a continuous progression, so its category axis must be something that genuinely runs in order, normally time. Using a line chart for unrelated categories such as subjects invites the reader to see a trend that does not exist.
Creating a chart
- Select the data including the row and column headings — Excel uses them as category labels and series names.
- Insert → Charts and choose a type, or press Alt+F1 for a chart on the same sheet, or F11 for one on a sheet of its own.
- Refine with Chart Design and Format: change type, Switch Row/Column (swapping what is compared with what is grouped), Select Data to add or remove series, and Add Chart Element for titles, labels, legend and gridlines.
A chart is linked to its data: change a value and the chart redraws immediately. This is why a chart should always be built from cells, never from numbers typed into it.
Embedded charts sit on the worksheet beside the data; a chart sheet occupies a sheet of its own — better for printing or projecting. Sparklines are tiny charts inside a single cell, useful beside each row of a table.
Making a chart readable
- Always title the chart and both axes, with units.
- A value axis should start at zero for a column or bar chart. Starting it elsewhere exaggerates small differences and misleads the reader — the commonest way a chart lies.
- Drop the legend when there is only one series; it explains nothing.
- Do not use three-dimensional effects. Perspective distorts the very lengths and areas the reader is trying to compare.
- Sort the categories into a meaningful order — by size, or by time — rather than leaving them alphabetical by accident.
Sorting
Sorting rearranges the rows of a list into order by the values in one or more columns.
- Data → Sort A to Z / Z to A for a single column.
- Data → Sort for several levels: sort by Department, then within each department by Marks descending. The first level is applied first; later levels break ties.
- Sorting can be by value, cell colour, font colour or icon, and by a custom list for orders that are neither alphabetical nor numeric — Jan, Feb, Mar, or First Class, Second Class, Pass.
The one mistake that destroys data. Select the whole table, or just one cell inside it, before sorting — never a single column. Sorting one column alone reorders that column while leaving every other column in place, so each row's data is silently attached to the wrong record. Excel usually warns ("expand the selection?"), and the warning must be read. There is no way to detect the damage afterwards, which is why a copy of the sheet before a large sort is cheap insurance.
Filtering
Filtering hides the rows that do not meet a condition. Nothing is deleted; the rows return when the filter is cleared.
- Data → Filter (Ctrl+Shift+L) puts a drop-down arrow on each heading.
- Filter by ticking values, or by a condition: Number Filters (greater than, between, top 10), Text Filters (begins with, contains), Date Filters (this month, last year), or by colour.
- Filters on several columns combine with AND: department BCA and marks above .
- Advanced Filter uses a criteria range written on the sheet, and can copy the matching rows elsewhere.
- Slicers give filtering a set of clickable buttons.
Filtering against sorting: sorting rearranges all the rows; filtering shows some of them. Note that SUM over a filtered range still totals the hidden rows — SUBTOTAL is the function that respects a filter.
Conditional formatting
Formatting applied only when a condition holds, so the sheet highlights what matters without anyone reading every number.
- Highlight Cells Rules — greater than, less than, between, equal to, text that contains, a date occurring, duplicate values
- Top/Bottom Rules — top 10 items, above average
- Data Bars — a bar in the cell proportional to its value, giving a chart inside the column
- Colour Scales — a two- or three-colour gradient across a range, a heat map
- Icon Sets — arrows, traffic lights, flags
- Use a formula — full control:
=AND($C2>=40,$D2>=40)applied to a whole row, with the column locked by a mixed reference so the whole row is coloured by the value in one column
Rules can be edited and prioritised in Manage Rules, and Stop If True prevents later rules being applied.
Data validation
Data → Data Validation restricts what a cell will accept, catching mistakes at the point of entry rather than after they have spread through the calculations.
- Allow — whole number, decimal, list, date, time, text length, or custom formula
- Data — between, not between, greater than, less than
- Input Message — guidance shown when the cell is selected
- Error Alert — Stop (refuses the entry), Warning (allows it after confirmation) or Information
- A list validation produces a drop-down, which prevents both misspellings and inconsistent capitalisation — the two things that break lookups and COUNTIF
- Circle Invalid Data marks entries that broke the rules before validation was added
Pivot tables
A pivot table summarises a large list into a compact cross-tabulation, without formulas and without altering the data.
Insert → PivotTable, then drag field names into four areas:
| Area | Effect |
|---|---|
| Rows | One row per distinct value of that field |
| Columns | One column per distinct value |
| Values | The number summarised — Sum, Count, Average, Max, Min |
| Filters | Restricts the whole table |
From a list of sales records, dragging Region to Rows, Month to Columns and Amount to Values produces a full region-by-month sales table in seconds. Dragging Product into Rows instead re-summarises it immediately — the "pivot" is that rearrangement.
Pivot tables do not update by themselves when the underlying data changes: use Refresh.
Other data tools
Text to Columns (splitting one column at a delimiter), Remove Duplicates, Flash Fill (Ctrl+E), Subtotal, Goal Seek (what input gives this answer?), Solver, What-If scenarios, Freeze Panes, and Group/Outline for collapsible sections.
Step by step
2 proceduresFollow these at the machine. Each numbered step is one action.
Building a column chart of marks by subject
Task
Column A holds five subject names in A2:A6 and column B their marks in B2:B6. Create a titled column chart with axis titles and data labels, and place it on its own sheet.
Select the data with its headings
Select A1:B6 — including the heading row.
Including the headings is what lets Excel label the category axis with subject names and name the series "Marks". Selecting only A2:B6 produces a chart labelled 1, 2, 3, 4, 5 and a legend reading "Series1".
Choose the chart type
Insert → Charts → Clustered Column.
A column chart is right here because subjects are separate categories being compared. A line chart would imply that the subjects form a continuous sequence and that the marks "trend" from one to the next, which is meaningless. A pie chart would imply the marks are parts of a single total, which they are not — a student's marks in five subjects do not add up to a meaningful whole.
Add the title
Click the chart title placeholder and type something that states what is shown:
Semester 1 marks by subject"Chart" or "Marks" is not a title. A title should let a reader who sees only the chart understand it.
Add axis titles
Chart Design → Add Chart Element → Axis Titles → Primary Horizontal and Primary Vertical.
Horizontal:
Subject. Vertical:Marks (out of 100).Units belong in the axis title. A bare "Marks" leaves the reader unable to judge whether 68 is good.
Add data labels and remove the legend
Add Chart Element → Data Labels → Outside End prints each value above its column, so the reader need not measure against the axis.
Add Chart Element → Legend → None. With a single series the legend just repeats the title and wastes space.
Check the value axis starts at zero
Right-click the vertical axis → Format Axis and confirm Minimum is .
This matters. With marks of to , an axis starting at makes the best subject look several times the worst. In a column chart the reader compares lengths, so a truncated axis misrepresents the data — the single most common way a chart misleads.
Move the chart to its own sheet
Chart Design → Move Chart → New sheet, and name it.
A chart sheet is better for printing and projecting; an embedded chart is better when the numbers should be read alongside it.
Confirm the chart is live
Return to the data and change one mark. The column redraws at once, because the chart references the cells rather than holding copies of the values.
Result
Select A1:B6 with headings → Insert Clustered Column → title and axis titles with units → data labels, legend off → axis minimum → Move Chart to a new sheet.
NoteSelect the headings, and check the axis starts at zero. Those two habits fix most of what is wrong with student charts.
Sorting and filtering a student list safely
Task
A list in A1:E101 holds Name, Roll No, Department, Marks and Fee. Sort it by department, and within each department by marks highest first; then show only BCA students scoring above .
Select correctly before sorting
Click any single cell inside the list — do not select a column.
Excel detects the surrounding block and sorts whole rows, keeping each student's data together. Selecting only the Marks column and sorting it would reorder the marks while leaving names, roll numbers and fees where they were, attaching every mark to the wrong student. Excel's warning offering to expand the selection must be accepted.
Save a copy first, for a large list
Right-click the sheet tab → Move or Copy → Create a copy.
A mis-sort cannot be detected afterwards, because the result looks entirely plausible. Undo works only until the file is closed.
Set up a two-level sort
Data → Sort. Confirm My data has headers is ticked.
- Sort by: Department, Order A to Z
- Click Add Level
- Then by: Marks, Order Largest to Smallest
The order of the levels is the order in which they apply: rows are grouped by department first, and within each group ranked by marks. Reversing the levels would rank the whole list by marks and then regroup it, giving a different arrangement.
Switch on filtering
Click inside the list and press Ctrl+Shift+L, or Data → Filter. A drop-down arrow appears on each heading.
Filter on department
Open the Department drop-down, untick Select All, tick only BCA, and click OK.
Rows for other departments are hidden, not deleted — their row numbers disappear from the sequence, and the arrow changes to a funnel to show a filter is active.
Add the marks condition
Open the Marks drop-down → Number Filters → Greater Than → enter
400.Filters on different columns combine with AND, so what remains is BCA students and marks above . The status bar reports how many of the 100 records are showing.
Total only the visible rows
=SUM(D2:D101)would include the hidden rows. To total what is displayed:=SUBTOTAL(109,D2:D101)The code means SUM ignoring hidden rows ( would include them). SUBTOTAL is the function to use with any filtered list.
Clear the filter when finished
Data → Clear removes the conditions and every row returns. Leaving a filter in place is a common source of confusion later — a sheet that appears to have lost half its records usually has a funnel icon on one heading.
Result
Click one cell inside the list → Data → Sort with two levels (Department A–Z, then Marks largest first) → Ctrl+Shift+L → filter Department = BCA and Marks > 400 → total with SUBTOTAL(109,…).
NoteNever sort a single selected column. And use SUBTOTAL rather than SUM whenever a filter is in force.
Practice problems
5 with solutionsWork each one on paper first. The full solution — not just the answer — is one click away.
Name and explain six parts of a chart.
Show solutionHide solution
-
Chart area — the entire chart object, including titles and legend. Selecting it moves or resizes the whole chart.
-
Plot area — the rectangle inside which the data is actually drawn, bounded by the axes.
-
Data series — one complete set of related values, usually a single row or column of the worksheet. A chart may hold several series, each in its own colour.
-
Data point — one individual value within a series: one column, one slice, one marker on a line.
-
Category (X) axis — the horizontal axis, carrying the labels of the things being compared (subjects, months, regions).
-
Value (Y) axis — the vertical axis, carrying the numeric scale against which the data points are measured.
Others worth naming: the legend, which says which colour belongs to which series; the chart title and axis titles, which state what is shown and in what units; data labels, printing the value on each point; gridlines, helping the eye read a value off the scale; and a trendline, a fitted line showing the overall direction.
On single-series charts, the legend should be removed — it merely repeats the title.
Differentiate between sorting and filtering. Why must the whole table be selected before sorting?
Show solutionHide solution
| Sorting | Filtering | |
|---|---|---|
| Effect | Rearranges the rows into order | Hides rows that do not meet a condition |
| All rows still present? | Yes, in a new order | Yes, but some are hidden from view |
| Changes the data? | The arrangement, permanently | Nothing at all |
| Reversible? | Only by sorting again or undoing | Yes — Clear Filter restores every row |
| Based on | Values, colour, icon, or a custom list | A condition on one or more columns |
| Command | Data → Sort | Data → Filter (Ctrl+Shift+L) |
The two are often used together: filter to the rows of interest, then sort those into a useful order.
Why the whole table must be selected before sorting.
Sorting rearranges rows. For the data to stay meaningful, every column must be rearranged together, so that each row's values remain attached to the same record.
If only the Marks column is selected and sorted, Excel reorders only that column. The names, roll numbers and fees stay exactly where they were, so the highest mark ends up beside whichever name happened to be in the first row. Every student now has someone else's mark.
The damage is undetectable afterwards: the sheet looks perfectly normal, every name is present and every mark is present, and nothing indicates that they have been paired wrongly. There is no way to reconstruct the original pairing from the file.
In practice: click one cell inside the list and let Excel detect the whole block, or select the entire table including headings. Excel usually offers to expand the selection — that warning must be read rather than dismissed. Before a large sort, copy the sheet.
Explain any five types of chart and state a situation suited to each. Why is a pie chart unsuitable for showing marks in five subjects?
Show solutionHide solution
1. Column chart. Vertical bars whose heights represent values, for comparing separate categories.
Suited to: marks by subject, sales by branch, population by district — anything where distinct items are compared.
2. Line chart. Points joined by a line, showing how a value changes along a continuous scale.
Suited to: monthly sales over a year, daily temperature, share price — the category axis must be something genuinely ordered, normally time.
3. Pie chart. A circle divided into slices, each proportional to its share of the total.
Suited to: the composition of one whole — how a monthly budget divides between rent, food, travel and savings; the share of votes each party received.
4. XY (scatter) chart. Points plotted against two numeric axes, showing whether two quantities are related.
Suited to: hours studied against marks obtained; height against weight; advertising spend against sales.
5. Stacked column chart. Columns divided into segments, showing both the total for each category and its composition.
Suited to: total marks per student split by subject; monthly revenue split by product line.
Also: bar charts (a column chart turned horizontal, for long category names); area charts; combo charts (columns and a line together, for two different scales); doughnut and radar.
Why a pie chart is wrong for marks in five subjects.
A pie chart makes one claim about the data: these values are parts of a single whole, and their sum is meaningful. That claim is false here.
-
The total means nothing. Marks in Mathematics, English and Computer Science do not combine into any real quantity. A slice reading "Mathematics 28%" invites the reader to think mathematics is 28% of something — but 28% of an arbitrary sum is not a fact about the student.
-
The question being asked is comparison, not composition. A reader wants to know which subject is strongest and by how much. Judging that from the angles of slices is much harder than from the lengths of columns — an established finding about how people read charts, and the reason a column chart is right.
-
A pie hides the scale entirely. Marks of and marks of produce identical pie charts, because the proportions are the same. A pie chart cannot distinguish an excellent student from a failing one — it discards exactly the information that matters.
The correct choice is a column chart, with subjects on the category axis, a value axis running from to the maximum mark, and data labels. A pie chart would only be right if the question were genuinely about composition — for instance how a student's 168 hours in a week divide between classes, study, sleep and travel.
What is conditional formatting? Describe four of its types and one use of each.
Show solutionHide solution
Conditional formatting applies formatting to a cell only when a stated condition is true, and removes it when the value changes. It makes a sheet indicate its own exceptions, so a reader is not obliged to check every number.
It differs from ordinary formatting in being dynamic: colouring a failing mark red by hand is wrong the moment the mark is corrected, whereas a conditional rule re-evaluates itself.
1. Highlight Cells Rules. Formats cells meeting a comparison — greater than, less than, between, equal to, text containing, a date occurring, or duplicate values.
Use: colour every mark below red, so failures are visible at a glance in a list of 200 students. Or highlight duplicate roll numbers, which finds data-entry errors that no formula would reveal.
2. Data Bars. Draws a bar inside each cell, its length proportional to the value — a small chart within the column.
Use: a sales column where relative sizes must be seen while the exact figures remain readable. It gives the comparative power of a chart without leaving the table.
3. Colour Scales. Applies a two- or three-colour gradient across a range, so each cell's colour indicates its position between the lowest and highest values — a heat map.
Use: a grid of monthly sales by region, where the eye immediately finds the strong and weak combinations without reading a single number.
4. Icon Sets. Places a small symbol in each cell — traffic lights, arrows, flags — according to which band the value falls in.
Use: a project tracker where green, amber and red show progress against target; or up, level and down arrows against last month's figures.
5. Formula-based rules deserve mention as the most powerful form. Choosing Use a formula to determine which cells to format allows any condition, including one that formats a whole row based on one column:
=$D2<40
applied to the range A2:E101 colours the entire row of any student failing. The mixed reference $D2 is essential — the column is locked so every cell in the row consults column D, while the row is free so each row tests its own value.
Managing rules. Conditional Formatting → Manage Rules lists them in priority order, since several may apply to one cell, and Stop If True prevents lower rules being applied once one has matched.
=$D2<40 to colour a whole row.What is a pivot table? Explain its four areas and give an example of what it produces from a sales list. Why is it better than writing SUMIF formulas?
Show solutionHide solution
A pivot table is an interactive summary that cross-tabulates a large list, grouping records and aggregating a numeric field — without writing a single formula and without altering the source data.
Insert → PivotTable, then drag field names into four areas.
| Area | Effect |
|---|---|
| Rows | One row of the summary for each distinct value of the field |
| Columns | One column for each distinct value |
| Values | The field to be aggregated — Sum, Count, Average, Max, Min, or a percentage of the total |
| Filters | Restricts the whole table to selected values |
An example. Take sales records with the fields Date, Region, Salesperson, Product, Quantity, Amount.
Drag Region to Rows, Month to Columns and Amount to Values as Sum. The result is a complete region-by-month sales table:
| Region | Jan | Feb | Mar | Total |
|---|---|---|---|---|
| North | 45,000 | 52,000 | 48,000 | 145,000 |
| South | 38,000 | 41,000 | 55,000 | 134,000 |
| East | 29,000 | 33,000 | 31,000 | 93,000 |
| Total | 112,000 | 126,000 | 134,000 | 372,000 |
Now drag Product into Rows in place of Region, and the same 5,000 records are re-summarised by product instantly. Add Salesperson beneath Region and the table nests one inside the other. That rearrangement is the pivot.
Why it beats SUMIF formulas.
1. No formulas to write, and none to get wrong. The table above would need SUMIFS formulas plus row and column totals — around sixteen formulas, each with absolute references to get right. The pivot table needs three drags.
2. It discovers the categories itself. SUMIFS requires you to know in advance that the regions are North, South and East, and to have typed those labels as row headings. A pivot table reads the distinct values out of the data. If a fourth region appears next month, the pivot table shows it on refresh; the SUMIFS grid silently omits it, and its sales vanish from a total that still looks complete.
3. Rearranging costs nothing. Summarising by product instead of by region means one drag. With formulas it means rebuilding the entire grid.
4. It scales. The same three drags handle 5,000 rows or 500,000. Sixteen formulas over half a million rows recalculate slowly, and a hundred such grids make a workbook unusable.
5. Extras come free: row and column totals, percentage of total, grouping dates into months, quarters and years, expanding a cell to see the underlying records (drill down), slicers, and pivot charts.
The one caution. A pivot table does not update itself when the source data changes — it must be refreshed (right-click → Refresh). SUMIF formulas recalculate at once. This is the single genuine advantage of formulas, and the reason a live dashboard cell is often better as a formula while analysis is better as a pivot table.
When formulas are still right: a handful of specific figures embedded in a report, values that must recalculate instantly, or a result that feeds further calculations. When a pivot table is right: exploring a large list, or any summary whose shape may need to change.