Prompt Details
Model
(claude-5-5-sonnet)
Token size
4,042
Example input
[HOW_DATA_IS_CAPTURED_NOW]: A retail warehouse uses Excel to record inventory movements. Existing columns are Date, Product, Quantity, Movement and Notes. Warehouse staff enter records manually. Quantities sometimes appear as "5 boxes", "12 pcs" or simply "10". Product names are inconsistent, and some movements are recorded twice. Example entries: "2026-11-10, Item A, 5 boxes, IN" and "11/10, Item-A, 12 pcs, received".
[QUESTION_THE_DATA_SHOULD_ANSWER]: Which products experience the largest differences between expected stock and physical stock, and how often do discrepancies occur?
Example output
## 1. CAPTURE POINT
- **Row means:** In the current log, one row is one inventory movement of one product on one date. The question also needs physical stock counts, which the current log does not capture, so the design adds a separate count record.
- **Entered by:** Warehouse staff, manually in Excel. Individual roles and the number of staff are UNKNOWN.
- **Problems seen:**
- Quantities mix numbers and units ("5 boxes", "12 pcs", "10"), and "10" has no unit.
- Product names are inconsistent ("Item A", "Item-A").
- Movement labels differ ("IN", "received").
- Date formats differ ("2026-11-10", "11/10").
- Some movements are recorded twice.
- Label and date variation is evidenced only by the two example entries.
- Missing values, other movement types, locations and stock-count practice are not evidenced.
- **Later question:** Which products show the largest differences between expected and physical stock, and how often do discrepancies occur?
- **Measurement contract (PROVISIONAL):**
- **Expected stock** is the last accepted physical count of the product plus IN minus OUT movements since that count. Movement dates are after the previous count date and up to the current count date.
- **Discrepancy** is physical count minus expected, signed, in pieces.
- **Size** is the sum of absolute discrepancies per product over a chosen period. A relative version divides that by the sum of expected stock, so products with different volumes can be compared.
- **Frequency** is the number of accepted counts with a non-zero discrepancy. **Rate** is that number divided by the accepted counts with a computable expectation.
- **Excluded:** confirmed duplicate movements, count-correction movements, and counts that are not ACCEPTED.
- **Uncertainties:**
- "Largest" could mean units, percentage or monetary value. Value would require unit cost, which is not captured.
- A single stock pool is assumed because locations are UNKNOWN.
- A discrepancy shows only that stock differed between two counts, not when or why it arose.
## 2. FIELD TREE
```
SHEET: products
ROW MEANS: one product in the reference list
KEY: product_code
LINKS: Referenced by movements.product_code and stock_counts.product_code (one product to many records). Integrity: entries must exist in this sheet; unmatched codes are flagged.
FIELD: product_code
Action: ADD
Origin: PROPOSED
Meaning: stable identifier replacing free-text product names
Serves: linking movements and counts; product-level results
Type: ID
Entry: MANUAL (set once by a reviewer)
Required: ALWAYS
Allowed: unique, format P-0001
Missing: none permitted
Validation: BLOCK duplicate or empty code
Good: P-0001
Bad: Item-A
Confidence: HIGH — product-level comparison needs stable identity
FIELD: product_name
Action: CHANGE
Origin: EXISTING
Meaning: one agreed display name per product_code
Serves: integrity (lets staff and reviewers recognize the code; maps old names)
Type: TEXT
Entry: MANUAL
Required: ALWAYS
Allowed: one name per code
Missing: none permitted
Validation: FLAG if two codes share a name
Good: Item A
Bad: Item A / Item-A (two variants of one product)
Confidence: HIGH — name variants are observed
FIELD: units_per_box
Action: ADD
Origin: PROPOSED
Meaning: pieces in one box of this product
Serves: converting BOX quantities to pieces for expected stock and discrepancy
Type: INTEGER (pieces per box)
Entry: MANUAL
Required: when the product is ever entered in BOX
Allowed: whole number > 0
Missing: NOT APPLICABLE if never handled in boxes: leave empty. Any BOX entry for a product with an empty value is blocked, which documents the meaning of the empty cell.
Validation: BLOCK zero, negative or non-integer
Good: 24
Bad: 0
Confidence: MEDIUM — assumes a fixed box size per product. COMMON risk: box contents vary.
SHEET: movements
ROW MEANS: one IN or OUT movement of one product on one date
KEY: movement_id
LINKS: product_code to products.product_code (many movements to one product). Integrity: must exist in products; lookup failure is flagged.
FIELD: movement_id
Action: ADD
Origin: PROPOSED
Meaning: unique identifier of the movement record
Serves: independent identification; duplicate review
Type: ID
Entry: SYSTEM (pre-numbered values filled in order)
Required: ALWAYS
Allowed: MV-000001 format, unique
Missing: none permitted
Validation: BLOCK duplicate ID
Good: MV-000123
Bad: 123 (blank or reused)
Confidence: HIGH — record integrity
FIELD: movement_date
Action: CHANGE
Origin: EXISTING
Meaning: calendar date the stock physically moved
Serves: assigning movements to count windows
Type: DATE (yyyy-mm-dd)
Entry: MANUAL
Required: ALWAYS
Allowed: real date, not in the future
Missing: none permitted; if unsure, resolve before saving
Validation: BLOCK non-dates and future dates. FLAG dates more than an agreed number of days before today (threshold to be set by the team).
Good: 2026-11-10
Bad: 11/10
Confidence: HIGH — mixed formats are observed
FIELD: product_code
Action: CHANGE
Origin: EXISTING
Meaning: product moved, chosen from products (replaces typed Product)
Serves: per-product results
Type: CATEGORY (ID list)
Entry: MANUAL (dropdown)
Required: ALWAYS
Allowed: values in products.product_code
Missing: none permitted
Validation: BLOCK values not in list. FLAG pasted unmatched codes.
Good: P-0001
Bad: Item-A
Confidence: HIGH — name variants are observed
FIELD: movement_type
Action: CHANGE
Origin: EXISTING
Meaning: direction of stock change
Serves: sign of the movement in expected stock
Type: CATEGORY
Entry: MANUAL (dropdown)
Required: ALWAYS
Allowed: IN | OUT (to be confirmed by the team)
Missing: none permitted
Validation: BLOCK other values
Good: IN
Bad: received
Confidence: MEDIUM — only IN and "received" are evidenced. OUT is assumed. COMMON: returns or transfers may need separate handling.
FIELD: quantity
Action: CHANGE
Origin: EXISTING
Meaning: number of entry_unit items moved; always positive, direction comes from movement_type
Serves: expected stock
Type: INTEGER (in entry_unit)
Entry: MANUAL
Required: ALWAYS
Allowed: whole number > 0
Missing: none permitted
Validation: BLOCK text, zero, negative, decimals. FLAG unusually large values (threshold to be set from pilot data).
Good: 5
Bad: 5 boxes
Confidence: HIGH — mixed number-plus-unit entries are observed
FIELD: entry_unit
Action: ADD
Origin: PROPOSED
Meaning: unit in which quantity was counted
Serves: unambiguous conversion to pieces
Type: CATEGORY
Entry: MANUAL (dropdown)
Required: ALWAYS
Allowed: PCS | BOX (confirm the list is complete)
Missing: none permitted
Validation: BLOCK other values. BLOCK BOX if the product's units_per_box is empty.
Good: BOX
Bad: boxes
Confidence: HIGH — "boxes" and "pcs" are observed
FIELD: is_count_correction
Action: ADD
Origin: PROPOSED
Meaning: TRUE if the movement only adjusts system stock to match a physical count
Serves: excluding adjustments that would hide discrepancies
Type: BOOLEAN
Entry: MANUAL (dropdown)
Required: ALWAYS
Allowed: TRUE | FALSE
Missing: none permitted
Validation: BLOCK other values. FLAG TRUE rows with empty notes.
Good: FALSE
Bad: empty
Confidence: MEDIUM — needed only if the team posts corrections as movements (UNKNOWN)
FIELD: duplicate_review_status
Action: ADD
Origin: PROPOSED
Meaning: reviewer's decision on a possible duplicate
Serves: removing double entries from calculations without deleting rows
Type: CATEGORY
Entry: MANUAL (reviewer only)
Required: when possible_duplicate_flag is TRUE
Allowed: PENDING | NOT_DUPLICATE | CONFIRMED_DUPLICATE
Missing: NOT APPLICABLE when the flag is FALSE: leave empty, explained by the flag. An empty value with the flag TRUE is treated as PENDING.
Validation: BLOCK other values. FLAG flag TRUE with empty status.
Good: CONFIRMED_DUPLICATE
Bad: deleted row
Confidence: HIGH — duplicates are observed
FIELD: notes
Action: KEEP
Origin: EXISTING
Meaning: optional human comment
Serves: reviewer context for duplicates and corrections; never used in calculations
Type: TEXT
Entry: MANUAL
Required: NEVER
Allowed: free text
Missing: empty means no comment
Validation: FLAG notes that contain numbers followed by units (suggests data hidden in text)
Good: Supplier delivery late
Bad: also 3 more boxes
Confidence: MEDIUM — current Notes content is UNKNOWN
FIELD: quantity_base_units
Action: ADD
Origin: DERIVED
Meaning: quantity converted to pieces
Serves: all metrics
Type: INTEGER (pieces)
Entry: CALCULATED
Required: ALWAYS
Allowed: whole number > 0
Missing: empty when unit or conversion data is unavailable
Validation: FLAG any empty result
Good: 120
Bad: empty
Confidence: HIGH — manual conversion would be error-prone
Calculation: PCS: quantity. BOX: quantity × units_per_box. Otherwise empty.
FIELD: possible_duplicate_flag
Action: ADD
Origin: DERIVED
Meaning: TRUE if another row has the same product_code, movement_date, movement_type and quantity_base_units
Serves: duplicate review
Type: BOOLEAN
Entry: CALCULATED
Required: ALWAYS
Allowed: TRUE | FALSE
Missing: none permitted
Validation: FLAG when TRUE (a review signal, not proof)
Good: TRUE
Bad: automatic deletion
Confidence: HIGH — COMMON: genuine identical movements can also match.
Calculation: COUNTIFS on the four fields > 1; FALSE if quantity_base_units is empty.
SHEET: stock_counts
ROW MEANS: one physical count of one product at close of business on one date
KEY: count_id
LINKS: product_code to products.product_code (many counts to one product). Integrity: must exist in products.
FIELD: count_id
Action: ADD
Origin: PROPOSED
Meaning: unique identifier of the count record
Serves: record integrity
Type: ID
Entry: SYSTEM (pre-numbered)
Required: ALWAYS
Allowed: SC-000001 format, unique
Missing: none permitted
Validation: BLOCK duplicate ID
Good: SC-000010
Bad: reused ID
Confidence: HIGH — record integrity
FIELD: count_date
Action: ADD
Origin: PROPOSED
Meaning: date of the physical count, taken after that day's movements were logged
Serves: bounding the movement window
Type: DATE (yyyy-mm-dd)
Entry: MANUAL
Required: ALWAYS
Allowed: real date, not in the future
Missing: none permitted
Validation: BLOCK invalid or future dates
Good: 2026-11-30
Bad: 30/11
Confidence: MEDIUM — end-of-day counting is an assumption to confirm
FIELD: product_code
Action: ADD
Origin: PROPOSED
Meaning: product counted
Serves: per-product results
Type: CATEGORY (ID list)
Entry: MANUAL (dropdown)
Required: ALWAYS
Allowed: values in products.product_code
Missing: none permitted
Validation: BLOCK values not in list
Good: P-0001
Bad: Item A
Confidence: HIGH
FIELD: counted_qty
Action: ADD
Origin: PROPOSED
Meaning: quantity physically counted, in count_unit
Serves: physical stock side of the discrepancy
Type: INTEGER (in count_unit)
Entry: MANUAL
Required: ALWAYS
Allowed: whole number ≥ 0 (0 means nothing found)
Missing: none permitted; uncounted products get no row
Validation: BLOCK text, negative, decimals
Good: 0
Bad: about 40
Confidence: HIGH
FIELD: count_unit
Action: ADD
Origin: PROPOSED
Meaning: unit of counted_qty
Serves: conversion to pieces
Type: CATEGORY
Entry: MANUAL (dropdown)
Required: ALWAYS
Allowed: PCS | BOX
Missing: none permitted
Validation: BLOCK other values. BLOCK BOX if units_per_box is empty.
Good: PCS
Bad: units
Confidence: MEDIUM — mirrors entry_unit
FIELD: count_status
Action: ADD
Origin: PROPOSED
Meaning: whether the count is accepted for analysis
Serves: excluding recounted, doubtful or duplicate counts
Type: CATEGORY
Entry: MANUAL (reviewer sets ACCEPTED or EXCLUDED; staff enter PENDING)
Required: ALWAYS
Allowed: PENDING | ACCEPTED | EXCLUDED
Missing: none permitted
Validation: BLOCK other values. FLAG more than one ACCEPTED count for the same product and date.
Good: ACCEPTED
Bad: empty
Confidence: MEDIUM — review workflow needs operational confirmation
FIELD: counted_base_units
Action: ADD
Origin: DERIVED
Meaning: counted_qty in pieces
Serves: discrepancy calculation
Type: INTEGER (pieces)
Entry: CALCULATED
Required: ALWAYS
Allowed: whole number ≥ 0
Missing: empty if conversion is unavailable
Validation: FLAG empty results
Good: 240
Bad: empty
Confidence: HIGH
Calculation: PCS: counted_qty. BOX: counted_qty × units_per_box.
FIELD: previous_count_date
Action: ADD
Origin: DERIVED
Meaning: date of the latest earlier ACCEPTED count of the same product
Serves: baseline for expected stock
Type: DATE
Entry: CALCULATED
Required: when count_status is ACCEPTED
Allowed: earlier count_date
Missing: empty means no baseline (first count of the product)
Validation: FLAG empty on ACCEPTED rows (baseline row, not an error)
Good: 2026-11-23
Bad: a later date
Confidence: HIGH
Calculation: latest count_date < this count_date, same product, count_status = ACCEPTED.
FIELD: expected_base_units
Action: ADD
Origin: DERIVED
Meaning: stock the records say should exist at this count
Serves: discrepancy and its relative size
Type: INTEGER (pieces)
Entry: CALCULATED
Required: when count_status is ACCEPTED and previous_count_date exists
Allowed: integer
Missing: empty when there is no baseline, the count is not ACCEPTED, or any window movement lacks quantity_base_units
Validation: FLAG negative results and windows with unreviewed possible duplicates
Good: 250
Bad: negative stock
Confidence: MEDIUM — depends on complete movement logging
Calculation: counted_base_units of the previous ACCEPTED count + IN − OUT base units. Movements are for the same product, dated after previous_count_date up to count_date. Excludes CONFIRMED_DUPLICATE and is_count_correction = TRUE.
FIELD: discrepancy_base_units
Action: ADD
Origin: DERIVED
Meaning: physical minus expected (negative = shortfall)
Serves: size and frequency metrics
Type: INTEGER (pieces)
Entry: CALCULATED
Required: when expected_base_units exists
Allowed: integer
Missing: empty when expected is empty
Validation: FLAG very large absolute values (threshold from pilot)
Good: -10
Bad: 0 used for "not calculated"
Confidence: HIGH
Calculation: counted_base_units − expected_base_units.
```
## 3. ENTRY RULES
1. Pick the product from the dropdown. WRONG: typing "Item-A" | RIGHT: selecting P-0001.
2. Type dates as year-month-day. WRONG: 11/10 | RIGHT: 2026-11-10.
3. Enter only a whole number in quantity and choose the unit separately. WRONG: "5 boxes" in quantity | RIGHT: quantity 5, entry_unit BOX.
4. Choose IN or OUT from the list. WRONG: received | RIGHT: IN.
5. Log each movement once and check the duplicate flag. WRONG: logging it again "to be safe" or deleting a flagged row | RIGHT: leave it and let the reviewer set CONFIRMED_DUPLICATE.
6. Record physical counts in stock_counts after the day's movements are logged. WRONG: "counted 40" in movement notes | RIGHT: a stock_counts row with counted_qty 40.
7. Mark correction movements. WRONG: an unmarked IN of 3 pieces to match a count | RIGHT: the same row with is_count_correction TRUE.
8. Add a new row for a recount. WRONG: overwriting counted_qty 40 with 42 | RIGHT: a new row with 42 and the reviewer sets the earlier row to EXCLUDED.
9. Keep notes for comments only. WRONG: notes "plus 5 more" | RIGHT: a separate movement row.
## 4. SETUP STEPS
1. Save the current workbook as a read-only archive and do not edit it. Create a new workbook for future entries with sheets `products`, `movements`, `stock_counts`, `lists` and `notes`.
2. Add the headers from the field tree. Format each entry range as an Excel Table (Insert > Table).
3. On `lists`, enter the controlled values: IN/OUT, PCS/BOX, TRUE/FALSE, PENDING/ACCEPTED/EXCLUDED, and the duplicate statuses. Have the warehouse lead confirm them, then name the ranges (Formulas > Define Name).
4. Build `products` from the product names the warehouse team agrees on, assigning each name a code. Use Data > Data Validation with a custom `COUNTIF` rule to block duplicate codes.
5. Apply formats and validation (Data > Data Validation):
- **Dates:** custom `=AND(ISNUMBER(x), x<=TODAY())`, with the cell format `yyyy-mm-dd`.
- **quantity:** whole number > 0.
- **counted_qty:** whole number ≥ 0.
- **Category fields:** list rules using the named ranges.
- **BOX blocks:** custom rules that look up `units_per_box`.
6. Pre-fill `movement_id` and `count_id` values in sequence (for example, 5,000 rows). Staff use the next empty row. Add a custom rule to block duplicate IDs.
7. Add the derived columns with `INDEX/MATCH`, `COUNTIFS`, `MAXIFS` and `SUMIFS`. Return an empty string when inputs are missing. Use `ISNUMBER` when analyzing, because an empty string is text. Excel tables expand formulas to new rows. If protecting the sheet, fill the formulas down to the fixed row range instead.
8. Add conditional formatting to highlight flags: `possible_duplicate_flag` TRUE, empty `quantity_base_units`, `is_count_correction` TRUE with empty notes, and FLAG-level expected or discrepancy values.
9. Protect headers and derived columns (Review > Protect Sheet) with entry cells unlocked. Protection stops casual edits but is not security. Excel does not expand tables on a protected sheet, so use the fixed-range approach from step 7. Pasting can bypass validation, so use a weekly review of the flags.
10. Use `notes` for dated definitions: the expected-stock formula, count timing, discrepancy sign, any tolerance (see GAPS), and every rule change with its effective date.
11. Run a small pilot (see LIMITS) before relying on results.
## 5. FIT VERDICT
VERDICT: ANSWERABLE IN PART
The frequency and unit-based size questions are supported once baseline counts exist and counting is regular. "Largest" is materially ambiguous, and the value-based reading is unsupported because unit cost is not captured. The current log has no physical counts, so nothing can be answered from existing data today.
| Metric | Required Fields | Calculation | Exclusions | Design Status |
|---|---|---|---|---|
| Discrepancy size per product (pieces) | product_code, count_date, discrepancy_base_units, count_status | Sum of absolute discrepancy per product over the period, ranked | Non-ACCEPTED counts; empty expected (no baseline) | CONDITIONAL |
| Relative discrepancy per product | the above + expected_base_units | Sum of absolute discrepancy ÷ sum of expected, where expected > 0 | Same, plus expected ≤ 0 | CONDITIONAL |
| Discrepancy frequency (count) | product_code, count_status, discrepancy_base_units | Number of ACCEPTED counts with discrepancy ≠ 0 | Counts without a computed discrepancy | CONDITIONAL |
| Discrepancy rate | same | Frequency ÷ ACCEPTED counts with a computed discrepancy | Same | CONDITIONAL |
| Value-weighted discrepancy | unit cost | Not available | — | UNSUPPORTED |
GAPS:
- It is UNKNOWN whether physical counts are already performed and how often. Frequency and rate depend on count cadence, not on when discrepancies actually occurred.
- "Largest" must be chosen: pieces, percentage or value. Value needs unit cost, which is not captured.
- Whether discrepancy means any non-zero difference or only those above a tolerance is UNKNOWN.
- Locations or lots are UNKNOWN. A single stock pool is assumed.
- The full list of movement types and units is UNKNOWN.
- Count timing (end of day) and the count-correction practice need confirmation.
- Units other than pieces and boxes are possible but UNKNOWN.
OLD DATA:
- Date: ISO values such as "2026-11-10" are TRANSFORM. Values such as "11/10" are REVIEW, because the day/month order and the year are unconfirmed.
- Product: REVIEW. Variants such as "Item A" and "Item-A" need confirmed mapping to codes.
- Quantity: numbers with "pcs" are TRANSFORM. Numbers with "boxes" are REVIEW until units_per_box is known. Unitless values such as "10" are REVIEW.
- Movement: "IN" is DIRECT. "received" is TRANSFORM to IN, to be confirmed. Other values are UNKNOWN.
- Notes: DIRECT.
- Duplicate status: REVIEW. Possible duplicates among old rows need human review.
- Physical counts, opening stock and unit cost: UNAVAILABLE. Old movements can feed expected stock only after a baseline count.
IMPLEMENTATION STATUS: PROPOSED — NOT IMPLEMENTED OR TESTED.
## 6. LIMITS
- The design cannot prevent miscounts, movements never logged, wrong product or quantity choices, or incorrect box-size data. It cannot tell whether a discrepancy came from theft, damage, receiving errors, timing or entry errors. Excel validation can be bypassed by pasting.
- In a small pilot, check the following:
- Whether staff leave required values empty or misuse the unit and correction fields.
- Whether the duplicate flag catches repeats without too many false alarms.
- Whether expected stock reconciles by hand for several products and windows.
- Whether baseline counts exist and counting is regular.
- Whether the discrepancy, relative size, frequency and rate results match manual recalculation.
- Outside the design are access rights, workbook backup and change control, record-retention periods, and any privacy rules. The design records no personal data, and staff identity fields were deliberately not added.
Capture designed, not tested. Try it on a small set of real entries before rolling it out.
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-5-SONNET
Turn inconsistent spreadsheets, forms, and manual logs into structured, analysis-ready data capture designs.
The ROWS+ engine identifies recording problems, defines measurable outcomes, designs fields and validation rules, handles missing values and duplicates, and evaluates whether your future data can answer your business questions.
Get a practical capture blueprint, staff entry rules, software-specific setup guidance, and historical data mapping without overwriting existing records.
...more
Added 20 minutes ago
