Sub topic 2
Prepare a Clean Source Table
Every pivot table, chart, and slicer in your dashboard reads from one place: the source table. If that table is messy, each later step inherits the mess. This chapter shows how to build a table that these tools read reliably, and how to fix the usual problems.
This chapter assumes you know how to move around Google Sheets (cells, ranges, tabs), can enter a simple formula such as SUM, and understand a table with a header row. Later chapters build the pivot tables and charts on top of what you make here.
What "flat" means
A flat table has these properties:
- One header row at the top, with one short, unique name per column.
- One record per row. In a sales table, a record is one order.
- One type of value per column. A date column holds only dates, and a number column holds only numbers.
- No blank rows or blank columns inside the table.
- No merged cells, subtotal rows, or notes mixed into the data.
Pivot tables, charts, and slicers all assume this shape. A pivot table treats the first row of its range as field names. A slicer filters on a column by name. A chart reads columns as series. If a column mixes text and numbers, or a blank row splits the table, these tools guess wrong or stop at the break.
Here is the table used for the rest of this tutorial.
Sheet name: Data
A1:F1 headers: Order ID | Order Date | Region | Category | Units | Revenue
A2: 1001 | 2026-01-05 | West | Hardware | 3 | 450.00
A3: 1002 | 2026-01-09 | East | Software | 1 | 120.00
A4: 1003 | 2026-02-02 | East | Hardware | 2 | 300.00Each row is one order. Each column answers one question about that order: when, where, what kind, how many, how much.
Keep the data on its own tab
Put the source table on a tab named Data, and nothing else on that tab. Pivot tables, charts, and the dashboard each get their own tabs later. Separate tabs give you three benefits:
- You can add rows at the bottom of
Datawithout bumping into other content. - Slicers and filters on other tabs cannot be confused with filters on the source.
- A clear name makes formulas such as
Data!F2:F1000readable months later.
Start the table in cell A1. Avoid title rows above the headers. A title in row 1 pushes the headers down, and a pivot table built on the whole range then treats the title as a header.
Write good headers
Headers become field names in the pivot table editor and labels on slicers and charts. Choose them with that in mind.
- Make each header unique. Two columns named
Totalleave you guessing which is which. - Keep them short and plain:
Region, notSales Region (see note 2). - Do not leave a header blank. A column with no header cannot be used as a pivot field and may break the range detection.
- Use text for every header. A header that looks like a number or date (for example
2026) can be read as data in some features.
If your headers are long, shorten them now. Renaming a column later does not always update charts and slicers that already refer to it, so it is cheaper to settle names before you build anything.
Enforce one type per column
A column's type decides how Sheets sorts, groups, and sums it. The most common cause of a wrong dashboard number is a column that looks right but holds the wrong type.
| Column | Should hold | Common problem |
|---|---|---|
| Order Date | Real dates | Text such as `"Jan 5"` that cannot be grouped by month |
| Units | Whole numbers | Numbers stored as text, such as `"3"` |
| Revenue | Numbers | Currency symbols typed as text, such as `"$450"` |
| Region | Consistent text | `West`, `west`, and `West ` counted as three values |
Check dates
A real date is stored as a number and displayed as a date. Text that only looks like a date is left-aligned by default, while real dates and numbers are right-aligned. Select the column and choose Format > Number > Date to apply a date format. If the cells stay left-aligned, they are text.
To convert text dates in a helper column, use DATEVALUE. This works when Sheets recognizes the text format.
=DATEVALUE(B2)Fill the formula down, then copy the results and paste them back as values with Edit > Paste special > Values only. Delete the helper column afterward.
Check numbers
Numbers stored as text will not add up. A quick test is a SUM over the column. If the total is lower than expected, or zero, some cells are text. You can also use ISNUMBER in a spare cell to test one value.
=ISNUMBER(F2)It returns TRUE for a real number and FALSE for text. To convert text to numbers in bulk, VALUE works for plain numbers.
=VALUE(F2)If values carry a currency symbol or thousands separator as text, strip those characters first, or retype a few and use Format > Number > Currency for display. Store the number, and let formatting show the symbol.
Clean categories
A slicer by values lists every distinct value in a column. Pivot tables group by the same distinct values. Inconsistent spelling therefore creates extra, wrong groups.
Typical causes:
- Different capitalization:
eastandEast. - Trailing or leading spaces:
EastandEast. - Variant spellings:
N. AmericaandNorth America.
Use Data > Data cleanup > Trim whitespace to remove stray spaces from a selected range. To find variants, use Data > Data cleanup > Cleanup suggestions, which flags near-duplicates. You can also build a quick list of the distinct values in a column to look for oddities.
=SORT(UNIQUE(Data!C2:C))Put this formula in a scratch area on a different tab. If you see West and west listed separately, you have found a problem. Fix the source cells, not the formula.
For new data entered by hand, prevent the problem at the source with data validation. Select the Region column (without the header), choose Data > Data validation > Add rule, and set the criteria to Dropdown (from a range) or a list of items. Users then pick a value instead of typing it.
Remove blanks, merges, and totals
Look for these and remove them:
- Blank rows. Select the data, use Data > Data cleanup > Remove duplicates only for true duplicates, and delete blank rows by filtering the column for blanks and deleting the visible rows.
- Merged cells. Select the range and choose Format > Merge cells > Unmerge. After unmerging, only the top-left cell keeps its value, so fill the others in.
- Subtotal or grand-total rows. Totals do not belong in the source. A pivot table would count them as orders and double your revenue. Compute totals in the pivot table or in KPI cells.
- Notes and comments in data cells. Put free text in a separate column, or leave it out.
Some blank cells are acceptable, such as a missing optional Note column. A blank in a key column such as Revenue or Order Date is worth fixing, because it silently drops the row from some summaries.
Duplicates
If the same order appears twice, revenue is counted twice. To find duplicates, a conditional-format rule or a count test helps. In a spare helper column, this formula counts how many times each Order ID appears:
=COUNTIF(Data!$A$2:$A, A2)Any result above 1 marks a repeated ID. Review these before deleting, since two rows with the same ID may be different line items. If they are true repeats, use Data > Data cleanup > Remove duplicates and select the columns that define a duplicate. Delete the helper column afterward so the table stays flat and tidy.
Plan for growth
Your data will grow. Two choices decide whether the dashboard keeps up.
- Open-ended ranges. A reference such as
Data!A1:Fhas no end row, so new rows are included. A fixed range such asData!A1:F100silently ignores row 101. Use open-ended ranges when you create pivot tables andQUERYformulas. - Bounded ranges in KPI formulas. The formulas in a later chapter use ranges like
Data!F2:F1000. If your data may pass row 1000, extend the bound now, or choose a limit comfortably above your expected size.
Also make sure the sheet has enough rows. Add rows at the bottom with Insert > Rows if needed. Do not leave a gap between the last data row and new entries, because a blank row can stop automatic range detection.
=QUERY(Data!A1:F, "select C, sum(F) where C is not null group by C label sum(F) 'Revenue'", 1)This QUERY reads the open-ended range A1:F and groups revenue by region. The where C is not null clause skips empty rows beneath the data. The final 1 tells QUERY that the table has one header row. It is a quick way to test that your table is clean: if the output lists a region twice or shows a strange label, the source needs more work.
Protect the source
Once the table is clean, protect it from accidental edits. Choose Data > Protect sheets and ranges, select the Data tab, and set who may edit. Viewers who use slicers do not need edit access to the source. Restricting edits keeps stray typing from breaking types or adding blank rows.
A pre-flight checklist
Run through this before you move on.
- The headers are in row 1, unique, short, and non-blank.
- There are no blank rows or columns inside the table.
- There are no merged cells and no subtotal rows.
Order Dateis real dates, andUnitsandRevenueare real numbers.- Category columns such as
Regionhave consistent spelling, case, and spacing. - Duplicate records have been reviewed.
- Your formulas and pivot tables use ranges that will grow with the data.
Common errors
- A pivot table shows
Regiontwice or lists blanks. The source has spelling variants or empty rows. Clean the source, then refresh the view. - Revenue totals are too low. Some values are text. Convert them to numbers.
- Months do not group. Dates are text. Convert them with
DATEVALUEand paste as values. - New rows do not appear. The pivot or formula uses a fixed range. Extend it or switch to an open-ended range.
- A total looks doubled. A subtotal row is inside the data.
Exercise
A colleague sends a sales sheet. The title "Q1 Sales" is in A1, headers are in row 3, a blank row separates January from February, and the Revenue column holds values such as "$450" typed as text. List the changes you make so the sheet is a flat table that pivot tables and slicers can use.
Show answer
Delete the title row and the blank row so the headers sit in row 1 and all orders follow without gaps. Convert the Revenue text values to real numbers (strip the "$" and apply Format > Number > Currency for display). Check that the date column holds real dates, trim and standardize category values, and confirm there are no merged cells or subtotal rows. Move the table to a tab named Data.
Exercise
You use the formula =SORT(UNIQUE(Data!C2:C)) on the Region column and it returns East, West, and west. What does this show, and how do you fix it?
Show answer
It shows that the source has an inconsistent value: "west" differs in case from "West", so pivot tables and slicers would list them as separate groups. Fix the source cells (retype them or use a validation dropdown going forward), then check the formula output again to confirm only East and West remain.