← Level 4 – Sorter

3 / 12 ⏱ 20 minutes Premium

Cleaning up data

Spaces, typos, and "don't know" mess up your calculations. How to find them and clean them up.

Your classmates’ answers

In Chart maker, you collected answers on paper and only typed the counts into the table. Now you’ll write down each answer separately, as if your classmates had typed them themselves. That’s what it looks like when you collect answers with a form.

  1. Add a new sheet and name it Answers.

  2. Type Number in A1 and Answer in B1.

  3. In A2 to A21, type the numbers 1 to 20 (with the little square).

  4. In B2 to B21, type the answers: 8× sandwich, 5× apple, 3× cookie, 2× banana, 2× nothing. The order doesn’t matter.

That’s what clean answers would look like. But people type in different ways. So now we’ll make a few mistakes on purpose, as if your classmates had made them:

Why it matters

To you, sandwich, Sandwich, and sandwhich are the same thing. To the spreadsheet, they’re three different answers. When you count them, sandwich will have fewer votes than it should.

And you can’t even see the space at the start.

How to clean up

Capital and small letters: the LOWER function turns everything into small letters.

Spaces: the TRIM function removes the spaces at the start and the end.

Both at once:

  1. In C1, type Clean answer.

  2. In C2, type =LOWER(TRIM(B2)).

  3. Drag C2 down to C21.

  4. Sandwich is now sandwich, and apple is apple.

You have to fix sandwhich by hand. There’s no function for typos.

💡

Google Sheets has a quick way too: select the column → Data → Data cleanup → Trim whitespace.

”Don’t know” and “n/a”

Sometimes, instead of a number, someone writes don't know or n/a. Functions like the average skip a cell like that. But then your average has fewer values than you think. Find those cells and decide what to do with them.

Giliranmu 💪

  1. You have an Answers sheet with 20 answers.
  2. Column C has the clean answers.
  3. You fixed sandwhich by hand.
✅

Done when: all the answers in column C are written the same way.

What to take away from this lesson