Sub topic 1
Stored Value Versus Displayed Format
Prerequisites
This chapter assumes you can do the following:
- Enter and edit data in worksheet cells.
- Write a basic formula such as
=A1+B1. - Select cell ranges and find commands on the Ribbon.
You don't need to know any format codes yet. Later chapters cover those.
The two layers of a cell
A cell that holds a number has two separate layers:
- The stored value is the number Excel keeps in the cell. Formulas, charts, sorting, and lookups all read this layer.
- The number format is a display rule attached to the cell. It decides what text appears on screen and in print.
Changing the format changes only what you see. The stored value stays the same. This one fact explains most of the "Excel shows the wrong number" problems you will meet in the rest of this tutorial.
| Stored value | Number format | What the cell displays |
|---|---|---|
| 1234.5678 | `0.00` | 1234.57 |
| 0.1234 | `0.0%` | 12.3% |
| 45292 | `yyyy-mm-dd` | 2024-01-01 |
| 0.5 | `h:mm AM/PM` | 12:00 PM |
Each row has a plain number in the first column. The format turns it into something a reader recognizes.
Seeing both layers
The cell shows the displayed text. The formula bar shows something closer to the stored value. Select a cell and look at the formula bar to see what Excel actually holds.
Suppose A1 holds 1234.5678 and has the format 0.00:
0.00The cell shows 1234.57. The formula bar still shows 1234.5678. A formula that refers to A1 uses 1234.5678, not 1234.57.
You can also see the stored value by switching the same cell to the General format. General shows the number with as many digits as fit in the column width, so it works as a quick check.
Why the difference matters
The gap between the layers matters most when you add up numbers that you can only see rounded. Enter these values in A1 and A2, and format both cells as 0.00:
| Cell | Stored value | Displayed |
|---|---|---|
| A1 | 1.234 | 1.23 |
| A2 | 1.234 | 1.23 |
Now put this formula in A3, also formatted as 0.00:
=A1+A2A3 stores 2.468 and displays 2.47. A reader adding the two visible values (1.23 + 1.23) gets 2.46. Excel is not wrong. The formula used the stored values, and the display rounded each number independently. The mismatch is real, though, and it appears in invoices and reports all the time.
If you need the stored value to match the display, change the value itself. That is a different operation from formatting. It is the subject of a later chapter on rounding, but here is the shape of it:
=ROUND(A1,2)ROUND returns a new stored value with two decimal places. A number format never does that.
What Excel stores
Excel stores three main kinds of content in a cell: numbers, text, and logical values (TRUE or FALSE). Dates and times are not a separate kind. They are numbers.
- A date is a whole-number count of days. Under the default 1900 date system,
45292is 1 January 2024. - A time is a fraction of a day.
0.5is noon, because it is half of a day. - A date with a time is the sum of the two, such as
45292.75for 6:00 PM on 1 January 2024.
You can create a date serial number with a formula:
=DATE(2024,1,1)This returns 45292. If the cell has the General format, you will see 45292. If the cell has a date format, you will see a date. The stored value is the same either way.
Numbers carry about 15 significant digits of precision. Digits beyond that are lost when you type or paste them. This is a limit of how Excel stores numbers, and no format can restore those digits.
Formats applied automatically
You don't always choose a format. Excel often picks one for you when you type an entry, and then it stores a number instead of the text you typed.
- Typing
12%stores0.12and applies a percentage format. - Typing
$5stores5and applies a currency format. - Typing
1/2may store a date, depending on your regional settings, and applies a date format. - Typing
3:30stores0.145833...(3.5 hours as a fraction of a day) and applies a time format.
The format Excel attaches in these cases is part of the cell, not part of the value. If you later clear the format, the number remains and the cell displays the raw stored value. A cell that shows 45292 where you expected a date usually has the correct stored value and has lost its date format.
Text is a different stored kind
A format can only change how a number looks. It cannot turn text into a number. If a cell holds the text "42", applying the Number format does nothing to its content. Excel still stores text, and formulas such as SUM skip it.
Two quick signs that a cell holds text instead of a number:
- The content is left-aligned by default, while numbers are right-aligned.
- A small green triangle may appear in the corner of the cell.
The reverse also holds. Applying the Text format to a cell before you type stores what you type as text, which is how leading zeros are kept. A later chapter covers both directions in detail.
Where formats live
Formats belong to cells, not to values. This has three practical effects:
- Copying a cell copies its format along with its value, unless you use Paste Special and choose Values.
- A formula result takes its format from the formats of the cells it refers to when Excel can infer one. For example, a formula that subtracts two dates may display as a number or a date, depending on the cells involved.
- Clearing the contents of a cell leaves its format in place. The next value you type into the cell will display using that old format.
The third effect causes many surprises. If you type 0.25 into a cell that was formatted as a date, you will see a time or date instead of 0.25. The value is stored correctly, and the leftover format changes how it looks.
Checking your own worksheets
When a number looks wrong, check the layers in this order:
- Select the cell and read the formula bar. Does the stored value match what you expect?
- Check the cell's current format. If the value is right and the display is wrong, change the format.
- If the display is right and the total is wrong, look for hidden decimals behind rounded displays.
- If a value is left-aligned or ignored by
SUM, check whether it is text.
This order saves time. Most problems fall into one of these four, and none of them requires editing the data itself.
Exercise
A1 contains 2.675 and is formatted with 0.00, so it displays 2.68. B1 contains =A1*100 and is formatted as General. What does B1 display, and why?
Show answer
B1 displays 267.5. The formula uses the stored value 2.675, not the displayed 2.68, so the result is 267.5. Number formats change only the display of A1, not the value that formulas read.
Exercise
You type 45292 into a cell and then apply the date format yyyy-mm-dd. The cell shows 2024-01-01. You then apply the General format. What does the cell show, and has the stored value changed at any point?
Show answer
The cell shows 45292 again. The stored value was 45292 the whole time. Only the format changed, so only the display changed.