Beginner
60 mins
Teacher/Student led
+95 XP
Pupils work on their own device

Clean It Before You Trust It

Students prepare survey response data for reliable analysis by creating a working copy, freezing headers, converting to a table or filter, cleaning text, removing duplicates and invalid entries, and logging every change.

Teacher Class Feed

Load previous activity

    1 - Introduction ~4 mins

    Welcome

    Illustration for IntroductionReal survey answers are rarely tidy. Today you clean a working copy of {{code:01_survey_responses}} and log every change. If that file is missing or has fewer than 10 answer rows, use the messy sample in this lesson. That is fine.

    By the end of this lesson you will:

    • Make a working copy named {{code:02_survey_analysis}}.
    • Freeze the header and add a table (Excel) or filter (Sheets).
    • Clean Transport with TRIM and PROPER, then paste as values.
    • Remove duplicates, fix impossible answers, and log every change.
    Warm-up

    One answer in a travel survey says a journey to school took 250 minutes. If you leave it in when you work out the average journey time, what goes wrong? Be ready to share your idea.

    2 - Key Concepts ~4 mins

    Four ideas keep messy answers usable and honest.

    ConceptWhy it mattersExample
    Freeze header: row 1 stays visible while you scrollYou still see column names when you filter lower rowsScroll to response 24: headers still read Transport, Minutes
    Table or filter: header filters on the full blockClean-up tools hit every row, not a half-selected columnFilter Transport to Bus for school-bus checks
    TRIM and PROPER: strip extra spaces; standardise capitals" bus", "BUS" and "Bus" must become one spelling{{formula:=PROPER(TRIM(C2))}} turns " bus" and "BUS" into Bus
    Cleaning log: records each change and whyReaders see what you fixed and what you left aloneRemoved duplicate response 9: would have double-counted Bus

    3 - Step-by-step A: Structure and Clean Transport ~14 mins

    Paste the messy sample into a new workbook, freeze the header row and add filters. Then clean the Transport column with TRIM and PROPER. If you get stuck, look at the Common Issues table in the next step, then come back. If a formula stays in Transport, undo and paste again with Values only.

    Today you clean the Transport column only. Class and Would_cycle need different formulas. They are an extra challenge in the Portfolio Build later in this lesson.

    Messy sample data (copy the whole table, then paste at {{code:A1}}):

    ResponseClassTransportMinutesCost_per_weekWould_cycleJourney_rating
    1TY1Bus2512Maybe3
    2TY1walk100No4
    3TY1Car 150Yes3
    4TY1BUS4015No2
    5TY1Cycle120Yes5
    6TY1Walk80No5
    7TY1Train4525No2
    8TY1Car200Maybe3
    9TY2Bus3012Yes2
    9TY2Bus3012Yes2
    10ty2Walk150Maybe4
    11TY2 bus3515No2
    12TY2Car100yes4
    13TY2Cycle180Yes4
    14TY2Bus25010Maybe3
    15TY2Car250No3
    16TY2Walk50No
    17TY3Bus5015No1
    18TY3Train4020Maybe2
    19TY3Car120Yes4
    20TY3Walk200Maybe3
    21TY3Bus28-12Yes3
    22TY3Cycle150Yes5
    23TY3Car300Maybe2
    24TY3Bus2210No3

    Problems you will fix in this lesson: Transport is spelled in different ways, response 9 appears twice, one journey says 250 minutes, one weekly cost is -12, and response 16 has no journey rating (leave that one blank).

    4 - Step-by-step B: Duplicates, Impossibles, Log ~10 mins

    Still in {{code:practice_cleaning}}, remove the duplicate response 9, fix the two impossible numbers, then build {{code:cleaning_log}} and rename the data sheet {{code:clean_data}}. If you get stuck, look at the Common Issues table in the next step, then come back.

    Practice rules: delete the whole row when Minutes is 250; clear only the cell when Cost_per_week is -12, so response 21 keeps its other answers; leave the blank Journey_rating for response 16 blank.

    If the sheet looks empty after a filter, the filter is still showing only 250 or -12. Open that column's filter, select all the values again, then click Apply (Excel) or OK (Google Sheets), and the rows come back.

    Log rows to copy (click {{cell:A2}} on {{code:cleaning_log}}, then paste):

    1Transport columnMixed capitals and spacesPROPER and TRIM, paste as valuesSo Bus counts as one group
    2Response 9Same row submitted twiceRemoved duplicate rowTwo identical answers would double-count
    3MinutesValue 250Deleted whole rowImpossible school journey time
    4Cost_per_weekValue -12Cleared cell onlyCost cannot be negative
    5Journey_rating response 16Blank cellLeft blankDo not invent missing answers
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of 123Learn.ie 2017 - 2026. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more