edubun
English
1 / 19

2 / 6 · Intro

Numbers, text and dates

Type 007 into a cell and both Excel and Google Sheets store the number 7. The two zeros are gone unless you start with an apostrophe.

Jump to the 10 practice questions

You will learn

  • Tell numbers, text, logical values and dates apart
  • Read a date as a serial number

Before this: Cells, rows, columns and ranges

1Explain

What a cell can hold

When you type into a cell and press Enter, the spreadsheet decides what kind of value you typed. There are four kinds you meet every day. A number is something it can calculate with, such as 42, 3.5 or 12%. Text is everything else, such as a name or a product code. A logical value is TRUE or FALSE. An error value, such as #DIV/0!, is what a formula produces when it cannot give an answer. A cell can also be empty, which is different from a cell that holds 0.

2Explain

Left or right in the cell

You can usually tell the kind by looking. With the standard settings, numbers line up against the right edge of the cell and text lines up on the left. A column of prices with one value stuck on the left is therefore a warning sign. That value was stored as text and will be skipped by SUM. In the lab below, the panel names the kind of every cell you select, which saves guessing.

3Problem

A value on the left

With standard settings, a value sits against the left edge of its cell. What is it most likely to be?

Hint

Standard settings: numbers right, text left.

Solution

Answer: Text

Numbers, dates and percentages are all numbers and line up on the right; text lines up on the left.

4Explain

Leading zeros and the apostrophe

Some things look like numbers but are really labels: ZIP codes such as 02134, employee numbers such as 007, phone numbers that start with 0. Type them plainly and the spreadsheet turns them into numbers and drops the leading zeros. To keep them, type an apostrophe first: '02134. The apostrophe tells the program to store text, and it is not shown in the cell. Long identifiers are a second reason to use text. Microsoft gives Excel a number precision of 15 digits, so a 16-digit card number stored as a number loses its last digit.

5Problem

Typing 007

You type 007 into an empty cell. What number is stored?

Hint

The leading zeros are dropped.

Solution

Answer: 7

It is read as a number, and leading zeros are not part of a number.

6Problem

Keeping 02134

How do you keep a ZIP code such as 02134 exactly as typed?

Hint

One character in front.

Solution

Answer: Type '02134

The apostrophe stores the entry as text and is not displayed.

7Explain

Percentages and text that looks like numbers

Percentages work the other way. Typing 12% stores the number 0.12 and shows it as 12%, so =A5*100 gives 12. Text that looks like a number is not hopeless either: Microsoft's page on operators shows that ="1"+"2" gives 3, because the plus sign makes Excel convert text it can read as a number. Functions such as SUM are stricter and skip text in a range, which is why a column of numbers stored as text can quietly add up to 0.

8Problem

12% times 100

You type 12% into A5. What does =A5*100 return?

Hint

12% is stored as 0.12.

Solution

Answer: 12

12% is stored as 0.12, and 0.12 × 100 = 12.

9Problem

="1"+"2"

What does ="1"+"2" return in Excel?

Hint

The plus sign converts what it can.

Solution

Answer: 3

The plus sign makes Excel convert text it can read as numbers: 1 + 2 = 3.

10Explain

Dates are numbers in disguise

A date in a spreadsheet is stored as a serial number: a count of days. Microsoft's page on date systems gives the example that July 5, 2011 is stored as 40729 in Excel's 1900 date system, the default in current Excel for Windows and Mac. Older Mac versions used a 1904 system, where the same day is 39267, exactly 1,462 days less. Google's DATE help says Sheets counts the days since December 30, 1899, which gives the same 40729 for that day.

You typeStored asShown as
007the number 77
'007the text 007007
12%the number 0.1212%
2011-07-05the number 40729a date
TRUEa logical valueTRUE
3+4the text 3+4 (no = sign)3+4

11Explore

Dates as day counts

Counting days from 30 December 1899 gives the same serial numbers as Excel for any date after February 1900.

Date
const day = new Date("2011-07-05T00:00:00Z");
const base = new Date("1899-12-30T00:00:00Z");
console.log((day - base) / 86400000);
Output
40729

12Problem

5 July 2011

In Excel's 1900 date system, what serial number is July 5, 2011?

Hint

Pick it in the box above.

Solution

Answer: 40729

