Sub topic 11
Rows, Columns, and Cells
This chapter covers the worksheet grid: how rows, columns, and cells fit together, what the limits are, and the mistakes people commonly make when working with them. It assumes you can open a blank workbook, click cells, and type into them. It also assumes you know a workbook holds worksheets, which the previous chapter covered. Cell and range addresses get their own chapter, so here we only use addresses as labels.
The grid is the worksheet
A worksheet is a grid. Columns run vertically and are labeled with letters. Rows run horizontally and are labeled with numbers. A cell is the box where one row and one column cross. Each cell holds one value, one formula, or nothing.
The grid in current versions of Excel (Excel 2007 and later, including Microsoft 365) has fixed limits:
| Item | Limit |
|---|---|
| Rows per worksheet | 1,048,576 |
| Columns per worksheet | 16,384 (A through XFD) |
| Cells per worksheet | About 17.2 billion |
| Characters in one cell | 32,767 |
| Characters shown in a cell | About 1,024 |
| Row height | 0 to 409 points |
| Column width | 0 to 255 characters |
The file format limits the grid, not your computer. You can never add a 1,048,577th row. If a data set is larger than that, you need a different tool. Power Query and the Data Model can load more rows than a sheet can show.
Note the gap between stored and displayed characters. A cell stores up to 32,767 characters, but the cell shows only about 1,024. The formula bar shows the rest.
Column letters and the active cell
Column labels run A to Z, then AA to AZ, BA to BZ, and so on until XFD. The labels work like a base-26 count, with one difference: there is no zero. After Z comes AA, not BA.
At any time one cell is the active cell. It has a thick green border. The Name Box shows its address, and the formula bar shows its contents. Typing, pasting, and most commands act on the active cell, or on the selection if you chose several cells.
Selecting rows, columns, and cells
Selecting the right thing first prevents most formatting and deleting errors.
| To select | Do this |
|---|---|
| One cell | Click it, or move to it with the arrow keys |
| A whole row | Click the row number, or press Shift+Space |
| A whole column | Click the column letter, or press Ctrl+Space |
| The whole sheet | Click the corner box above row 1 and left of column A, or press Ctrl+A |
| Several rows or columns | Drag across the headers, or click the first and Shift+click the last |
| Separate rows or columns | Click the first header, then Ctrl+click each other one |
Pressing Ctrl+A inside a block of data selects the data region first. Pressing it a second time selects the whole sheet.
Resizing rows and columns
A column that is too narrow shows ##### for numbers and dates. This is not an error in the data. Widen the column and the value appears. Text is different: text that does not fit spills into the next cell if that cell is empty, and is cut off if the next cell has content.
You can resize in three ways:
- Drag the border between two headers.
- Double-click the border to AutoFit. Excel sizes the column to its longest entry, or the row to its tallest content.
- Use Home > Format > Column Width or Row Height to enter an exact number.
Excel measures column width in characters of the default font and row height in points. Because these units differ, a column width of 8.43 and a row height of 15 produce a roughly rectangular default cell.
To set several columns to one width, select them all and then resize any one of them. Every selected column takes the new width.
Inserting and deleting
Inserting and deleting change the structure of the grid. Existing cells shift to make room or close the gap.
- Right-click a row number and choose Insert. The new row appears above the one you clicked.
- Right-click a column letter and choose Insert. The new column appears to the left.
- Select several rows first to insert that many at once.
- Press Ctrl+Plus (the plus sign) to insert, and Ctrl+Minus to delete. With a whole row or column selected, these act at once. With a cell selected, a dialog asks which direction to shift.
Formulas that point at shifted cells adjust automatically. If you delete a row or column that a formula depends on, the formula shows #REF!. That error means the reference no longer exists.
Hiding and unhiding
Hidden rows and columns still hold their data, and formulas still use them. To hide, select the rows or columns, right-click a header, and choose Hide. Hiding sets the height or width to zero.
Unhiding trips up many users because nothing is left to click. Select the headers on both sides of the hidden one, right-click, and choose Unhide. To reveal a hidden first row or column, click the corner box to select everything and then unhide. Alternatively, type A1 in the Name Box, press Enter, and use Home > Format > Hide & Unhide.
Signs that something is hidden: a skipped letter or number in the headers (A, B, D), and a thicker line between two headers.
A look at the structure
The following diagram shows how the pieces contain each other.
Formatting at the right level
You can apply formatting to a cell, a row, a column, or the whole sheet. Formatting a whole column, such as bold or a number format, applies to every cell in it, including cells you add later. This is convenient and cheap, because Excel stores the format once for the column and not for a million cells.
The common mistake is the opposite one. Formatting a large block of individual cells, or pasting formats across many unused cells, can make the file grow and slow down. It can also move the last used cell far from your data. Press Ctrl+End to see where Excel thinks the data ends. If it jumps far below or to the right of your data, stray formatting is probably the cause. Delete the extra rows and columns, not just their contents, and save.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| `#####` in a cell | Column too narrow for a number or date | Widen the column, or double-click its border |
| `#REF!` after deleting | A formula pointed at a deleted row or column | Undo with Ctrl+Z, or rewrite the reference |
| A row or column seems missing | It is hidden | Select both neighbors and Unhide |
| Ctrl+End goes far past the data | Leftover formatting in unused cells | Delete the extra rows and columns, then save |
| Typed data does not fit | Text is cut off by a neighbor | AutoFit, or turn on Wrap Text |
| Cannot insert a column | Data already sits in the last column, XFD | Clear or move that data |
Check your understanding
Exercise
A coworker says a column in a budget sheet "lost its data" because column C disappeared and the headers now read A, B, D. What is the most likely explanation, how do you confirm it, and how do you fix it without changing any data?
Show answer
Column C is most likely hidden, not deleted. The skipped letter in the headers is the sign. A hidden column keeps its data. To fix it, select the headers of columns B and D together, right-click, and choose Unhide. The data in column C then reappears unchanged.
Exercise
You press Ctrl+End on a sheet whose data ends at cell F40, and the cursor lands on cell F5000. Why does this happen, and what should you do?
Show answer
Excel treats cells with leftover formatting or contents as used, so the last used cell stays at row 5000. Select rows 41 to 5000, right-click a row number, and choose Delete (not just pressing the Delete key). Then save the workbook. Pressing Ctrl+End again should land on F40.