Sub topic 2
Selecting cells, rows, columns, and ranges
This chapter assumes you can open and save a workbook, enter text, numbers, and simple formulas, and find your way around rows, columns, and the ribbon. It covers how Excel represents a selection and the ways to build one with the mouse. It also covers the edge cases that cause wrong results later, such as acting on the wrong range.
Why selection matters
Almost every Excel command acts on the current selection. Formatting, copying, deleting, sorting, filling, and charting all start with the question "which cells?" A wrong selection is the most common cause of changes that land in the wrong place, so it is worth learning how selections work.
Cells, ranges, and A1 notation
A cell is the intersection of one column and one row. Its address combines the column letter and the row number, such as B2. This style is called A1 notation.
A range is a group of cells treated as one unit. You write it with the addresses of two opposite corners, separated by a colon.
| Notation | Meaning |
|---|---|
| `B2` | One cell |
| `B2:D10` | Rectangle from B2 (top left) to D10 (bottom right) |
| `B:B` | The whole of column B |
| `B:D` | Columns B through D |
| `3:3` | The whole of row 3 |
| `3:7` | Rows 3 through 7 |
| `B2:B5,D2:D5` | Two separate ranges (a non-adjacent selection) |
The corner order does not matter. D10:B2 selects the same cells as B2:D10. Excel normalizes it when it stores the reference.
A selection has one active cell. It is the cell that receives what you type, and it is shown without the shading that covers the rest of the selection. The Name Box, at the left of the formula bar, shows its address. When you select a range, the Name Box shows the range's size while you drag and its active cell afterward.
Selecting a single cell
Click the cell. You can also press the arrow keys to move the active cell one step. Typing begins in the active cell and replaces its contents unless you are in edit mode.
If you double-click a cell, or press F2, Excel enters edit mode for that cell. In edit mode, arrow keys move the cursor inside the text instead of moving to another cell. This explains a common surprise. If arrow keys suddenly stop changing the selected cell, check the left side of the status bar for the word Edit, and press Enter or Esc.
Selecting a contiguous range with the mouse
- Click the first corner cell.
- Hold the left mouse button and drag to the opposite corner.
- Release the button.
You can also click the first cell, hold Shift, and click the last cell. The Shift method is more reliable for large ranges because you do not need to keep the button down while the sheet scrolls. During a drag, the sheet scrolls quickly when the pointer reaches the window edge, and it is easy to overshoot.
To change the end of a selection without starting over, hold Shift and click a new corner. Excel keeps the active cell anchored and redraws the rectangle from it.
Selecting rows and columns
Click a row number at the left, or a column letter at the top, to select that entire row or column. Drag across several headers to select adjacent rows or columns. Click the first header, hold Shift, and click the last header for a longer span.
Selecting a whole row or column is useful for inserting, deleting, hiding, and resizing. It is risky for other commands. A whole column contains 1,048,576 cells, and a few operations on it can be slow or can touch data far below what you can see. For example, applying a fill color to a whole column also formats thousands of empty cells. Select only the used part when you can.
A related point concerns the right-click menu. With a whole row selected, Insert adds a new row above it. With a whole column selected, Insert adds a new column to its left. If you only have a single cell selected, Excel asks what to shift, which has different results. Check what is highlighted before you choose.
Selecting non-adjacent areas
Hold Ctrl (Cmd on Mac) while you click or drag additional cells, rows, or columns. Each new area is added to the selection.
Keep these rules in mind:
- The active cell is the last one you clicked. Typing and Enter act on it.
- Some commands do not work on multi-area selections. Copy, for example, works only when the areas line up in the same rows or the same columns. If they do not, Excel shows the message "That command cannot be used on multiple selections."
- To remove one area, you generally have to start again. Newer versions of Excel let you Ctrl-click a selected cell to deselect it, but this behavior depends on version and is not reliable for large areas.
Selecting the entire sheet and the current region
Click the small triangle at the top left, where the row and column headers meet, to select every cell. Pressing Ctrl+A does the same, with one difference. If the active cell sits inside a block of data, the first Ctrl+A selects only that block. The second press selects the whole sheet.
That block is called the current region. It is the rectangle of cells bounded by empty rows and empty columns. Knowing this helps you predict results. A single blank row in the middle of a table splits the current region in two, so Ctrl+A or Ctrl+Shift+8 stops at the gap and you select less than you expect.
Using the Name Box to select
The Name Box accepts a typed address and selects it without scrolling or dragging. This is the best method for a range that is far from where you are, or one that is too big to drag across.
Name Box: B2:D10
Press Enter to select the range B2:D10The Name Box also accepts multi-area addresses separated by commas, such as B2:B5,D2:D5, and whole row or column references such as 3:7. If you type a name that does not exist and it is a valid single-cell name, Excel creates a defined name for the current selection instead of moving. This can look like a failure to navigate. If you meant to jump somewhere, double-check that you typed a valid address.
Selection and the scrolling behavior of the sheet
Selecting does not require the cells to be visible. When you use the Name Box or the keyboard, Excel scrolls so that the active cell is in view. Scrolling with the mouse wheel or scroll bars changes only what you see. It does not change the selection. If you scroll away and then type, the characters go into the active cell, which may be off-screen. Press Ctrl+Backspace to bring the active cell back into view.
Hidden and filtered cells inside a selection
A selection that spans hidden rows or columns still includes the hidden cells. If you select A1:A20 and rows 5 to 10 are hidden, those rows are part of the selection. Formatting, deleting contents, and typing with Ctrl+Enter all affect the hidden cells too. This is a frequent source of silent errors, and a later chapter shows how to limit an action to visible cells only. For now, check the row numbers for gaps before you act on a selection.
Checking what you selected
Before you act on a selection, confirm it with these cues:
- The Name Box shows the active cell address.
- The status bar, at the bottom right, shows summary values such as Count, Sum, and Average for numeric cells in the selection. Right-click the status bar to choose which statistics appear.
- Row and column headers of selected cells are highlighted.
- A moving border or a thick outline marks the extent of the selection.
The Count in the status bar counts cells that contain data. If it is lower than you expect, part of your selection is empty, or the numbers are stored as text.
Common mistakes
- Typing while a range is selected. Typing writes to the active cell only, but pressing Delete clears every selected cell. Look before you press Delete.
- Dragging a selection by its border. If the pointer changes to a four-arrow cross at the edge of the selection, dragging moves the cells instead of extending the selection. Start the drag from the middle of a cell to select.
- Selecting a whole column when you meant the data. This slows some operations and formats unused cells.
- Missing a gap in a table. A blank row ends the current region, so a shortcut that relies on it selects only part of the data.
Summary of methods
| Goal | Method |
|---|---|
| One cell | Click, or use the arrow keys |
| Small range | Drag from corner to corner |
| Large range | Click the first cell, then Shift+click the last cell, or type the address in the Name Box |
| Whole row or column | Click the header |
| Several rows or columns | Drag across headers, or Shift+click |
| Non-adjacent areas | Hold Ctrl while selecting |
| Data block | Ctrl+A once inside the data |
| Whole sheet | Ctrl+A twice, or click the corner triangle |
Exercise
A table occupies A1:D50, but row 25 is completely blank. You click A1 and press Ctrl+A, then apply a border. Which cells receive the border, and how would you select the whole table reliably?
Show answer
Only A1:D24 receives the border, because the blank row 25 ends the current region and the first Ctrl+A selects only that region. To select the whole table reliably, type A1:D50 into the Name Box and press Enter, or click A1 and Shift+click D50.
Exercise
You select B2:B5, hold Ctrl, and select D2:D5. What is the active cell, and what happens to the hidden rows if row 3 is hidden and you press Delete?
Show answer
The active cell is the first cell of the last area you selected, D2 (the cell where you started that drag). Pressing Delete clears the contents of all eight cells, including B3 and D3 in the hidden row, because hidden cells inside a selection are still selected.