Sub topic 5
Separator Type and Converting Text to Numbers, Dates, and Formulas
Assume you can use Google Sheets cells, sheets, and basic formulas. You should also know what a CSV file is and understand that a CSV stores values as text separated by characters such as commas or tabs.
When you import a delimited file, Google Sheets must answer two questions:
- Which character separates one column from the next?
- Should each value remain text, or should Sheets convert it into a number, date, or formula?
The choices affect how the imported data behaves in calculations, sorting, filtering, and lookups.
Choosing the separator type
A delimiter is the character between fields in a text file. Common delimiters include:
| File style | Example row | Separator |
|---|---|---|
| Comma-separated | `1001,London,450` | Comma |
| Tab-separated | `1001 London 450` | Tab |
| Semicolon-separated | `1001;London;450` | Semicolon |
In the import dialog, choose the separator that matches the file. Google Sheets often detects the separator automatically, but automatic detection can fail when the file uses an unusual delimiter or contains inconsistent rows.
For example, a semicolon-separated file may appear in one column if Sheets assumes commas. Choose Custom, then enter ; as the separator.
A separator inside a quoted field usually does not divide the field. For example:
1001,"London, United Kingdom",450The comma inside the city name belongs to the second field. A correctly formatted CSV parser should keep London, United Kingdom in one cell.
Deciding whether to convert values
The import dialog includes an option to convert text to numbers, dates, and formulas. When enabled, Sheets examines each field and assigns a likely type.
For example:
00127,2026-03-08,=SUM(2,3)The results might be interpreted as:
00127becomes the number127.2026-03-08becomes a date.=SUM(2,3)becomes a formula.
This can be useful when the file contains measurements, prices, or dates that you need to calculate with. It can also change data that must remain exactly as written.
Disable conversion when values are identifiers, codes, account numbers, or text that may begin with = or +. A product code such as 00127 is not the same as the number 127.
How conversion interacts with locale
A spreadsheet locale controls conventions such as decimal marks and date order. In one locale, 1,25 may mean one and a quarter. In another, the comma may separate columns, and the value may be read differently.
Dates are especially risky. The text 03/08/2026 could mean March 8 or August 3, depending on the locale. Prefer an unambiguous format such as 2026-03-08, and check the spreadsheet's locale before importing.
The same issue applies to decimal values. If the file uses semicolons as separators and commas as decimal marks, selecting the correct separator does not always solve every conversion problem. Verify the resulting values after import.
A safe import workflow
Use this sequence for a delimited file:
After importing, inspect representative rows rather than trusting the preview alone. Test a numeric column with SUM, check a date with a date format, and compare an identifier with its original text.
If a five-digit code lost its first zero, you can display it again with:
=TEXT(A2, "00000")This changes the display to five digits. It does not recover information if the original code had a different required length. For a whole imported text column with unwanted spaces, use:
=ARRAYFORMULA(TRIM(A2:A))Keep the original import on a separate sheet when the source data may need auditing. Perform cleanup on a working copy so that you can compare the converted values with the original fields.
Exercise
A CSV contains 00741;03/08/2026;12,50. The file uses semicolons, codes must keep leading zeros, and the spreadsheet locale uses day/month/year dates. Which separator and conversion choice should you use?
Show answer
Choose a custom semicolon separator and disable conversion. Preserve the code as text, then verify or convert the date and decimal value deliberately after import.