Tech Behind ThingsHow the ordinary machinery actually works

Software

How A Spreadsheet Decides What Your Typing Means

A spreadsheet guesses the type of everything you enter, converting text into dates and numbers by rules that are invisible until they mangle your data.

Vibrant and engaging code displayed on a computer screen, showcasing programming concepts.
Photograph by Seraphfim Gallery via Pexels
Editorial note. Independent reporting and analysis. Nothing here is sponsored or paid for. How we work.

A spreadsheet cell holds a value with a type, but you only ever type characters. The program infers the type from the characters, and that inference is responsible for a large share of ruined data.

Every entry is parsed before it is stored

When you finish typing, the program tests the string against patterns in order: is it a number, a date, a time, a fraction, a formula, and only otherwise text.

The first pattern that matches wins, and the original characters are discarded. What remains is a value plus a display format that reconstructs something similar on screen.

The distinction matters because the stored value is what formulas, sorts and exports use. The characters you typed no longer exist anywhere.

Dates are the most aggressive conversion

Anything shaped like two or three numbers separated by slashes or dashes is read as a date, including identifiers, part codes and measurement ranges that were never dates.

Internally a date becomes a count of days from a fixed origin, so once the conversion happens the original text cannot be recovered by changing the format afterward.

The fix has to happen before entry, by formatting the column as text or by prefixing an apostrophe, which tells the parser to stop guessing.

Leading zeros disappear because numbers do not have them

Codes that begin with zero are read as numbers, and a number has no memory of how it was written, so the zeros vanish on entry.

The same applies to long digit strings, which lose precision once they exceed what the underlying floating-point representation can hold exactly.

Both problems appear only in the data, not on screen during entry, which is why they are usually discovered by whoever receives the file rather than whoever created it.

Regional settings change the parse

Whether a period or a comma separates decimals, and whether the day or the month comes first, are read from system settings rather than from the file.

The same file opened on two machines can therefore produce two different sets of values, with some entries converting to dates on one and remaining text on the other.

Delimited text files are especially exposed, since they carry no type information at all and hand every decision to the importing program.

Import dialogs exist to take the guessing away

Most spreadsheets offer an import path that lets you set the type of each column explicitly before any parsing happens.

Opening a file by double-clicking it skips that path entirely and applies the default rules, which is the difference between a clean import and a corrupted one.

The habit worth building is to treat any identifier as text by default, since identifiers only look like numbers and never benefit from being treated as ones.

Questions readers ask

Why does a copied folder show a different size?

Block allocation, compression and metadata differ between filesystems. The contents are identical while the space consumed is not.

Is defragmenting a solid state drive useful?

No. There is no seek penalty to remove, and rewriting every block consumes write endurance for no measurable benefit.

Softwarestoragesoftwareoperating systemsdata
Junko Ishida
Contributing writer, Tech Behind Things

Junko covers batteries, charging and energy density, and is unimpressed by most battery claims.

Also by Junko Ishida