Data Types in Spreadsheets#
š¦ Data Preparation 𧬠Data Types & Structure Lesson 005
ā Previous Ā· Next ā¶ Ā· ā Section Ā· ā Hub
Important
⨠AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
The type behind the cell#
The spreadsheet lessons of Section 2 treated cells as holding āvaluesā; here we get specific about what kind of value a cell holds, because a spreadsheet quietly assigns every cell a data type, and that type governs how the cell behaves ā what you can compute, how it sorts, and whether a formula works or throws an error.
The core spreadsheet types#
Text (string) ā letters, words, or any characters treated as label rather than quantity: names, categories, IDs. Text is left-aligned by default and cannot be summed. Numbers stored as text (a common import problem) look numeric but refuse arithmetic ā a frequent cause of the
#VALUE!errors from earlier.Number ā numeric values you can calculate with: integers and decimals, right-aligned by default. Currency and percentage are number formats ā the underlying value is a number, displayed with a symbol or scaled by 100.
Date and time ā stored internally as serial numbers so they can be subtracted and sorted chronologically, but displayed as calendar dates. This dual nature is why a ādateā that is really text will sort alphabetically (wrongly) and refuse date arithmetic.
Boolean ā logical
TRUE/FALSEvalues, produced by comparisons and consumed byIFand filters.
Why the type matters#
The type determines the valid operation, exactly as the measurement levels did: you sum numbers, sort dates chronologically, and count text. The everyday failures trace to a mismatch between a cellās actual type and its apparent one ā the classic being numbers or dates imported as text, which look right and compute wrong. Recognising and fixing these is core Prepare-phase work, and it connects directly to the value types (nominal, ordinal, discrete, continuous) of the previous lessons: the spreadsheet type is how those abstract levels are physically stored.
Checking and fixing types#
Two habits catch most trouble. Watch the alignment: numbers and dates that sit left-aligned are secretly text and will misbehave. Convert deliberately: use the spreadsheetās type-conversion tools (or a helper column) to turn text-numbers into real numbers and text-dates into real dates before computing, rather than discovering the problem inside a broken formula. The cleaning section builds these fixes into a systematic workflow.
The caveat#
Spreadsheets guess types automatically, and the guess is sometimes wrong ā
famously, identifiers that look like numbers (a product code 00123) lose
leading zeros, and codes that look like dates get silently converted. Automatic
typing is a convenience that occasionally corrupts data on import, so part of
preparation is verifying that each columnās type is the one you intended, not
merely the one the software chose. The next lesson steps up from individual
cells to the table they form.
Hint
See also
Source article Adapted (context, re-expressed) in our own words from: https://insightful-data-lab.com/2023/09/04/data-types-in-spreadsheets/ (insightful-data-lab.com).