Microsoft's own example: 40729 (39267 in the 1904 system).

13Problem

The next day

So what serial number is July 6, 2011?

Hint

One more day, one more.

Solution

Answer: 40730

One day later is one more: 40729 + 1.

14Problem

1900 and 1904

How many days apart are Excel's 1900 and 1904 date systems?

Hint

Four years and a day.

Solution

Answer: 1462

40729 − 39267 = 1,462 days, four years and one day.

15Problem

Day zero in Google Sheets

From which day does Google Sheets count dates?

Hint

The same base the code uses.

Solution

Answer: 30 December 1899

Google's DATE help: the days since December 30, 1899.

16Problem

Digits of precision

How many digits of precision does Microsoft give for Excel numbers?

Hint

Microsoft gives fifteen.

Solution

Answer: 15

The specifications list "Number precision: 15 digits", so 16-digit IDs belong in text.

17Explore

Practice in the grid

Decide whether a column represents quantities or identifiers before entering a large list. Quantities can sensibly be added or compared by size; an identifier distinguishes one record from another. Adding employee identifiers does not produce a useful total, even if the entries contain only digits. Choosing text for identifiers protects their written form.

Loading

Drag to turn. Scroll or pinch to zoom.

Select each cell in column A and read the panel: 007 became 7, the apostrophe kept 007 as text, the date is 40729, and 3+4 without an = sign is only text. A8 shows the date as its serial number.

18Practice

Days between two dates

serial(iso) is given. Finish daysBetween(a, b) so that it returns how many days b is after a, by subtracting serial numbers.

Expected output
1
358
2
Your code
function serial(iso) {
  const day = new Date(iso + "T00:00:00Z");
  const base = new Date("1899-12-30T00:00:00Z");
  return (day - base) / 86400000;
}
function daysBetween(a, b) {
  return 0;
}
console.log(daysBetween("2011-07-05", "2011-07-06"));
console.log(daysBetween("2026-01-01", "2026-12-25"));
console.log(daysBetween("2024-02-28", "2024-03-01"));
Hint

The later date has the bigger serial number.

A solution
function serial(iso) {
  const day = new Date(iso + "T00:00:00Z");
  const base = new Date("1899-12-30T00:00:00Z");
  return (day - base) / 86400000;
}
function daysBetween(a, b) {
  return serial(b) - serial(a);
}
console.log(daysBetween("2011-07-05", "2011-07-06"));
console.log(daysBetween("2026-01-01", "2026-12-25"));
console.log(daysBetween("2024-02-28", "2024-03-01"));

19

