How Data Actually Works

Asking questions data can answer

Filtering: looking at only some rows

A filter hides every row that does not match a condition, so you see only the rows your question is about; nothing is deleted.

By the end of this lesson you can filter a table to show only the rows your question is about.

Why it matters

Real tables can have thousands of rows. A filter lets you say "show me only Friday" or "only class 5B", and the rest disappear from view. You will reach for filters again and again.

The idea in plain words

Think of a sieve in a kitchen. You pour in rice and water. The water goes through; the rice stays. A sieve keeps what you want and lets the rest go.

A filter is a sieve for rows. You set a condition, such as "fruit is Pawpaw". Rows that pass stay on screen. Rows that fail are hidden.

Filter: a tool that shows only the rows that pass a condition and hides the rest. Hidden rows are not deleted. Remove the filter and they come back.

50 rows are hidden, not gone. The filter is a view, not an eraser.

See it done

Question: how many pawpaw sales did Amara make this week?

Data: Amara's tab, market-stall-week.csv (synthetic).

  1. Plan. Condition: fruit is Pawpaw. Count rows (one row is one sale).
  2. Click any cell in the table, such as A1.
  3. Click Data, then Create a filter. A small filter button appears in each column name in row 1.
  4. Click the filter button in the fruit column (E1).
  5. Choose "Filter by values". You see a list of every fruit, each with a tick.
  6. Click "Clear" to untick them all, then tick only Pawpaw. Click OK.
  7. Look at the row numbers on the left. They jump: 2, 3, 11, 14, 16, 33, 48, 49, 59, 60. Count them: 10 rows. So Amara made 10 pawpaw sales.
  8. Remove the filter when you are done: Data, Remove filter. All 60 rows come back.

Jumping row numbers are the sign that a filter is on and rows are hidden.

Tip: you can filter two columns at once. Filter day to Fri and fruit to Pawpaw, and only rows that pass both show. That is how you answer questions with two conditions, like the one in lesson 3.2.

Your turn, with help

Use filters to answer: how many of Amara's Saturday sales were paid by card?

Hint: set two filters: day to Sat, then payment to Card. Then count the rows that show.

Show the answer

4 sales: rows 53, 54, 59 and 60 (S052, S053, S058 and S059).

Your turn, alone

Remove any old filters first (Data, Remove filter), then use filters to answer:

  1. How many sales did Amara make on Thursday?
  2. How many sales were paid by transfer over the whole week?
  3. In Lucía's tab, how many pupils in class 5A come by car?
  4. True or false: when you filter to Pawpaw, the other 50 rows are deleted.
Check your answers
  1. 11.
  2. 20.
  3. 3.
  4. False. They are hidden. Removing the filter shows them again.

Watch out

  • Forgetting a filter is on. Later you may wonder why rows are "missing". Check the row numbers: if they jump, a filter is on. Remove it when you finish.
  • Counting with the wrong numbers. The last row number on screen (60) is not the count of rows showing (10). Count the rows, or use a formula (next lesson).
  • Spelling in the list. If a fruit appears twice in the filter list (such as "Pawpaw" and "pawpaw "), the data has two spellings. Tick both, and note it as a cleaning job.

Say it back

  1. What does a filter do to rows that fail the condition?
  2. Which menu creates a filter?
  3. How can you tell a filter is on?
Show the answers
  1. Hides them (it does not delete them).
  2. Data, then Create a filter.
  3. The row numbers jump, and a filter button shows in the column names.

What is next

Counting rows by hand works for 10 rows. For 10,000, you need the spreadsheet to count for you. Next lesson: your first real formulas, and the answers to "which fruit sells best?"

Enjoying the free course?

Join the list and we will email you when new courses and launch offers go live. No spam.