Quick answer
Import the CSV with explicit settings rather than opening it and accepting automatic conversions. In Excel, use Data → From Text/CSV → Transform Data and keep identifiers as Text. In pandas, specify string types when reading the file, then convert dates with a known format. Check the delimiter, encoding, and imported values against the original before analyzing anything. (support.microsoft.com)
1. Decide what each column means before importing
A value containing only digits is not necessarily a number you should calculate with. Customer IDs, postal codes, and account codes usually identify something. Preserve their characters, including leading zeros, by importing them as text. Microsoft specifically recommends text handling for values such as postal codes and account numbers. (support.microsoft.com)
Dates need a separate decision. Does 03/04/2026 mean March 4 or April 3? Both interpretations are valid. Your computer’s regional settings are not evidence of what the exporting system intended; Power Query uses locale when interpreting text as dates. (learn.microsoft.com)
Before importing, write a small schema: a list of columns and their intended meanings and types.
For the practice file below, use these rules:
| Column | Meaning | Import rule |
|---|---|---|
customer_id |
Customer identifier | Text; preserve every digit |
customer_name |
Display name | Text; preserve accents and punctuation |
postal_code |
Postal identifier | Text |
signup_date |
Signup date | Read as text, then parse day/month/year |
notes |
Free-text note | Text |
For an actual export, ask its provider to confirm the date convention, encoding, delimiter, and missing-value markers. If the date convention is unknown, keep the dates as text and mark them unresolved. Do not choose an interpretation simply because it produces no errors.
2. Inspect the raw file and try this synthetic example
Keep an untouched copy of the original. Inspect a working copy in a text editor before opening it in a spreadsheet.
Save the following synthetic practice data as customers.csv using UTF-8 encoding. It represents one row per customer, not real customer records.
customer_id,customer_name,postal_code,signup_date,notes
000123,"García, Ana",02108,03/04/2026,"Requested email, not phone"
000124,Sam Patel,00501,13/04/2026,""
000125,Zoë Chen,10001,04/03/2026,"Code NA retained"
The example deliberately includes leading zeros, accented characters, ambiguous dates, and commas inside quoted fields.
A delimiter separates fields. Here, it is a comma. Double quotes protect commas that belong inside a value: "García, Ana" is one field, not two. CSV readers support delimiters and quoting rules; splitting every line on commas is not an equivalent method. (docs.python.org)
For this example, the declared date convention is day/month/year. The expected values are:
| Customer ID | Customer name | Postal code | Signup date, displayed as year-month-day |
|---|---|---|---|
000123 |
García, Ana | 02108 |
2026-04-03 |
000124 |
Sam Patel | 00501 |
2026-04-13 |
000125 |
Zoë Chen | 10001 |
2026-03-04 |
The second customer’s notes field is intentionally empty. The quotation marks are CSV syntax, not part of the imported name or note.
When inspecting another file, look for semicolons or tabs instead of commas. Also confirm that the first record contains column names rather than a report title or export message.

