How Data Actually Works

Asking questions data can answer

Which rows and which columns?

Every clear question tells you which rows to keep and which columns to use; saying them out loud before you start prevents most mistakes.

By the end of this lesson you can say exactly which rows and columns a question needs.

Why it matters

Analysts often get wrong answers from correct sums, because they added up the wrong rows. A quick plan ("these rows, this column") catches that before it happens.

The idea in plain words

Think of a library. To answer "how many pages are in the cookbooks on the second floor?", you do not read every book. You go to the right shelves (the second floor, the cookbook section), and you look at one thing about each of those books: its number of pages.

A table is the same. A clear question tells you two things:

  • Which rows to keep: the ones that match the question's who, where and when. In a library, that is the right shelves.
  • Which columns to use: the ones you need to pick the rows, plus the one that holds the answer.

Condition: a rule a row must pass to be kept, such as "day is Fri" or "fruit is Pawpaw".

Before touching the data, say out loud: "these rows, these columns".

See it done

Question: how many pawpaws did Amara sell on Friday 6 March 2026?

Data: market-stall-week.csv (synthetic).

  1. Find the conditions. The question names a day (Friday) and a fruit (pawpaw). So a row is kept only if day is Fri and fruit is Pawpaw. Both must be true.
  2. Find the answer column. "How many pawpaws" means the number of fruits, not the number of sales. That is the quantity column.
  3. List the columns you need. day and fruit (to pick rows), and quantity (for the answer).
  4. Keep the rows. Friday is rows 40 to 51: 12 rows. Of those, only 2 are pawpaw: rows 48 and 49 (sales S047 and S048).
  5. Use the answer column. Their quantities are 3 and 2. 3 + 2 = 5.
  6. Answer in a sentence. "Amara sold 5 pawpaws on Friday 6 March 2026, in 2 sales."

12 Friday rows, 2 of them pawpaw, 5 pawpaws in total.

Notice step 2. If you had counted rows instead, you would have said "2". That answers "how many pawpaw sales", which is a different question.

Your turn, with help

Question: how many of Lucía's pupils in class 5B walk to school?

Write the conditions and the column(s) you need. Then find the answer in your sheet.

Hint: this question asks "how many pupils". One row is one pupil. So you count rows. You do not add up a column.

Show the answer
  • Conditions: class is 5B and travel_mode is Walk.
  • Columns: class and travel_mode. No answer column to add up: you count the rows that pass.
  • Answer: 4 pupils.

Your turn, alone

For each question, write the conditions, and say whether you count rows or add up a column (and which one). You do not need the answers yet.

  1. How many sales did Amara make on Thursday?
  2. How many mangoes did Amara sell in the whole week?
  3. How many minutes, in total, do pupils in class 5A spend getting to school each morning?
  4. How many of Amara's Saturday sales were paid by card?
Check your answers
  1. Condition: day is Thu. Count rows.
  2. Condition: fruit is Mango. Add up quantity.
  3. Condition: class is 5A. Add up travel_minutes.
  4. Conditions: day is Sat and payment is Card. Count rows.

Watch out

  • Counting rows when you should add. "How many pawpaws" (add quantity) is not "how many pawpaw sales" (count rows). Read the question twice.
  • Missing a condition. "Pawpaws on Friday" has two conditions. Keep only rows that pass both.
  • Using the wrong period. If the question says one day, do not use the whole week.

Say it back

  1. What is a condition?
  2. "How many sales on Monday": count rows or add a column?
  3. "How many oranges on Monday": count rows or add a column? Which column?
Show the answers
  1. A rule a row must pass to be kept.
  2. Count rows (one row is one sale).
  3. Add a column: quantity, for rows where day is Mon and fruit is Orange.

What is next

Finding rows by eye works for 60 rows. What about 6,000? Next you learn to make the spreadsheet move the rows you want to the top, in one click.

Enjoying the free course?

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