Sub topic 1
Cells and Their Addresses
Every formula you write in Excel points at places on a worksheet. Before you write one, you need to know how Excel names those places. This chapter covers the grid, the address of each cell, the ways to refer to groups of cells, and the habits that stop you from pointing at the wrong cell.
Prerequisites
This chapter assumes you can already do the following:
- Open a workbook and click a cell to select it.
- Type a value into a cell and press Enter.
- Do basic arithmetic and recall that multiplication comes before addition. A later chapter covers Excel's order of operations in detail.
You do not need to have written a formula yet. By the end of this chapter you will be able to:
- Read and write a cell address such as
B2orAA105. - Find any cell quickly using the Name Box and keyboard shortcuts.
- Describe a block of cells with a range such as
A1:C4. - Refer to a cell on another worksheet.
- Tell the difference between what a cell contains and what it displays.
The grid: columns, rows, and cells
A worksheet is a grid. Vertical strips are columns, and horizontal strips are rows. A cell is the box where one column and one row cross. Each cell can hold one item: a number, some text, a date, or a formula.
Columns are labeled with letters across the top. Rows are labeled with numbers down the left side. The two labels together give each cell a unique name, called its cell address (or cell reference).
The rule is always the same: column letter first, then row number, with no space and no punctuation between them. B3 means column B, row 3. 3B is not an address, and B 3 is not one either.
Cell addresses are not case sensitive. If you type b3 inside a formula, Excel converts it to B3 when you confirm the formula.
How big the grid is
A current Excel worksheet has 16,384 columns and 1,048,576 rows. That is about 17.2 billion cells on a single sheet. You will almost never use more than a tiny fraction of that, but the limits explain why addresses look the way they do.
After column Z, the labels continue with two letters, like the odometer in a car: AA, AB, and so on up to AZ, then BA. Beyond ZZ, labels grow to three letters, and the last column is XFD.
| Column number | Column label | Notes |
|---|---|---|
| 1 | A | First column |
| 26 | Z | Last single-letter column |
| 27 | AA | First two-letter column |
| 52 | AZ | Second letter cycles through A to Z |
| 53 | BA | First letter advances by one |
| 702 | ZZ | Last two-letter column |
| 703 | AAA | First three-letter column |
| 16,384 | XFD | Last column on the sheet |
You do not need to memorize this table. It helps to know that the labels are a base-26 counting system, so AA comes after Z and not after A.
The active cell and the Name Box
Only one cell is the active cell at a time. It is the cell with the thick green border, and it is where your typing goes. Its address appears in the Name Box, the small box at the left end of the formula bar, just above column A.
The Name Box is useful in two ways:
- It tells you where you are. When a worksheet is large, glancing at the Name Box is faster than counting columns and rows.
- It lets you jump. Click in the Name Box, type an address such as
D250, and press Enter. Excel selects that cell and scrolls to it.
The area to the right of the Name Box is the formula bar. It shows the actual content of the active cell. You will use it constantly once you start writing formulas.
Moving around without the mouse
The mouse works, but keyboard movement is faster on larger sheets. These shortcuts work on Windows. On a Mac, use Command in place of Ctrl for the arrow shortcuts.
| Keys | What happens |
|---|---|
| Arrow keys | Move one cell in that direction |
| Tab / Shift+Tab | Move one cell right / left |
| Enter / Shift+Enter | Move one cell down / up after typing |
| Ctrl+Arrow | Jump to the edge of the current block of data |
| Ctrl+Home | Jump to `A1` |
| Ctrl+End | Jump to the last cell that has been used |
| Ctrl+G or F5 | Open Go To, where you can type any address |
Ctrl+Arrow deserves a note. If you are in a column of filled cells, it jumps to the last filled cell before a gap. If you are on a blank cell, it jumps to the next filled cell. This is the quickest way to find the end of a data table, and it also reveals accidental blank cells inside a table.
Ranges: addresses for groups of cells
Many formulas work on more than one cell. A range is a rectangular block of cells, written as the address of its top-left corner, a colon, and the address of its bottom-right corner.
A1:A10is ten cells in column A, rows 1 through 10.B2:D2is three cells in row 2, columns B through D.A1:C4is a block of 12 cells: three columns by four rows.
The colon reads as "through" or "to". A single cell B2 can also be treated as the range B2:B2.
You can select a range with the mouse by dragging from one corner to the opposite corner. You can also click the first cell, hold Shift, and click the last. To select it from the keyboard, hold Shift and press the arrow keys. While you select, the Name Box shows how many rows and columns you have covered, such as 4R x 3C. When you release the mouse, it shows the address of the active cell again.
Ranges become important once you use functions. The arithmetic operators in this tutorial work on single cells, so for now just recognize the notation when you see it.
Whole columns and whole rows
You can name an entire column or row without giving both ends:
B:Bmeans all of column B.B:Dmeans columns B through D.3:3means all of row 3.3:5means rows 3 through 5.
Whole-column references are convenient when your data grows over time, but they cover more than a million cells. Use them deliberately. A formula that refers to B:B will also include any stray number someone types at the bottom of the column.
Cells on other worksheets
A workbook can hold many worksheets, and each sheet has its own A1, its own B2, and so on. An address alone refers to the sheet you are on. To point at a cell on a different sheet, put the sheet name first, followed by an exclamation mark, then the address.
=Sheet2!A1This formula displays whatever Sheet2 has in cell A1. If a sheet name contains spaces or punctuation, wrap it in single quotes:
='Q1 Sales'!B2You do not have to type these by hand. While you are writing a formula, you can click the other sheet's tab and then click the cell, and Excel builds the reference for you.
The same cell address on two sheets refers to two different cells. When something looks wrong in a formula, check which sheet its references point to.
What a cell contains versus what it shows
Every cell has two sides:
- The contents are what you typed or what a formula is. They appear in the formula bar.
- The displayed value is what appears in the grid.
For a typed number, these usually match. They can differ in three common ways:
- Formatting. If you type
0.075and format the cell as a percentage, the grid shows7.5%but the cell still holds0.075. - Column width. A number too wide for its column may show as
#####. The value is intact. Widen the column to see it. - Formulas. A cell with
=B2*C2shows the result, but the formula bar shows the formula.
Formulas that refer to a cell use its stored contents, not the text on the screen. So a rounded display such as 3.14 can hide a stored value of 3.14159265. A formula that uses that cell works with the full stored number.
Numbers, text, and alignment
Excel treats numbers and text differently, and addresses alone do not tell you which a cell holds. A useful visual clue is alignment. By default, numbers align to the right of the cell and text aligns to the left.
This matters when you start calculating. Suppose B2 contains the characters 12 but Excel stored them as text, perhaps because the cell was formatted as Text before you typed, or because the value had a leading apostrophe. That cell is left-aligned, and arithmetic on it can fail or behave unexpectedly. Often a small green triangle appears in the corner of such a cell to warn you. When a formula acts strangely, check whether its source cells are really numbers.
Reference style: A1 versus R1C1
Everything in this chapter uses A1 style, where columns are letters and rows are numbers. Excel also has an alternative called R1C1 style, where both are numbers and R3C2 means row 3, column 2. In that style, the column headings across the top show 1, 2, 3 instead of A, B, C.
If you open a workbook and find numbers where the column letters should be, someone has turned R1C1 on. To switch back, open File, then Options, then Formulas, and clear the "R1C1 reference style" checkbox. This tutorial uses A1 style throughout.
Previewing how addresses appear in formulas
You have not yet written a formula in this tutorial, so here is a short preview. If B2 holds a unit price and C2 holds a quantity, this formula multiplies them:
=B2*C2The formula never contains the numbers themselves. It contains the addresses of the cells that hold them. If you change the value in B2, the result changes at once. This is the main reason to learn addresses well: a formula that points to cells stays correct when the data changes, while a formula with typed-in numbers must be rewritten.
Absolute and relative: a first look at the dollar sign
You may sometimes see an address with dollar signs, such as $F$1. The dollar signs lock the column, the row, or both, so the address does not shift when the formula is copied. A later chapter covers copying formulas and the difference between relative and absolute references. For now, remember that F1 and $F$1 point at the same cell, but they behave differently when copied.
| Written as | Points to | Locked when copied |
|---|---|---|
| `F1` | Column F, row 1 | Nothing |
| `$F$1` | Column F, row 1 | Column and row |
| `$F1` | Column F, row 1 | Column only |
| `F$1` | Column F, row 1 | Row only |
Common mistakes with addresses
These errors come up often at this stage:
- Swapping letter and number.
2Bis not a valid address. In a formula, Excel may report an error or treat it as something else. Write the letter first. - Off-by-one rows. Headings often sit in row 1, so your first data row is row 2. If a formula points at the heading cell, it will read text instead of a number.
- Pointing at the wrong sheet. An address with no sheet name uses the current sheet. If you copy a formula to another sheet, check its references.
- Reading the display instead of the contents. Always confirm a cell's real value in the formula bar, especially when numbers are formatted or rounded.
- Treating text as a number. Left-aligned numbers and green corner triangles are warning signs.
- Hidden rows and columns. If the column letters skip from
CtoE, columnDis hidden. It still exists, and formulas can still refer to it.
Edge cases worth knowing
Some points do not fit neatly in the sections above:
- Blank cells are valid targets. A formula can point at an empty cell. Excel usually treats it as zero in arithmetic, which can hide a missing value. In division, an empty cell as divisor produces an error, which a later chapter explains.
- Merged cells keep one address. When you merge
A1:C1, the merged cell takes the address of its top-left cell,A1. The cellsB1andC1are emptied. Formulas pointing at them will see nothing. - Inserting or deleting rows and columns updates references. If you insert a row above row 5, a formula that used
B5is rewritten automatically toB6, so it still points to the same data. The address changes, but the target does not. - Deleting the target breaks the reference. If you delete the cell a formula depends on, the formula can show
#REF!, which means its reference is no longer valid. - Freeze panes and filters change what you see, not the addresses. A filtered list hides rows, but the row numbers stay the same, which is why they jump from 4 to 9 and so on.
Summary
- A worksheet is a grid of columns (letters) and rows (numbers). The cell where they cross is a cell.
- A cell address is the column letter followed by the row number, such as
B3. - Columns run from
AtoXFD(16,384) and rows from 1 to 1,048,576. - The Name Box shows the active cell and lets you jump to any address.
- A range such as
A1:C4names a rectangular block, and a sheet prefix such asSheet2!A1points at another worksheet. - A cell's contents (shown in the formula bar) can differ from its display.
- Formulas refer to addresses, not typed numbers, so they update when the data changes.
Exercise
Which cell does each address name, and which one is not a valid address? (a) C7, (b) 7C, (c) AB12. For the valid ones, give the column and row.
Show answer
C7 is column C, row 7. AB12 is column AB (the 28th column), row 12. 7C is not a valid address because the row number comes before the column letter. The column letter must come first.
Exercise
How many cells does the range B2:D5 contain, and what is the address of its bottom-right corner?
Show answer
The range spans columns B, C, and D (3 columns) and rows 2, 3, 4, and 5 (4 rows), so it holds 3 x 4 = 12 cells. The bottom-right corner is D5.
Exercise
You type 0.075 into A1 and format it as a percentage, so the grid shows 7.5%. What does the formula bar show, and what value would a formula pointing at A1 use?
Show answer
The formula bar shows 0.075. A formula that refers to A1 uses the stored value 0.075, not the formatted display. Formatting changes only how the number appears.
Exercise
Write the formula that displays the value in cell B2 of a worksheet named Q1 Sales. Why does the name need quotes?
Show answer
='Q1 Sales'!B2. The sheet name contains a space, so it must be wrapped in single quotes. The exclamation mark separates the sheet name from the cell address.