Sub topic 1
Cells, ranges, and A1 notation
Prerequisites
This chapter assumes you can open and save a workbook, type text, numbers, and simple formulas into cells, and find your way around rows, columns, and the Excel ribbon. It does not assume any knowledge of selecting, copying, or filling. Those topics come in later chapters and build on the ideas here.
Cells and A1 notation
A worksheet is a grid. Each box in the grid is a cell. Excel identifies every cell by its column letter followed by its row number. This is A1 notation.
- The cell in column B, row 2 is
B2. - Columns run A, B, C, and so on to Z, then continue AA, AB, and so on up to XFD.
- Rows are numbered from 1 to 1,048,576.
The column letter always comes first. B2 is a valid address. 2B is not.
The address of the active cell appears in the Name Box, to the left of the formula bar. The active cell is the one that will receive what you type.
Ranges
A range is a group of cells treated as one unit. You write a range as the first cell, a colon, and the last cell. The colon means "through".
| Address | Meaning |
|---|---|
| `B2:B10` | One column, rows 2 through 10 |
| `B2:E2` | One row, columns B through E |
| `B2:D10` | A block three columns wide and nine rows tall |
| `B:B` | The whole of column B |
| `3:3` | The whole of row 3 |
| `B:D` | Columns B through D |
| `2:5` | Rows 2 through 5 |
For a block, the two cells in the address are opposite corners. B2:D10 and D10:B2 describe the same range, and Excel writes it with the upper-left cell first.
A range does not have to be rectangular only in your mind. Excel can also hold several separate areas in one selection. You write these with commas, such as A1:A5,C1:C5. The comma means "and". You will use non-adjacent selections in the next chapter.
Why ranges matter
Almost every Excel operation acts on a range. A formula such as =SUM(B2:B10) adds a range. Copying, moving, and filling all start by selecting one. If you misread an address, you act on the wrong cells.
You can check the size of a selection quickly. Select a range by dragging and look at the Name Box while you hold the mouse button. It shows the count of rows and columns, such as 9R x 3C. After you release, it shows the address of the active cell again.
You can also use the Name Box to jump to a range. Type the address and press Enter:
Name Box: B2:D10
Press Enter to select the range B2:D10Excel selects the range without scrolling or dragging. This works even when the range is far from the current view.
Relative and absolute addresses
A1 notation has a second layer. A dollar sign in front of the column letter or row number fixes that part when a formula is copied.
| Form | Name | Behavior when copied |
|---|---|---|
| `B2` | Relative | Column and row both shift |
| `$B$2` | Absolute | Neither shifts |
| `$B2` | Mixed | Column fixed, row shifts |
| `B$2` | Mixed | Row fixed, column shifts |
Here is a short example. Column B holds prices and E1 holds a tax rate:
C2: =B2*$E$1
C3: =B3*$E$1Filling C2 down to C3 changes B2 to B3, because it is relative. $E$1 stays fixed, so every row uses the same rate. A later chapter covers this behavior in detail. For now, remember that the dollar signs are part of the address, and you can type them yourself or press F4 while editing a reference to cycle through the four forms.
Common errors
- Reversing the order, such as typing
2Binstead ofB2. Excel treats2Bas text or reports an error. - Forgetting the colon.
=SUM(B2 B10)does not mean the range. A space is the intersection operator and gives a#NULL!error. - Using a comma where you want a colon.
=SUM(B2,B10)adds only two cells, not nine.
Exercise
A worksheet has prices in B2:B10. You want a formula that adds only the first and last price, and a second formula that adds all nine prices. What do you write for each?
Show answer
For the first and last price, use =SUM(B2,B10). The comma separates two single cells. For all nine prices, use =SUM(B2:B10). The colon means "through", so the range covers B2 down to B10.