Why a workbook keeps what a CSV loses
A CSV is text with commas in between. Nothing in it says whether 07030 is a zip code or the number 7,030, so Excel guesses, and by default it converts your values to match the guess.
What Excel does to a CSV, and what this workbook keeps
| In the CSV | Excel opens the CSV | In this workbook |
|---|---|---|
| 00123 | 123 | 00123 |
| 12345678901234567890 | 12345678901234500000 | 12345678901234567890 |
| JAN1 | January 1 | JAN1 |
| 123E5 | 1.23E+07 | 123E5 |
It hurts most in the columns you match records on. A zip code without its 0 no longer matches the customer's address. An account ID whose last digits turned into zeros matches the wrong account, or none.
An .xlsx file stores every cell with its type, so a text cell is still text when Excel opens it. This page writes that workbook and picks each cell's type itself, using the rules below. Excel has nothing left to guess.
Which cells become numbers
Which values become numbers
| In the CSV | Cell | Why |
|---|---|---|
| 1250.00 | Number | A plain decimal |
| 1,250.00 | Text | Has a comma |
| 07030 | Text | Starts with 0 |
| 80202 | Text | Same column as 07030 |
| +1 201 555 0100 | Text | Starts with + |
- Only numbers Excel can hold exactly become numbers. A value becomes a number cell only when it's a plain decimal like 1250.00 or -12, with no 0 in front of other digits and no more than 15 digits, the most digits Excel keeps exact. Everything else is a text cell with exactly the characters from the CSV. That includes formatted numbers like 1,250.00, $1,200 and 12%, so a SUM formula skips them.
- Code columns stay text all the way down. If any value in a column has a leading 0 or runs past 15 digits, the column holds codes, so every value in it is text. Otherwise 80202 would be a number and 07030 text in the same column, and sorting or matching on it would split them.
- Formulas don't run. Any other value that starts with =, +, - or @, like a phone number written +1 201 555 0100, is a text cell, not a formula. OWASP, the software security group, warns that a spreadsheet reads a CSV cell that starts with = as a formula, and tells you to guard +, - and @ too. That's how a file from someone else's system can run a formula on your computer.
- It fits in one sheet. An Excel sheet holds 1,048,576 rows by 16,384 columns, and a cell holds 32,767 characters. Bigger files are refused, and longer cells are cut to fit, with a line in the report.
The converter reads the CSV the way the standard, RFC 4180, describes. Commas inside quotes stay in their cell, and it works out the separator when it's a semicolon, tab or pipe. Files can be up to 50 MB.
If you'd rather fix it in Excel
Excel can keep the values too, if you don't double-click the CSV. Import it with Data > From Text/CSV and set the risky columns to Text before loading. The steps are on our JSON to CSV page, along with the setting in Excel for Microsoft 365 and Excel 2024 that stops the conversions for good. Both work, but only for the person who does them. Send the CSV to a teammate and their Excel guesses all over again. A workbook carries its cell types with it.
Not sure what's in the file? Open it in the CSV viewer first. It lists the rows with the wrong number of cells, so you fix those before the workbook is made.
Questions
- Is CSV the same as XLSX?
- No. A CSV is plain text and holds one table. An .xlsx file is Excel's workbook format: it can hold several sheets, and it saves each cell's format along with its value.
- How do I turn the workbook back into a CSV?
- Use the Excel to CSV converter. It writes any sheet of an .xlsx file as a CSV, with dates as YYYY-MM-DD and zip codes with their zeros.
- Will dates become Excel dates?
- No. Anything that looks like a date stays text, exactly as written, so a date column sorts as text, not by date. If a column really is dates, convert it in Excel after you open the workbook.
When the CSV is only part of the data
If this CSV is a new customer's export from the system they're leaving, the workbook fixes the easy part. The hard part is what the export left out. Across the sources Rubie's customers migrate from, 95% don't have a clean API or export that captures all the data needed. The rest of the history sits behind a login, in a legacy app, or, as one Rubie customer put it, in "those 250 page PDFs."
Rubie moves that history out of the old system and into your product, without engineering time, so onboarding doesn't wait on the data. By Rubie's own numbers, that cuts the migration timeline by 50-90% on average. See how Migration Playbooks run a migration end to end.