Sub topic 9
Workbooks and worksheets: what contains what
This chapter assumes you can open a blank workbook, read the ribbon tabs, and click around the Excel window. It covers how a workbook holds worksheets and what lives inside each one. It also covers the mistakes that come from mixing up the two.
The containment model
A workbook is the file. It is what you save, email, and open. A worksheet is one page inside that file, shown as a tab at the bottom of the window. A worksheet is a grid of cells, and each cell holds a value, a formula, or nothing.
The nesting looks like this:
Other things also belong to the workbook rather than to a single sheet. These include defined names (by default), document properties, and the sheet order. Workbook-level settings, such as the calculation mode, apply to every sheet that is open in the session.
Sheet types
Most tabs are worksheets, but a workbook can also hold chart sheets. A chart sheet has no grid. It shows one chart across the whole page. Macro-enabled workbooks can also contain VBA modules, which do not appear as tabs. This tutorial focuses on worksheets.
Workbook versus worksheet in everyday terms
| Question | Workbook | Worksheet |
|---|---|---|
| What is it on disk? | One file, such as `Budget.xlsx` | Not a file. It exists only inside a workbook |
| How do you save it? | File > Save | You cannot save one alone. You save the workbook |
| How many can be open? | Many, each in its own window | Many per workbook |
| Where is its name shown? | Title bar | Sheet tab |
| What limits its size? | Memory and file-size limits | 1,048,576 rows by 16,384 columns |
Saving always saves every sheet. If you change one sheet and close the workbook, Excel asks about the whole file.
The default and the limits
A new blank workbook usually starts with one sheet, named Sheet1. Older versions started with three. You can change the starting number in File > Options > General, under "Include this many sheets".
A workbook can hold as many sheets as memory allows. Each sheet has the same grid size, whether it holds one value or a million. Very large grids cost nothing until cells are used, because Excel stores only cells that have content or formatting.
Seeing the structure in a workbook
You can check what a workbook contains in three ways:
- Look at the sheet tabs. Scroll arrows appear when there are too many to fit.
- Right-click the tab navigation arrows at the lower left. A list of all sheets opens, and you can jump to any one.
- Look at the Name Manager (Formulas > Name Manager) to see names and the sheet each one belongs to.
Hidden sheets do not show in the tabs. To check for them, right-click any tab and look at whether Unhide is available. If Unhide is grayed out, no sheet is hidden.
How a formula crosses the boundary
A formula normally refers to cells on its own sheet. To reach another sheet in the same workbook, put the sheet name before the cell address, separated by !. A name with a space must be wrapped in single quotes:
='Q1 Sales'!B4A range works the same way:
=SUM('Q1 Sales'!B2:B10)If the sheet name has no spaces or special characters, the quotes are optional. Excel adds them when needed.
When the formula points to another workbook, the reference gains a third level, the file name in square brackets, such as [Budget.xlsx]Jan!B4. The three levels match the containment model: workbook, then worksheet, then cell.
Working with more than one workbook
Each open workbook has its own set of sheets. Two workbooks can both contain a sheet named Summary with no conflict. The conflict appears only when you move or copy a sheet from one workbook into another that already has a sheet with that name. Excel then renames the incoming sheet, for example Summary (2).
To move or copy a sheet between workbooks, right-click the tab and choose Move or Copy. Pick the destination workbook in the "To book" list. Tick Create a copy to copy instead of move. The destination workbook must be open.
Common errors
- Saving the wrong thing. Learners often say they saved a sheet. Only the workbook can be saved. To send a single sheet, copy it into a new workbook first, then save that file.
- Assuming a deleted sheet can be undone. Deleting a sheet cannot be undone with Ctrl+Z. Save a copy of the workbook before you delete sheets.
- Duplicate names. Sheet names must be unique within a workbook, ignoring case.
DataandDATAcollide. - Name restrictions. A sheet name is at most 31 characters. It cannot contain
\ / ? * [ ] :, and it cannot start or end with an apostrophe. - Mistaking a window for a sheet. View > New Window opens a second window onto the same workbook. It does not create a second copy. Edits in one window show in the other, and the title bar shows
Budget.xlsx:1andBudget.xlsx:2. - Forgetting hidden sheets. A hidden sheet still calculates and still counts in formulas. A "Very Hidden" sheet, set in the VBA editor, does not appear in the Unhide list.
Checking structure with a formula
The SHEET and SHEETS functions report where you are in the structure:
=SHEET()This returns the position number of the sheet holding the formula.
=SHEETS()This returns how many sheets the workbook contains. Both functions count hidden sheets.
To read the file and sheet name into a cell, CELL("filename", A1) returns a string such as C:\Reports\[Budget.xlsx]Jan. It returns an empty result in a workbook that has never been saved, because there is no file name yet.
Decision criteria: one sheet or several?
Use separate sheets when the data is a different kind of thing, such as inputs, calculations, and a summary. Use separate sheets when a person will read them separately.
Use one sheet when the data has the same columns, for example twelve months of sales with identical fields. A single table with a Month column is easier to filter, sort, and total than twelve tabs. Twelve identical tabs also force you into 3D references or repeated formulas, and a typo in one tab is hard to spot.
A workable middle path is one sheet per role: Inputs, Data, Calc, Summary. Others who open the file can see where to look.
Exercise
You open Budget.xlsx, which has the sheets Jan, Feb, and Summary. You delete Feb, save, and close. Can you recover Feb by reopening the file and pressing Ctrl+Z? Also, what would a formula on Summary that referred to Feb!B4 show afterward?
Show answer
No. Undo history is lost when the workbook closes, and a deleted sheet cannot be undone even in the same session. The formula would show #REF! because its target sheet no longer exists. Keep a backup copy before deleting sheets.
Exercise
Write a formula that sums B2:B10 on a sheet named Q2 Sales, and state how many levels of reference you would need if the sheet were in a different, open workbook named Targets.xlsx.
Show answer
=SUM('Q2 Sales'!B2:B10). For another workbook you need three levels: =SUM([Targets.xlsx]'Q2 Sales'!B2:B10) is the idea, and Excel writes it as =SUM('[Targets.xlsx]Q2 Sales'!B2:B10), with the file name in brackets, then the sheet, then the range.