evelin.

Tidy data structuring explained: simple rules and examples

Learn how to turn messy spreadsheets into tidy data tables so each analysis is faster, less error prone and easier to automate.

What tidy data actually means

Tidy data is a simple way to organise tables so that tools and humans can work with them easily. The core idea is: one variable per column, one observation per row, and one type of thing per table. For example, a column called "age" should hold ages only, not sometimes ages and sometimes text. A row should describe one person or one order, not a mix. A table should focus on a single subject, such as customers or orders, not both combined. Once you get this structure right, filtering, pivot tables, charts and SQL queries become much easier.

Messy vs tidy table structure
Messy table
  • •Merged header cells
  • •One cell holds many values
  • •Mix of subjects in one table
Tidy table
  • ✓One header per column
  • ✓One value per cell
  • ✓One subject per table
VS

Why tidy structure matters for analysis work

As a future data analyst, you will spend a lot of time cleaning data. Tidy structure reduces this time and helps you avoid silent errors. Tools like Excel, Google Sheets, R and Python libraries such as pandas assume a tidy layout. With tidy data you can sort, filter, group and summarise without extra workaround formulas. You can join tables more safely and reuse the same code or steps across projects. Tidy tables also make it easier to explain results to stakeholders, because everyone sees a clear, consistent layout instead of a patchwork of custom formats.

How to reshape wide tables into tidy format

A common real world problem is data in a wide layout. For example, separate columns for "Sales Jan", "Sales Feb", "Sales Mar" and so on. This is hard to filter by month or to create time series charts. In a tidy layout, you turn these into two columns, one for "month" and one for "sales". Each row still represents one observation, for example one store in one month. In spreadsheets you can unpivot with Power Query or by copying and stacking ranges. In SQL and Python you look for operations called unpivot or melt.

Steps to tidy a wide table
  1. 🔍1
    Identify variables
    Spot values hidden in column names
  2. 📅2
    Create key column
    Add a column like month or year
  3. 📊3
    Stack values
    Unpivot multiple columns into one
  4. ✅4
    Check duplicates
    Verify each row is one observation

Typical tidy data mistakes to avoid

Many everyday spreadsheets break tidy rules in subtle ways. Common issues include merged header cells, totals stored in the same table as raw data, one cell that holds several values such as "Paris, London", or columns that mix numbers and text. Another trap is adding formatting as meaning, such as using bold or colours instead of a proper variable. These patterns feel convenient at first but make analysis fragile and slow. When you review a dataset, check column names, look for cells with commas or line breaks, and separate totals into their own summary sheets.

Spot common tidy data problems
⚠️
Merged headers
Breaks sorting and filtering
📦
Many values per cell
Hard to count or group
🎨
Meaning via colour
Use a real column instead

First steps to make your own data tidy

Start with one messy sheet you already use, such as a personal budget or a simple sales export. First, remove merged cells and ensure each column has exactly one header. Next, add missing identifier columns, for example customer ID or date. Then split any multi value cells, like "Red; Blue", into separate rows or columns, depending on what an observation should be. Finally, separate different subjects into different tables, for example products in one table and transactions in another. Save this as a clean base that you keep separate from ad hoc reports or charts.

Real-world examples

  • • You export website leads from a CRM and get dozens of date columns such as "Leads Jan", "Leads Feb". You reshape them into a tidy table with columns for month, campaign and leads, so you can build a simple time series chart.
  • • You track your monthly expenses in a spreadsheet with merged cells and category totals mixed beside raw transactions. You move each transaction into its own row and keep totals on a separate summary sheet, which makes future pivot analysis straightforward.
  • • Your team logs customer support cases in free text rows, including priority and channel inside the description. You extract these details into their own columns, so you can filter by priority and compare channels reliably.

Useful links

Keep learning

Related courses

More programs on evelin that fit this path. Each one adapts to you after a two minute quiz.

Guides from related courses

All courses on evelin →

Turn reading into real progress

A short quiz builds your personal learning path for How to Become a Data Analyst. Lessons adapt to you from day one.

Start the quiz

Created with AI assistance and reviewed before publishing.