A CSV that stores prices as $12.50 is storing text, not numbers, and a SUM over the column will silently ignore every value. Removing the symbol and converting the column to numbers makes the values add up, and the check proves it by comparing the total before and after.
Prerequisites
- Excel
- The CSV opened in Excel
- A copy of the source file, so the original stays untouched.
Steps
- Select the amount column and use Find and Replace to remove the currency symbol, replacing it with nothing.
- Select the column again and use Data, Text to Columns, Finish, to convert the text to numbers.
- Check that the values right-align, which shows they are numbers now, and add a SUM below the column.
- Compare the SUM with a hand total from the source, and investigate any row that did not convert.
- Format the column as Currency with two decimal places for display.
Worked example: Fictional shop prices cleaned to numbers
The practice table below is a fictional five-item price list after cleaning. Each amount is a price, 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.
| Item | Amount |
|---|---|
| Notebook | 4.50 |
| Pen | 1.20 |
| Folder | 2.75 |
| Ruler | 1.85 |
| Eraser | 0.65 |
| Total | 10.95 |
Expected result. Five prices converted to numbers, and the amounts add to 10.95.
Limits
- Removing a symbol does not fix a value that uses a comma as the decimal separator; that needs a locale-aware conversion.
- A column that mixes two currencies must be split first, or the total will mix them.
