Sub topic 12
Cell and Range Addresses
This chapter covers how Excel names cells and groups of cells. It assumes you can open a blank workbook, know that a worksheet is a grid of rows and columns, and can type in a cell. Addresses appear in every formula, in the Name Box, and in dialogs such as Go To. Most formula mistakes at this stage come from misreading an address.
What an address is
Every cell has an address made of its column letters followed by its row number. The cell where column B meets row 4 is B4. The address of the active cell appears in the Name Box, to the left of the formula bar.
Key facts about the grid:
- Columns are lettered A to Z, then AA to AZ, BA to BZ, and so on up to
XFD. That gives 16,384 columns. - Rows are numbered 1 to 1,048,576.
- The letter always comes first.
4Bis not a valid address. - Addresses are not case sensitive.
b4andB4mean the same cell. Excel converts the letter to upper case when you press Enter.
The last cell on a worksheet is XFD1048576. You can confirm this by pressing Ctrl+Down Arrow and Ctrl+Right Arrow repeatedly from an empty sheet, or by typing it into the Name Box.
Range addresses
A range is a rectangular block of cells. You write it as the top-left cell, a colon, and the bottom-right cell. The colon means "through".
| Range | Meaning |
|---|---|
| `B2:B10` | Nine cells in column B, rows 2 through 10 |
| `A1:D1` | Four cells in row 1, columns A through D |
| `B2:D5` | A block three columns wide and four rows tall (12 cells) |
| `3:3` | The whole of row 3 |
| `C:C` | The whole of column C |
| `B:D` | Columns B, C, and D |
| `2:5` | Rows 2 through 5 |
Excel normalizes the order. If you type D5:B2, Excel treats it as B2:D5.
Two other operators matter when you combine ranges:
- The comma, as in
A1:A3,C1:C3, joins separate ranges into one union. In a function such as SUM, the arguments are often separated by commas instead, which has the same effect. - A single space, as in
A1:C3 B2:D4, is the intersection operator. It returns only the cells the two ranges share, hereB2:C3.
=SUM(A1:C3 B2:D4)This formula adds only the four cells in the overlap, B2:C3.
Selecting by address
You do not need the mouse to select a range. Type the address into the Name Box and press Enter. Excel selects the range and scrolls to it.
- Click the Name Box, or press Ctrl+G to open the Go To dialog box.
- Type
B2:D5. - Press Enter.
The first cell you typed (here B2) becomes the active cell, the one that receives typing. The rest of the range is highlighted. The status bar shows statistics for the selection, such as Sum, Average, and Count, so it is a quick way to check a block of numbers.
To select several separate areas, type them with commas, for example A1:A5,C1:C5. Press Enter and both blocks are selected.
Relative, absolute, and mixed references
When you write an address inside a formula, it is called a reference. The dollar sign controls what happens when you copy the formula to another cell.
| Style | Example | When copied |
|---|---|---|
| Relative | `B4` | Column and row both shift |
| Absolute | `$B$4` | Neither shifts |
| Mixed, column fixed | `$B4` | Row shifts, column stays |
| Mixed, row fixed | `B$4` | Column shifts, row stays |
Suppose cell C2 contains =B2*$F$1, where F1 holds a tax rate. Copy C2 down to C3. The formula becomes =B3*$F$1. The relative B2 moved down one row. The absolute $F$1 stayed fixed, so every row still uses the same rate.
Press F4 while the cursor is inside a reference in the formula bar. Each press cycles through B4, $B$4, B$4, and $B4.
The same rules apply to ranges. $B$2:$B$10 is a fixed range. B2:B10 shifts when copied. This is the usual cause of a lookup or SUM that works in the first row and returns wrong results lower down.
Addresses on other worksheets
A reference can point at a different sheet by putting the sheet name first, followed by an exclamation mark. If the name contains a space or other special character, wrap it in single quotes.
='Q1 Sales'!B4=SUM('Q1 Sales'!B2:B10)The full treatment of cross-sheet formulas comes in a later chapter. For now, note that the sheet name is part of the address.
Named ranges
A name gives an address a readable label. Select F1, click the Name Box, type TaxRate, and press Enter. You can now write =B2*TaxRate. Names behave like absolute references, so they do not shift when copied.
Rules for names:
- Start with a letter, an underscore, or a backslash.
- Use no spaces. Use
Tax_RateorTaxRate. - Do not use a name that looks like an address, such as
A1orR1C1.
Names appear in the Name Box drop-down list, and choosing one selects the cells it refers to.
Common errors
- A reference changes when copied. You used a relative reference where you needed
$. Press F4 to lock it. #REF!appears. The formula points at a cell that was deleted, or at a sheet that no longer exists. Check the address in the formula bar. If Undo (Ctrl+Z) is still available, use it.#NAME?appears. Excel read your text as a name, not an address. A typo such as=SUM(B2:B1O)with a letter O in place of a zero is a common cause. A missing quote around a sheet name that contains spaces causes the same error.- The wrong block is selected. Check the order. The colon joins two corners, so
B2:D5andB2:D50differ by 45 rows. - Column letters turned into numbers. If the column headers show 1, 2, 3 and formulas look like
R[1]C[2], the R1C1 reference style is on. Turn it off under File > Options > Formulas by clearing "R1C1 reference style".
Practice
Exercise
Cell C2 contains =B2*F1. You copy it down to C3 and the result is wrong, because C3 now contains =B3*F2. Rewrite the formula in C2 so that every row multiplies by the value in F1, and say which key helps you do it.
Show answer
Use =B2*$F$1. The dollar signs make the reference to F1 absolute, so it stays on F1 when copied. While editing the formula, place the cursor in F1 and press F4 once to add both dollar signs.
Exercise
What cells does the formula =SUM(A1:C3 B2:D4) add, and what is the name of the operator between the two ranges?
Show answer
It adds the cells in the overlap of the two ranges, which is B2:C3 (four cells). The space between the ranges is the intersection operator.
Exercise
Write a formula that adds cells B2 through B10 on a worksheet named Q1 Sales, and explain why the quotes are needed.
Show answer
=SUM('Q1 Sales'!B2:B10). The sheet name contains a space, so it must be wrapped in single quotes. Without them Excel cannot tell where the sheet name ends.