Recent chats
ASKGEEZ Q&A GUIDETechnology & devices

Why does my spreadsheet turn numbers into dates?

Quick answer

A spreadsheet may interpret an entry as a date based on its automatic data-format rules, rather than keeping the characters exactly as entered. This can also affect codes with leading zeros or long digit strings. For identifiers that must stay unchanged, import or store the column as text. When opening a CSV in Excel, use the import workflow, check the column formats in the preview, and verify the result before committing. [S1] [S2]

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

Why did I type something like 3-4 and end up seeing a date? I meant it as a code, not a date.

Geez

The spreadsheet may have interpreted your entry as date-like data and converted it automatically. In Excel, automatic conversion can also remove leading zeros from text-like entries or limit long numeric values to 15 digits. [S1]

The key question is what the value means. If 3-4 is an identifier, label, or code whose characters must stay exactly as written, it is text—not a quantity to calculate with. Import or store that column as text. If it represents a real date or a number you need to calculate with, choose the appropriate data type instead.

Follow-up question

How can I tell whether the sheet changed the value or just how it looks?

Geez

First, compare the original source with the value in the spreadsheet. If the source says 003-4 and the spreadsheet shows 3-4 or a date, treat that as a possible conversion, not just a cosmetic display difference. For important identifiers, verify the saved or imported value against the original before using or sharing it.

A useful rule: account numbers, product codes, postal codes, and other labels are usually identifiers even when they contain only digits. Preserve them as text when leading zeros, punctuation, or every digit matters. Do not rely on a date-looking display as proof that the original entry is intact.

Follow-up question

This happens when I open a CSV. What should I do before opening it?

Geez

In Excel, opening a CSV directly can apply the current default data-format settings and change values such as codes with leading zeros. Microsoft recommends using the import workflow when you need more control over column formats. The Text Import Wizard and Power Query provide ways to inspect or transform columns, though the available choices depend on your Excel version. Check the import preview before committing. [S2]

For a column of identifiers, select or set its type as text in the import process if that option is available. Then compare representative entries with the CSV source, including one with leading zeros and one with a long run of digits. Avoid assuming every column should be text: columns intended for arithmetic may need to remain numeric.

Follow-up question

Can you show me how to decide for a small sample?

Geez

Suppose a CSV contains this sample:

item_code,quantity
0034,12
0042,7

If item_code is a label, keep that column as text so 0034 remains 0034. If quantity is a count used in calculations, keep it as a number. During import, inspect both columns and their preview; don’t let a type choice for one column decide the other. After importing, compare the two codes and quantities against the source sample. This is an illustration, not a guarantee that a particular version or configuration has identical menus.

Follow-up question

What about a code that is a long string of digits? It looks like a number.

Geez

If it is an identifier, treat it as text even if it contains only digits. Excel’s documented automatic conversion can limit long numeric values to 15 digits, so a long identifier is especially important to import or store as text before relying on it. [S1]

The supplied guidance does not establish the exact menu names for every Excel version, nor does it say that every spreadsheet program behaves the same way. Check the settings and preview in your own version, then verify the imported values against the source. If a value has already changed, return to the original file or source and re-import it with the identifier column set to text; don’t assume changing its display format restores lost characters.

A quick decision check: Is this a quantity you will calculate with, or an identifier whose characters must be preserved? Use a numeric type for the former and text for the latter. For CSV imports in Excel, use the import workflow, inspect the preview, and verify the result—especially for leading zeros, date-like codes, and long digit strings. [S1] [S2]

A practical checklist

  • Decide whether each column is a quantity or an identifier.

  • Mark identifier columns as text during import or before entering values.

  • For CSVs in Excel, use an import workflow when column control matters.

  • Inspect the preview for date-like entries, leading zeros, and long digit strings.

  • Compare imported sample values with the original source before relying on them.

A few more useful answers

Should I make every column in the CSV text?

No. Use text for identifiers that must retain their exact characters, and a numeric type for values intended for arithmetic. Choose the type column by column.

Does changing a cell’s display format recover digits that were already changed?

The supplied guidance does not establish that. If an identifier appears to have changed, check it against the original source and re-import with that column set to text.

Will the same import steps look identical in every Excel version?

No exact menus are established here. Microsoft notes that relevant choices depend on the Excel version, so inspect the options and preview available in your version. [S2]

Sources

References used for this guide.

  1. [S1] Data import and analysis options in Excel
    support.microsoft.com · Checked
  2. [S2] Import or export text (.txt or .csv) files
    support.microsoft.com · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work