GoalUse a filter to show only the rows that match a criterion, for numbers and for text.
New words
filter · to show only the rows that match, and hide the restcriterion · the rule that a row must match to be shownmatch · to fit the criterionhidden row · a row that is not shown, but is still in the sheet
Explanation
A filter shows only the rows that match what we are looking for. The rows that do not match are hidden and not deleted. The rule we choose is the criterion. To filter, select the table, turn on the filter and use the arrow at the top of a column. For numbers, we can choose ‘less than’, ‘greater than’ or ‘equal to’. For text, we can tick items in the list or type a key word. To see all the rows again, clear the filter. Sorting and filtering are different: sorting puts rows in order, and filtering hides rows.
A
B
C
D
1
Plant
Type
Price
In stock
2
basil
herb
3
20
3
mint
herb
4
15
4
rose
flower
12
8
5
tulip
flower
6
30
6
apple
tree
25
5
7
lavender
flower
5
12
8
thyme
herb
3
25
Worked examples
Row
Plant
Type
Price
In stock
2
basil
herb
3
20
3
mint
herb
4
15
7
lavender
flower
5
12
8
thyme
herb
3
25
Criterion: Price less than 6. Rows 2, 3, 7 and 8 match. The other rows are hidden. Notice that the row numbers jump.
Row
Plant
Type
Price
In stock
4
rose
flower
12
8
5
tulip
flower
6
30
7
lavender
flower
5
12
Criterion: Type equals flower. We tick only ‘flower’ in the Type column. Three rows match.
Sort
Filter
puts all the rows in order
shows only the rows that match
no row is hidden
other rows are hidden
use it to see largest or smallest
use it to find the rows you need
Sorting and filtering do different jobs.
Class activity
Hide and find (groups of 3). Make 8 strips of paper, each with one animal: name, number of legs, home and mass, for example ‘frog, 4 legs, pond, 0.05 kg’. Line them up like rows of a table. Choose a criterion, for example ‘legs equal to 4’, and fold back every strip that does not match. How many rows are left? Unfold them all (clear the filter) and try ‘mass greater than 10’. Does the data change when you filter?
Practice
1
Use the bike table. Which bikes are shown for each criterion? (a) Price less than 300, (b) Type equals mountain, (c) Gears greater than 20.
Bike
Type
Price
Gears
Swift
road
350
18
Trail
mountain
420
21
Pip
kids
120
1
Dash
road
280
14
Rock
mountain
380
24
Mini
kids
90
1
Glide
road
450
21
(a) Pip, Dash and Mini. (b) Trail and Rock. (c) Trail, Rock and Glide.
2
Put these steps in order: (a) choose a criterion, (b) select the table, (c) read the matching rows, (d) click the arrow at the top of the column, (e) turn on the filter.
b, e, d, a, c.
3
A filter on the bike table shows only these rows. Which criterion was used?
Row
Bike
Type
Price
Gears
3
Trail
mountain
420
21
6
Rock
mountain
380
24
Type equals mountain. Only the two mountain bikes are shown.
4
Does a filter delete the rows that do not match? How do you see them again?
No. The rows are only hidden. Clear the filter to show them all again.