Sub topic 7
How Sheets Treats Text, Numbers and Dates
This chapter assumes you can open a spreadsheet, click into a cell and type, and that you know what a cell reference such as B2 means. It explains how Sheets decides what kind of value you typed. That decision controls alignment, sorting, formulas and many common errors.
Why data types matter
Every cell holds a value, and Sheets gives that value a type. The main types are text, numbers, dates and times, and booleans (TRUE or FALSE). Sheets chooses the type when you press Enter, based on what you typed and on your spreadsheet's locale.
The type decides what the value can do:
- Numbers can be added, averaged and multiplied.
- Dates are stored as numbers, so you can subtract them to find the days between two dates.
- Text can be joined and searched, but it cannot be added.
If Sheets guesses wrong, formulas return unexpected results, and the sheet gives you little warning. Learning to read the signs of each type lets you catch these problems early.
How Sheets decides: automatic detection
When you type into a cell, Sheets tries to interpret the entry:
- If it looks like a number (
42,3.14,-7,1,250), Sheets stores it as a number. - If it matches a date or time pattern in your locale (
3/14/2026,14 Mar 2026,9:30), Sheets stores it as a date or time. - If it is
TRUEorFALSE, Sheets stores a boolean. - Otherwise, Sheets stores the entry as text.
A reliable first check is alignment. With default formatting, numbers, dates and times align to the right of a cell. Text aligns to the left. If a column of figures sits on the left edge, Sheets probably treats those figures as text.
| What you type | Stored as | Default alignment |
|---|---|---|
| `Invoice` | Text | Left |
| `250` | Number | Right |
| `12/05/2026` | Date | Right |
| `TRUE` | Boolean | Center |
| `'250` | Text | Left |
Alignment is only a default. If someone applied manual alignment, it hides this clue. The reliable check is a function, shown later in this chapter.
Text
Text, also called a string, is any value that Sheets does not read as a number, date or boolean. Names, descriptions, product codes and notes are all text.
Numbers that should stay text
Some values contain only digits but are identifiers, not quantities. Examples are phone numbers, postal codes, and product codes such as 00417. You never add two phone numbers together, and the leading zeros matter.
If you type 00417, Sheets reads it as the number 417 and drops the zeros. There are two ways to keep it as text:
- Type an apostrophe first:
'00417. The apostrophe is not stored in the cell and does not display. It only tells Sheets to treat the entry as text. - Set the column format to plain text before typing. Select the column, then choose Format, Number, Plain text.
Joining text
The & operator joins values. It works on text and on numbers.
=A2&" "&B2If A2 holds Ada and B2 holds Lovelace, the result is Ada Lovelace. The " " in the middle is a space written as a text value. Text values in formulas always go inside double quotation marks.
Numbers
A number is a value Sheets can calculate with. Sheets stores the number you typed, and the display format only changes how it looks.
Display versus stored value
This distinction causes many mistakes. Suppose you type 2.456 in a cell and then format the cell to show one decimal place. The cell shows 2.5, but Sheets still stores 2.456. A formula that uses that cell works with 2.456.
So a column of values that each display with two decimals may add up to a total that appears to be off by a cent. The total is correct for the stored values. If you need the stored value to change, use the ROUND function:
=ROUND(B2, 2)This returns the value in B2 rounded to two decimal places.
Percentages and currency
Typing 15% stores the number 0.15 and displays it as a percentage. Typing $20 stores 20 with a currency format applied. In both cases the cell holds a real number, and formulas can use it directly. The % or $ is part of the formatting, not part of the value.
Locale and separators
Your spreadsheet's locale sets how Sheets reads separators. In a United States locale, 1,250.50 means one thousand two hundred fifty and a half. In many European locales, the comma is the decimal separator, and 1.250,50 means the same amount. If you type a number in a format your locale does not expect, Sheets may store it as text.
To check or change the locale, choose File, Settings, and look at the Locale setting on the General tab. The same setting controls date order, so it matters in the next section.
Dates and times
Dates are the type most likely to surprise you. Sheets stores a date as a serial number: the count of days since December 30, 1899. The date December 31, 1899 is 1. A time is a fraction of a day, so noon is 0.5.
This is why date arithmetic works. A date is a number, so you can subtract one from another:
=C2-B2If B2 holds a start date and C2 holds an end date, the result is the number of days between them. You may need to format the result cell as a number, because Sheets sometimes applies a date format to the answer.
Reading what is stored
Select a cell that contains a date and choose Format, Number, Number. The date turns into its serial number. Choose Format, Number, Date to switch back. This is a quick way to confirm that a cell holds a real date and not text that looks like one.
Date order depends on locale
The entry 03/04/2026 is ambiguous. In a US locale, it means March 4. In a UK locale, it means 3 April. Sheets interprets it according to the spreadsheet's locale, not your computer's settings. If you share a spreadsheet with people in other countries, the locale is stored with the file, so everyone sees the same interpretation. Typing dates in an unambiguous form such as 2026-04-03 or 3 Apr 2026 avoids confusion.
Today's date
The function TODAY() returns the current date.
=TODAY()It recalculates whenever the sheet is opened or changed, so it is useful for ages, deadlines and countdowns, but not for recording the date something happened. A recorded date should be typed in as a fixed value. You can type the shortcut Ctrl+; (Windows, ChromeOS) or Cmd+; (Mac) to insert today's date as a fixed value in the active cell.
Dates as text
If Sheets cannot read an entry as a date, it keeps it as text. Typical causes are a locale mismatch (typing 31/12/2026 in a US locale, where there is no month 31), extra words, or an unusual separator. The cell then aligns left, and date calculations return an error or a wrong result.
Checking and converting types
Sheets provides functions that report the type of a value. Each returns TRUE or FALSE.
| Function | Returns TRUE when the cell holds |
|---|---|
| `ISNUMBER(A2)` | A number, including a date or time |
| `ISTEXT(A2)` | Text |
| `ISBLANK(A2)` | Nothing at all |
Dates count as numbers for ISNUMBER, because they are stored as numbers. For a cell you suspect is text-that-looks-like-a-date, ISNUMBER returns FALSE, which confirms the problem.
To convert, use these functions:
VALUE(A2)turns text such as"250"into the number 250.DATEVALUE(A2)turns text such as"2026-04-03"into a date serial number.TEXT(A2, "yyyy-mm-dd")turns a number or date into text in the pattern you give.
=VALUE(A2)After DATEVALUE, apply a date format to the result cell. Otherwise you will see the serial number.
How the types flow
The diagram shows what happens to an entry from the moment you type it.
Common errors and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
| Numbers sit on the left and `SUM` ignores them | The values are text | Use `VALUE`, or retype after setting the column to a number format |
| `SUM` result is lower than expected | Some cells hold text, and `SUM` skips text | Check with `ISNUMBER` and convert |
| Leading zeros disappear | Entry read as a number | Use `'` or Plain text before typing |
| Date shows as a five-digit number such as `46115` | Cell has a number format | Apply a Date format |
| Day and month are swapped | Locale does not match the date order you typed | Change the locale or type `yyyy-mm-dd` |
| Total looks off by a small amount | Display rounding hides the stored decimals | Use `ROUND` in the formula |
| `#VALUE!` in a formula | A formula tried to do math on text | Convert the text to a number first |
Worked example
Suppose you pasted this into a sheet, and the totals look wrong.
- In
D2, type=ISNUMBER(B2)and fill it down the column. - Any row that returns FALSE has text in
B. - In
E2, type=VALUE(B2)and fill it down. - Copy column
E, then use Edit, Paste special, Values only over columnB. This replaces the text with real numbers. - Delete the helper columns
DandE.
Now =SUM(B2:B6) includes every row.
Exercise
Cell A2 shows 00417 after you type '00417, and A3 shows 417 after you type 00417 into a cell with the default format. Why do they differ, and what does =ISNUMBER(A2) return for A2?
Show answer
The leading apostrophe tells Sheets to store the entry as text, so the zeros are kept and the apostrophe itself is not shown. Without it, Sheets reads 00417 as the number 417 and drops the zeros. =ISNUMBER(A2) returns FALSE, because A2 holds text.
Exercise
B2 holds the date 1 March 2026 and C2 holds the date 15 March 2026. You enter =C2-B2 in D2 and it shows 3/14/1900 (or a similar date) instead of 14. What happened and how do you fix it?
Show answer
Sheets applied a date format to the result cell, so it displays the serial number 14 as a date. Select D2 and choose Format, Number, Number (or Automatic) to show 14.
Exercise
A column of sales figures totals 410 with SUM, but you expected 560. COUNT returns 4 and COUNTA returns 5 for the same range. What does that tell you, and what is your next step?
Show answer
COUNT counts only numbers and COUNTA counts all nonblank cells, so one cell holds text. Use ISNUMBER on each cell to find the one that returns FALSE, convert it with VALUE or retype it, and the total will include it.