Beginner
60 mins
Teacher/Student led
+65 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

    If one journey is recorded as 250 minutes, what goes wrong when you average travel time? Share when asked, then continue.

    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-
    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, freeze the header, add filters, then clean Transport only with TRIM and PROPER. Stuck? Jump to Common Issues, then return. If a formula stays in Transport, undo and Paste Values again.

    Live demo today = Transport only. Class and Would_cycle wait for the portfolio stretch with different formulas (see the column map after you delete the helper).

    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

    Spot later: mixed Transport text; response 9 twice; 250 minutes; cost -12; blank rating on 16 (leave 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}}. Stuck? Jump to Common Issues, then return.

    Practice rules: delete the whole row when Minutes is 250; clear only the cell when Cost_per_week is -12; leave blank Journey_rating blank.

    If the sheet looks empty after a filter, you probably still have only 250 or -12 ticked. Select all / Clear filter and the rows come back.

    5 - Common Issues ~2 mins

    Common Issues

    IssueSolution
    No {{code:Digital_Spreadsheets}} folderCreate it in OneDrive or Drive, then continue.
    Transport still shows a formulaUndo, copy the helper, Paste Values (Excel) or Values only (Sheets).
    Paste Values hard to findHome Paste arrow → Paste Values (clipboard with 123).
    Fill handle square missingClick the formula cell first, then use the bottom-right square.
    Remove Duplicates broke rowsClick inside the full block so every column is included.
    No Convert to table in SheetsUse {{menu:Data -> Create a filter}} instead.
    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 Coding Ireland 2017 - 2025. 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