3. Import into Excel without accepting guessed types
These steps target desktop Excel with the Power Query Text/CSV importer. Button wording and available controls can vary by platform and release. Microsoft documents From Text/CSV and Transform Data as the route for editing data before loading it. (support.microsoft.com)
- Open a blank workbook.
- Select Data → From Text/CSV and choose
customers.csv. - Set Delimiter to comma.
- Set File Origin to UTF-8.
- If available, set Data Type Detection to Do not detect data types. This makes columns default to Text.
- Select Transform Data, not immediate Load. (learn.microsoft.com)
In the editor, confirm that the first row supplies the headers. Set all five practice columns to Text initially.
Inspect Applied Steps for an automatically added Changed Type step. Power Query can add this step during automatic detection. If it has already converted the identifiers to numbers or guessed the dates, remove that step before applying your intended types. Check that the earlier step still shows the original characters. (learn.microsoft.com)
This order matters: prevent the unwanted conversion rather than converting a damaged value back to text afterward.
Before loading, check the preview:
000123still has six characters.02108still begins with zero.García, Anaoccupies one column.- The accent in García and the diaeresis in Zoë remain readable.
- There are five columns.
Microsoft also provides Automatic Data Conversions controls in Microsoft 365 and Excel 2024, including options affecting leading zeros. These are useful safeguards, but they do not replace checking the import preview and specifying column types. (support.microsoft.com)
4. Convert Excel dates using the source convention
Keep signup_date as text until the identifiers and file structure look correct.
For an audit-friendly practice workflow:
- Duplicate
signup_date. - Rename the original
signup_date_raw. - On the duplicate, select Change Type → Using Locale.
- Choose Date and English (United Kingdom) to interpret this example’s day/month/year values.
- Confirm that
03/04/2026becomes April 3, 2026.
Microsoft documents Using Locale for converting dates whose source convention differs from the computer’s locale. It also recommends checking extracted day, month, and year values when the displayed date is uncertain. (learn.microsoft.com)
A useful spot check is the first row: its day must be 3, its month 4, and its year 2026. The third row must have day 4 and month 3.
Do not use a different display format as a repair for a wrongly interpreted date. First establish the correct underlying date, then choose how to display it. Microsoft distinguishes locale-based interpretation from the formatting of date values. (learn.microsoft.com)
After validation, select Close & Load. Keep the raw date column until your checks are complete.
5. Read the same CSV in pandas with explicit types
This example requires Python and pandas. It uses APIs documented in pandas 3.0.6; record your installed version with pd.__version__ when saving a reproducible workflow.
Read the fields as strings first:
import pandas as pd
df = pd.read_csv(
"customers.csv",
sep=",",
encoding="utf-8",
quotechar='"',
dtype="string",
keep_default_na=False,
on_bad_lines="error",
)
Here, dtype="string" protects digit-based identifiers. keep_default_na=False, without additional na_values, preserves textual fields rather than interpreting default missing-value markers. The empty notes field therefore stays an empty string. on_bad_lines="error" raises an error for records with too many fields; it is not a complete validation system. (pandas.pydata.org)
Convert the date into a new column:
df["signup_date_parsed"] = pd.to_datetime(
df["signup_date"],
format="%d/%m/%Y",
errors="raise",
)
The format specifies day, month, and four-digit year. errors="raise" stops conversion when a value cannot be parsed, rather than silently accepting a missing result. An explicit format is preferable here to dayfirst=True, which pandas documents as a preference rather than a strict rule. (pandas.pydata.org)
Display the results for comparison:
check = df[
["customer_id", "postal_code", "signup_date_parsed"]
].copy()
check["signup_date_parsed"] = (
check["signup_date_parsed"].dt.strftime("%Y-%m-%d")
)
print(check.to_string(index=False))
Expected values:
customer_id postal_code signup_date_parsed
000123 02108 2026-04-03
000124 00501 2026-04-13
000125 10001 2026-03-04
For a wider dataset, use a dtype dictionary to specify individual text columns and deliberately assign numeric types to genuine quantities. Pandas supports per-column type definitions. (pandas.pydata.org)
6. Validate values, not just whether the import succeeded
A successful import is only the start. Use checks based on the file’s declared rules.
For the synthetic example:
assert df.shape == (3, 6) # Five source columns plus parsed date
assert df["customer_id"].tolist() == [
"000123", "000124", "000125"
]
assert df["postal_code"].tolist() == [
"02108", "00501", "10001"
]
assert df.loc[0, "customer_name"] == "García, Ana"
assert df.loc[0, "notes"] == "Requested email, not phone"
assert df.loc[1, "notes"] == ""
assert df["signup_date_parsed"].dt.strftime(
"%Y-%m-%d"
).tolist() == [
"2026-04-03", "2026-04-13", "2026-03-04"
]
These are expected results for the supplied practice data, not universal customer-data rules.
For actual files, prioritize:
- Structure: expected column names and no unexpected extra columns.
- Completeness: imported record count compared with the exporter’s count, when available.
- Identifiers: exact comparisons for leading-zero and long-code examples.
- Text: names containing accents, punctuation, or non-Latin characters.
- Dates: ambiguous dates plus dates whose day exceeds 12.
- Missing values: intentional blanks distinguished from unexpected losses.
Do not equate physical line count with record count: quoted CSV fields can contain line breaks. A CSV-aware reader handles these differently from simple line splitting. (docs.python.org)
In Excel, compare the loaded table with the original text and the expected table above. Review conversion errors before building summaries or charts.
7. Avoid repairs that hide import mistakes
Padding every postal code with zeros.
Do not assume every postal system has the same length or uses digits only. For this practice file, five-character checks are appropriate because that rule is declared. For unknown data, recover the original value instead of guessing missing characters.
Applying a custom number format instead of preserving text.
A format such as 00000 can make a numeric value look like a five-digit code inside Excel. It is not the same import decision as storing the identifier as text. Microsoft presents custom formatting as a workbook-focused option and text import as the method for preserving original values. (support.microsoft.com)
Trying encodings until the error disappears.
Use the exporter’s documented encoding and inspect representative names. Power Query exposes File Origin because character-set handling matters; Microsoft also documents a Power Query route for opening UTF-8 CSV files without a byte-order mark. (learn.microsoft.com)
Silently skipping troublesome records.
Avoid treating on_bad_lines="skip" as a repair: pandas skips those malformed records without warning. Investigate and document the issue instead. (pandas.pydata.org)
Saving over the only original.
Keep the source untouched. Save the workbook or analysis separately, together with the import settings and checks.
Your final handoff should state the delimiter, encoding, identifier types, date convention, missing-value policy, and unresolved issues. That gives the next analyst a repeatable import—not merely a table that looks plausible.