Sub topic 3
How Sheets decides what a value is
This chapter assumes you can type into cells and select ranges, as covered in the previous two chapters. It explains the rules Sheets uses to classify what you type. You will also learn how to check the result and how to override it.
One cell, one type
Every cell holds one value, and that value has a type. Sheets uses these types:
- Number: includes percentages, currency amounts, dates, and times.
- Text: any string of characters, including digits that Sheets did not convert.
- Boolean:
TRUEorFALSE. - Error: for example
#DIV/0!or#N/A.
The type decides how the cell sorts, how functions treat it, and how it aligns. Formatting only changes the display. The type is part of the stored value.
The detection process
When you press Enter, Sheets reads the raw text you typed and applies rules in roughly this order:
- If the text starts with
=, it is a formula, and the stored type is the type of the result. - If the text starts with an apostrophe (
'), the rest is stored as text. The apostrophe is not part of the value and is not displayed. - If the text parses as a number, percentage, currency amount, date, or time under the current locale, Sheets stores a number and applies a matching display format.
- If the text is
TRUEorFALSEin any capitalization, Sheets stores a boolean. - Anything else is stored as text.
What common inputs become
The results below assume a US English locale. The next chapter covers how other locales change them.
| You type | Stored as | Displayed as |
|---|---|---|
| `42` | Number 42 | 42 |
| `1,234.5` | Number 1234.5 | 1,234.5 |
| `12%` | Number 0.12 | 12% |
| `$9.99` | Number 9.99 with currency format | $9.99 |
| `1e3` | Number 1000 | 1,000 |
| `3/4` | Date serial number | 3/4 (the current year is assumed) |
| `2026-11-27` | Date serial number | 11/27/2026 |
| `12:30` | Fraction of a day, 0.520833... | 12:30:00 |
| `007` | Number 7 | 7 |
| `true` | Boolean | TRUE |
| `'007` | Text "007" | 007 |
| `hello` | Text | hello |
Three results often surprise people:
- Leading zeros disappear.
007is a valid number, so it is stored as 7. - Fractions become dates.
3/4matches a date pattern, so you do not get three quarters. - Percentages are stored as fractions.
12%is stored as 0.12, and the percent sign is display formatting.
Dates and times are numbers
Sheets stores a date as the number of days since December 30, 1899. A time is the fractional part of a day. You can see this by changing the cell's format to plain number.
=A2+7If A2 holds a date, this formula returns the date one week later, because adding 7 adds seven days. Two dates subtract to give a number of days.
=B2-A2The result of that subtraction may display as a date. Sheets sometimes copies the date format onto the formula cell. If so, apply a plain number format to see the day count.
Reading the clues in the cell
You can often tell the type without any formulas.
- Alignment. With default alignment, numbers and dates sit on the right, text on the left, and booleans in the center.
- The formula bar. A date shows as typed text in the cell, but the formula bar may show a different form. A number with a currency format shows the bare number when you edit it.
- Format menu. Format > Number shows which format is applied, such as Automatic, Plain text, or Date.
- Green triangle or chip. Some pasted values show a hint when numbers are stored as text.
Alignment is only a hint, because a user can override it. To check a type, use a function.
=ISNUMBER(A2)ISNUMBER returns TRUE for numbers and for dates and times. ISTEXT returns TRUE for text. TYPE returns a code: 1 for number, 2 for text, 4 for boolean, 16 for error, and 64 for array.
=TYPE(A2)Numbers stored as text
The most common data problem is a value that looks like a number but is text. It happens when you paste from another system, when a column has the Plain text format, or when you start the entry with an apostrophe. The symptoms are:
SUMover the range skips those cells and returns a lower total than expected.- Sorting puts "10" before "9", because text sorts character by character.
- Comparisons such as
=A2>5behave unexpectedly.
Sheets does convert text in direct arithmetic. If A2 holds the text "5", then =A2+1 returns 6. But functions that take a range, like SUM and AVERAGE, ignore text cells. A column can therefore work in one formula and fail in another.
To convert, use VALUE:
=VALUE(A2)You can also multiply by 1 (=A2*1). Both turn "5" into 5. Neither fixes text that contains stray characters, such as "5 " with a trailing space or "$5" pasted as plain text. Clean those first, as covered in the chapter on cleaning data.
Setting the format before you type
Format > Number > Plain text tells Sheets to store whatever you type as text. This is the right choice for identifiers that look numeric, such as ZIP codes with leading zeros, phone numbers, and account numbers.
Apply it before entering the data. Changing a cell to Plain text afterward does not restore digits that were already dropped. A stored 7 stays 7, and it will not become "007".
Very long digit strings need the same care. Sheets keeps about 15 significant digits in a number. A 16-digit card number typed as a number will have its last digits changed to zeros. Store such values as text.
Forcing the interpretation you want
Use these techniques to override automatic detection:
- Keep it as text. Type an apostrophe first, such as
'1/2, or format the cell as Plain text. - Enter a date unambiguously. Type
2026-11-27. The year-month-day form avoids confusion between day-first and month-first locales. - Enter a literal formula text. Type
'=SUM(A1:A3)to store the characters instead of evaluating them. - Convert after the fact. Use
VALUE,DATEVALUE, orTEXTin a helper column, then paste the results back as values.
Common errors at a glance
- A total is lower than expected. Some numbers are text. Test with
=ISTEXT(A2)and look for left-aligned values in a numeric column. - A date shows as a five-digit number. The format was reset to Automatic or Number. Reapply a date format.
- An ID lost its leading zeros. It was converted to a number. Reenter it as text.
- A date came out as the wrong day and month. The entry was read under a different locale than you expected.
Exercise
Cell A2 contains the text "250" (left-aligned) and A3 contains the number 100. What does =SUM(A2:A3) return, and what does =A2+A3 return? Explain the difference and give one formula that makes SUM include the text value.
Show answer
=SUM(A2:A3) returns 100, because SUM ignores text cells in a range. =A2+A3 returns 350, because arithmetic operators convert text that looks like a number. To make a sum include the value, convert it first, for example =VALUE(A2)+A3 or =SUM(VALUE(A2),A3). Either returns 350.
Exercise
You need to store the ZIP code 02134 in a cell. You type 02134 and see 2134. Name two ways to keep the leading zero when you retype it.
Show answer
Type an apostrophe first ('02134), or format the cell as Plain text (Format > Number > Plain text) before typing. In both cases the value is stored as text. Reformatting after the zero was dropped does not restore it.