Summary

  • Four kinds of value: number, text, logical, error. Empty is not 0.
  • Numbers sit right, text sits left by default.
  • An apostrophe ('007) stores text and keeps leading zeros.
  • Dates are day counts: July 5, 2011 is 40729 in both Excel (1900 system) and Google Sheets.

Next unitWriting your first formulas
Full text · The whole lesson as one text

What a cell can hold

When you type into a cell and press Enter, the spreadsheet decides what kind of value you typed. There are four kinds you meet every day. A number is something it can calculate with, such as 42, 3.5 or 12%. Text is everything else, such as a name or a product code. A logical value is TRUE or FALSE. An error value, such as #DIV/0!, is what a formula produces when it cannot give an answer. A cell can also be empty, which is different from a cell that holds 0.

You can usually tell the kind by looking. With the standard settings, numbers line up against the right edge of the cell and text lines up on the left. A column of prices with one value stuck on the left is therefore a warning sign. That value was stored as text and will be skipped by SUM. In the lab below, the panel names the kind of every cell you select, which saves guessing.

Leading zeros and the apostrophe

Some things look like numbers but are really labels: ZIP codes such as 02134, employee numbers such as 007, phone numbers that start with 0. Type them plainly and the spreadsheet turns them into numbers and drops the leading zeros. To keep them, type an apostrophe first: '02134. The apostrophe tells the program to store text, and it is not shown in the cell. Long identifiers are a second reason to use text. Microsoft gives Excel a number precision of 15 digits, so a 16-digit card number stored as a number loses its last digit.

Percentages work the other way. Typing 12% stores the number 0.12 and shows it as 12%, so =A5*100 gives 12. Text that looks like a number is not hopeless either: Microsoft's page on operators shows that ="1"+"2" gives 3, because the plus sign makes Excel convert text it can read as a number. Functions such as SUM are stricter and skip text in a range, which is why a column of numbers stored as text can quietly add up to 0.

Dates are numbers in disguise

A date in a spreadsheet is stored as a serial number: a count of days. Microsoft's page on date systems gives the example that July 5, 2011 is stored as 40729 in Excel's 1900 date system, the default in current Excel for Windows and Mac. Older Mac versions used a 1904 system, where the same day is 39267, exactly 1,462 days less. Google's DATE help says Sheets counts the days since December 30, 1899, which gives the same 40729 for that day. Because dates are numbers, subtracting two dates gives the days between them.

You typeStored asShown as
007the number 77
'007the text 007007
12%the number 0.1212%
2011-07-05the number 40729a date
TRUEa logical valueTRUE
3+4the text 3+4 (no = sign)3+4
How a date you type is read depends on the regional setting of the file or computer: 05/07/2011 is 7 May in some places and 5 July in others. The year-month-day form 2011-07-05 avoids the doubt, and this lab accepts only that form.
Select each cell in column A and read the panel: 007 became 7, the apostrophe kept 007 as text, the date is 40729, and 3+4 without an = sign is only text. A8 shows the date as its serial number.

Decide whether a column represents quantities or identifiers before entering a large list. Quantities can sensibly be added or compared by size; an identifier distinguishes one record from another. Adding employee identifiers does not produce a useful total, even if the entries contain only digits. Choosing text for identifiers protects their written form. Choosing numbers for quantities lets calculations use them, so the decision should follow the meaning of the data rather than its appearance.

Key points
  • Four kinds of value: number, text, logical, error. Empty is not 0.
  • Numbers sit right, text sits left by default.
  • An apostrophe ('007) stores text and keeps leading zeros.
  • Dates are day counts: July 5, 2011 is 40729 in both Excel (1900 system) and Google Sheets.

Practice questions from Numbers, text and dates on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (15)
  • Microsoft Support, "Excel specifications and limits" (support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3: 1,048,576 rows by 16,384 columns, 15-digit precision, 255 arguments)
  • "Calculation operators and precedence in Excel" (.../calculation-operators-and-precedence-in-excel-48be406d-4975-4d31-b2b8-7af9e0e2878a: operators, order negation % ^ * / + - & comparisons, =5+2*3 is 11, ="1"+"2" is 3, ="A"&TRUE is ATRUE, #### for too little space)
  • "SUM function" (.../sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89: up to 255 numbers, =A1+B1+C1 gives #VALUE! with text while SUM ignores text)
  • "Switch between relative, absolute, and mixed references" (.../dfec08cd-ae65-4f56-839e-5f0d8d0baca9: =B4*C4 copied from D4 to D5 becomes =B5*C5)
  • "Date systems in Excel" (.../e7fe7167-48a9-4b96-bb53-5612a800b487: July 5, 2011 is 40729 in the 1900 system and 39267 in the 1904 system, 1,462 days apart)
  • "Remove or allow a circular reference" (.../8540bd0f-6e97-4483-bcf7-1b49cd50d123: warning, then 0 or the last value)
  • VLOOKUP and IF pages (#N/A, #NAME? from missing quotes)
  • Google Docs Editors Help: SUM (support.google.com/docs/answer/3093669: any number of arguments)
  • DATE (answer/3092969: days counted from December 30, 1899)
  • Keyboard shortcuts for Google Sheets (answer/181110: Ctrl+D fill down, Ctrl+R fill right, Ctrl+~ show all formulas, F4 absolute/relative)
  • Files you can store in Google Drive (support.google.com/drive/answer/37603: up to 20 million cells per spreadsheet)
  • ERROR.TYPE (answer/3238305: the error values)
  • History: Smithsonian National Museum of American History, VisiCalc software and documentation, object nmah_1696121 (Bricklin and Frankston, Apple II, 1979)
  • ACM Interactions, "The first killer app: a history of spreadsheets" (2013: Lotus 1-2-3, Excel for the Macintosh in 1985)
  • Wikipedia, VisiCalc and Lotus 1-2-3 (VisiCalc used A1 notation; Lotus 1-2-3 launched 1983).

Checked: 2026-10-17