A workbook task contract identifies the file version, named sheet, header row, exact input and output columns, row selection rule, units, blank-cell behavior, and whether the model is reading, proposing, or editing. Capture formula text and displayed values separately. A visible value can be a stale formula result, a manually typed constant, or a rounded display of a more precise number. The prompt should say which fields are authoritative and what evidence must be returned for each claim. A screenshot is useful for layout, but it cannot establish hidden rows, formulas, validation rules, or every sheet in a file. Inspect the workbook structure before asking a model to infer operations from it.
Workbook prompts: name sheets, ranges, types, and provenance
Operational case
A fictional depot asks for a reorder view from Inventory October, version 7. Its Stock sheet has one header row and SKU records below it; B is on-hand units, C is inbound units, D is reserved units, E is a reorder threshold, and F is a formula output. Another sheet, Archive, contains last quarter's numbers. A vague request to 'fix the low items' lets the assistant read the wrong sheet and treat the formatted F value as source data. The bounded request names Stock rows 2 through 48, defines available units as B plus C minus D, and asks for a proposed change list only. It preserves SKU identifiers and excludes Archive. Each proposed result carries its sheet and row address.
Workbook: Inventory October v7; sheet: Stock; rows: 2..48.
Inputs: B on-hand, C inbound, D reserved, E threshold; units: whole items.
Output F: available = B + C - D; flag only if available < E.
Return proposed edits with cell address, old formula, new formula, and reason.
Do not edit Archive or infer hidden rows from a screenshot.Performance and operating cost
Reading N selected rows is O(N), while opening a large workbook can also incur cost from formulas, styles, and linked sheets outside the selected range. Restrict the prompt context to the schema and rows needed for the decision, but retain a stable workbook version and source coordinates so the result can be checked later. Formula evaluation belongs to a spreadsheet calculation engine or independent program. A language model's answer may be well phrased and still use the wrong sheet or a rounded display value. Adding explicit range and unit fields costs a few tokens and prevents expensive full-workbook rework.
Common Mistakes
- Do not identify a workbook only by its filename when several revisions exist.
- Do not treat the displayed value as proof of a current formula result.
- Do not infer hidden rows, formulas, or sheet names from a screenshot.
Connected lessons
- Prompt engineering applications
- Prompt Engineering
- Dataset intake prompts: define a column before analyzing it
- Aggregation prompts: pin the denominator and recompute the rate
- Prompt envelopes: separate task, evidence, input, and output contract
- Formula prompts: test references, types, and fill behavior
- Workbook edits: review a cell diff before applying changes
- Spreadsheet exports: keep untrusted labels as text
- Spreadsheet release checks: recalculate, reconcile, then inspect
- Project: review a depot replenishment workbook
- Spreadsheet prompt and workbook release decisions
Continue with: Chart prompts: produce a reproducible spec and data lineage.
