Skip to content
TidyFizz

How to clean spreadsheet data for a class project

Keep the original data, make cleanup decisions in a copy, and verify counts and key fields before analysis or submission.

Preserve a copy of the source

Save the original workbook before sorting or replacing any values. Make a working copy and note the initial row count, the names of the columns and what each row represents.

Decide which fields are measurements, categories and identifiers. A code such as 0012 identifies a sample, so keep it as text. Values such as 12 minutes can go in a numeric column once the unit is clear.

Standardize headers and values

  1. Use a single header row with a unique, nonblank name for each column. Move notes and totals out of the area you plan to export.
  2. Trim accidental spaces in a copied column and standardize categories that are equivalent for your analysis, such as the same campus written with different capitalization.
  3. Decide how to represent an unrecorded observation and write the choice down. Keep a recorded zero as zero.
  4. Check duplicates using the combination of columns that defines one observation. Repeated names or IDs can be valid when the same sample was measured more than once.

Work through a lab dataset

A class lab export contains 42 rows and three columns named Sample ID, Trial and Mass (g). Rows 17 and 18 both show sample 0012, trial 2 and a mass of 4.8 g. After confirming the duplicate against the lab log, remove one row. The cleaned sheet should contain 41 rows, and any other trials for sample 0012 should still be present.

If a mass was never recorded, leave it blank or use the missing-value convention required by your course. Record the removed row and the missing-value choice in your methods notes so a reader can reproduce the cleanup.

Audit the exported CSV

Export the cleaned sheet as UTF-8 CSV and open a copy in CSV to JSON Converter. Confirm that the correct delimiter is selected and inspect a few records for shifted columns, missing values and identifiers like 0012. The converter keeps cell values as strings and can expose row lengths that disagree with the header.

If an earlier spreadsheet import turned 0012 into 12, CSV to JSON cannot restore the missing digits. Reimport the original with the identifier column set to text. Check which data your course permits you to share, especially when a workbook includes names or contact details.