Year 10Technologies 70 minAC9TDI10P01: develop techniques to acquire, store and validate data from a range of sources using software, including spreadsheets and databases
We are learning to
- We are learning to acquire data from different sources without damaging it.
- We are learning to combine, clean and validate data using spreadsheet techniques.
- We are learning to choose data types and keys for storing data in a database.
Success criteria: I can…
- I can import a CSV file so that postcodes keep their leading zero and dates are read correctly.
- I can convert data from a second source into the same units and format before combining.
- I can use COUNTIFS to find duplicate records.
- I can create validation rules and a flag formula that catch missing and impossible values.
- I can design a database table with suitable data types and a primary key, and explain how the key prevents duplicates.
Key competenciesDigital LiteracyNumeracyCritical and Creative Thinking
Lesson sequence
70 min total- 1
Where did Darwin go?
Starter 0–8 minTeacher- Ask students to open cleanup-form.csv by double-clicking it, so it opens straight in the spreadsheet (Google Sheets: open it from Drive, or use File, Import with the default settings).
- Ask: What has happened to team T01's postcode? (it shows 800, not 0800)
- Say: “Darwin postcodes start with 0. The spreadsheet decided the postcode was a number and dropped the zero. The data was damaged the moment we acquired it.”
- Ask: Why is a postcode text, not a number? (we never calculate with it; it is an identifier, and its digits, including leading zeros, matter)
- Say: “Today you will combine two sources and build checks so this kind of damage, and other errors, are caught.”
- Close the file without saving.
Students- Open the CSV directly and spot the damaged postcode.
- Explain why a postcode should be stored as text.
cleanup-form.csv (text in Resources) - 2
Acquire both sources properly
Main 8–23 minTeacher- Model the import, then students repeat it
- Excel: Data tab, From Text/CSV, choose the file, then Transform Data. Click the Postcode column and set its type to Text. When Excel asks, choose Replace current (Add new step would convert 0800 to the number 800 first and then to the text 800). Then Close & Load.
- Google Sheets: File, Import, Upload the file, then untick Convert text to numbers, dates, and formulas before clicking Import data.
- Ask: T01 and T05 show 0800.
- Tip: in Google Sheets, unticking the conversion keeps 0800 but leaves every column as text, so the formulas later in the lesson would not work. Convert the other columns in helper columns, then copy and paste them back as values: dates with =DATEVALUE(C2) (it reads an ISO date such as 2027-03-01 correctly in any locale; format the result as a date), Bags with =VALUE(D2), and Weight_kg with =IF(E2="","",VALUE(E2)) so T04's missing weight stays blank instead of becoming 0.
- Now add Source B, the typed paper forms (Resources), on a second sheet.
- Ask: What is different about Source B? (weights are in grams; dates are written day/month/year like 3/3/2027)
- Students add a Weight_kg column to Source B with =E2/1000 and fill down (4500 g becomes 4.5 kg).
- Say: “"Dates like 4/3/2027 mean 4 March in Australia, but software set to United States settings reads them as 3 April." Show where to check: Google Sheets: File, Settings, Locale: Australia. Excel uses the computer's region settings, or in Transform Data choose Change Type, Using Locale, English (Australia).”
- Ask: Which date will go wrong if the locale is wrong? (4/3/2027 becomes 3 April; 3/3/2027 happens to look the same either way, which is why this bug is easy to miss)
Students- Import the CSV with Postcode as text.
- Add Source B, convert grams to kilograms and check the locale.
Source B data (text in Resources) Devices with Excel or Google Sheets - 3
Combine and find duplicates
Main 23–35 minTeacher- Students build one combined sheet with the columns: A Team, B Postcode, C Date, D Bags, E Weight_kg, F Source (Form or Paper). Paste Source A's 6 rows, then Source B's 4 rows with their converted kilograms (10 data rows, rows 2 to 11).
- Model a duplicate check in G2: =COUNTIFS(A$2:A$11,A2,C$2:C$11,C2)>1 and fill down.
- Ask: Which rows show TRUE? (both T02 rows: same team, same date, same values)
- Ask: Should we delete one automatically? (only after checking it really is the same submission sent twice; here every value matches, so keep one)
- Students delete one T02 row, leaving 9 data rows (rows 2 to 10), and delete column G.
- Tip: Excel also has Data, Remove Duplicates, and Google Sheets has Data, Data cleanup, Remove duplicates. COUNTIFS is better for learning because it shows the duplicates before anything is deleted.
Students- Combine both sources into one sheet with a Source column.
- Find and remove the duplicate submission with COUNTIFS.
- 4
Validate: rules and a flag formula
Main 35–50 minTeacher- Say: “Validation stops bad data getting in. A flag finds bad data that is already in.”
- Model the rules (Excel: Data, Data Validation; Google Sheets: Data, Data validation):
- 1.Bags (D2:D10): whole number between 0 and 20 (range check).
- 2.Weight_kg (E2:E10): one custom rule =AND(E2>=0,E2<=D2*5), so the weight is not negative and is no more than 5 kg a bag (the challenge's own reasonableness rule). A cell can hold only one validation rule, so combine the checks with AND.
- 3.Postcode (B2:B10): custom rule =LEN(B2)=4 (format check: exactly four characters).
- Then the flag in G2, headed Status, filled down: =IF(OR(E2="",D2<0,E2>D2*5),"Check","OK")
- Ask: Which teams are flagged Check, and why? (T04: weight missing, a presence check; T05: 180 kg is more than 7 × 5 = 35 kg, probably 18.0 typed wrongly; T08: -1 bags is impossible)
- Say: “We never fix a flagged value by guessing. We go back to the source: contact the team or check the paper form.”
- Totals of confirmed data: =SUMIF(G2:G10,"OK",E2:E10) and =SUMIF(G2:G10,"OK",D2:D10).
- Questions
- 1.What is the confirmed total weight? (14.5 + 9.0 + 12.0 + 4.5 + 11.0 + 7.5 = 58.5 kg)
- 2.What is the confirmed total of bags? (6 + 4 + 5 + 2 + 5 + 3 = 25)
Students- Add three validation rules and test each by typing a bad value.
- Add the Status flag formula and identify the three flagged teams.
- Calculate confirmed totals with SUMIF.
Validation rule card (text in Resources) - 5
Store it in a database table
Main 50–60 minTeacher- Say: “A spreadsheet is fine for cleaning, but a database can enforce types and keys for every future record.”
- Pairs design a table called CleanupResult on the design card (Resources): a field name, data type and rule for each column.
- Model answer: Team TEXT; Postcode TEXT of exactly 4 characters; ResultDate DATE; Bags INTEGER, 0 to 20; WeightKg DECIMAL, 0 or more; Source TEXT, Form or Paper; Status TEXT. Primary key: (Team, ResultDate).
- Ask: How would this primary key have handled the duplicate T02 row? (the database would reject the second row, because the same Team and ResultDate already exist)
- Ask: Why not make Team alone the primary key? (a team might submit results on more than one day)
- If you have a database tool (for example Microsoft Access, LibreOffice Base or a school-approved SQL editor), students create the table and import the 9 cleaned rows.
Students- Design the CleanupResult table with data types, rules and a primary key.
- Explain how the key prevents duplicate submissions.
Table design card (text in Resources) - 6
Which technique caught which error?
Plenary 60–70 minTeacher- Questions
- 1.Which technique protected the Darwin postcodes? (importing the Postcode column as text)
- 2.Which technique caught the duplicate? (COUNTIFS on Team and Date; in the database, the primary key)
- 3.T05 reported 180 kg in 7 bags. Which rule caught it, and what should happen next? (the 5 kg per bag rule; ask the team to confirm the weight rather than guess)
- 4.Why convert Source B's grams before combining? (so every value in the column uses the same unit, otherwise totals mix grams and kilograms)
- 5.Name one validation you would add to the online form itself, so the errors never reach the spreadsheet. (make weight required; limit bags to 0 to 20; use a date picker; make postcode a four-digit text field)
- Students save the workbook with the class file naming convention and submit it with the table design.
Students- Answer the questions.
- Save and submit the workbook and table design.
Key vocabulary
CSV
comma-separated values: a plain text file where each line is a record and commas separate the fields
data type
the kind of value a field holds, such as text, whole number, decimal or date
leading zero
a zero at the start of a value, such as 0800, which is lost if the value is treated as a number
validation
checking that data is sensible and in the right form before it is accepted
range check
a rule that a value must lie between a minimum and a maximum
presence check
a rule that a field must not be left empty
primary key
a field or combination of fields that uniquely identifies each record
Differentiation
Support
- Give a partly built combined sheet with the columns already set up, so students focus on the COUNTIFS and flag formulas.
- Provide a formula card with the exact formulas, and ask students to explain in words what each one checks.
Extension
- Add a nested IF so Status shows the reason (Missing weight, Too heavy, Bad bags) instead of only Check.
- Write a SQL CREATE TABLE statement for CleanupResult with a CHECK constraint for Bags and a composite primary key.
- Use conditional formatting to colour every Check row, and explain why a flag column is still needed for SUMIF.
Accessibility
- Share a written step card with screenshots of the import dialogs for students who cannot follow the demonstration at speed.
- Increase spreadsheet zoom and use cell borders so rows are easy to track.
- Pre-teach CSV, data type, validation and primary key with the starter example for EAL/D learners.
Assessment
- Check each workbook: 0800 shown for T01 and T05; Source B weights in kilograms (4.5, 11.0, 2.0, 7.5); dates read as March; one T02 row remaining (9 data rows); validation rules on Bags, Weight_kg and Postcode; Status shows Check for T04, T05 and T08 only; confirmed totals 58.5 kg and 25 bags.
- Table design: suitable data types (Postcode as text), at least two rules, and a primary key of Team and ResultDate with a correct explanation of how it blocks the duplicate.
- Plenary questions 1 to 5: students who match each error to the technique that catches it meet the success criteria.
Resources
- cleanup-form.csv (Source A, the online form export; paste these 7 lines into a plain text editor and save as cleanup-form.csv): Team,Postcode,Date,Bags,Weight_kg / T01,0800,2027-03-01,6,14.5 / T02,2000,2027-03-01,4,9.0 / T03,3000,2027-03-02,5,12.0 / T02,2000,2027-03-01,4,9.0 / T04,4000,2027-03-02,3, / T05,0800,2027-03-03,7,180
- Source B (typed from paper forms; put on a second sheet with these columns: Team, Postcode, Date, Bags, Weight (g)): T06, 5000, 3/3/2027, 2, 4500 / T07, 6000, 3/3/2027, 5, 11000 / T08, 7000, 4/3/2027, -1, 2000 / T09, 2600, 4/3/2027, 3, 7500
- Validation rule card: Bags: whole number from 0 to 20 (range check). Weight_kg: 0 or more and no more than 5 kg a bag: =AND(E2>=0,E2<=D2*5) (range and reasonableness check). Postcode: exactly 4 characters: =LEN(B2)=4 (format check). Weight_kg must not be blank (presence check, caught by the Status flag). Status flag: =IF(OR(E2="",D2<0,E2>D2*5),"Check","OK").
- Answer key for the cleaned data (9 rows): OK: T01 14.5 kg 6 bags; T02 9.0 kg 4 bags; T03 12.0 kg 5 bags; T06 4.5 kg 2 bags; T07 11.0 kg 5 bags; T09 7.5 kg 3 bags. Check: T04 (weight missing), T05 (180 kg is more than 35 kg allowed for 7 bags), T08 (-1 bags). Confirmed totals: 58.5 kg and 25 bags.
- Table design card: Table name CleanupResult. Columns: Field name | Data type | Rule. Primary key: ____. How the key stops duplicates: ____.
- Devices with Microsoft Excel or Google Sheets; optional database software such as Microsoft Access, LibreOffice Base or a school-approved SQL editor