An amount stored as GBP 25.00 is text, not a number, and a SUM over the column will ignore it. Removing the code prefix and the space, then converting the column to numbers, makes the values add up, and the currency is recorded once in the column heading instead.
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 code, such as GBP, replacing it with nothing.
- Trim the leftover space with a TRIM helper column, then paste the values back over the original.
- Select the column and use Data, Text to Columns, Finish, to convert the text to numbers.
- Add a SUM below the column and compare it with a hand total from the source.
- Rename the column heading to include the currency, for example Amount (GBP), so the currency is not lost.
Worked example: Fictional prices after removing GBP prefixes
The practice table below is a fictional five-item price list after cleaning. Each amount is a price in pounds, 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 (GBP) |
|---|---|
| Stapler | 8.95 |
| Hole punch | 6.50 |
| Paper clips | 2.10 |
| Index cards | 3.25 |
| Binder | 11.75 |
| Total | 32.55 |
Expected result. Five prices converted to numbers, and the amounts add to 32.55.
Limits
- A column that mixes two currency codes must be split first, or the total will mix them.
- Removing the code also removes the currency information, so record it in the heading.
