A category written as Books, books and BOOKS is three categories to a filter, so a total by category will be wrong three ways. Listing the unique values, replacing each variant with one spelling, and then locking the column with a dropdown stops the problem coming back.
Prerequisites
- Google Sheets
- The CSV imported into Sheets
- A copy of the source file, so the original stays untouched.
Steps
- Select the category column and use Data, Sort range to see the variants grouped together.
- Use UNIQUE on a copy of the column to list every spelling in use.
- Use Find and Replace on each variant, replacing it with the one chosen spelling, and confirm the match case setting.
- Add a data validation dropdown to the category column with the final list of spellings, so new rows cannot reintroduce variants.
- Build a summary with COUNTIF per category and check the counts add to the row total.
Worked example: Fictional bookshop sales by category
The practice table below is a fictional five-sale list after standardising categories. The amount column is the sale value, and the total is their sum. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.
| Category | Amount |
|---|---|
| Books | 13.40 |
| Books | 17.60 |
| Stationery | 8.95 |
| Stationery | 12.30 |
| Books | 19.85 |
| Total | 72.10 |
Expected result. Two categories only, Books and Stationery, and the amounts add to 72.10.
Limits
- Find and Replace can change text inside other words, so check the match-whole-cell setting where it matters.
- A dropdown stops new variants but does not fix the rows already typed, so clean first and lock second.
