{"id":"data2-sumifs-region-month-formula","audience":"finance","category":"spreadsheets","track":"data","technique":"constraints","level":"intermediate","title":"Write a SUMIFS formula for region sales in a month","free":false,"task":"Finance wants a single cell that totals West region sales for the month typed in cell F1. Ask for one Excel formula in a single code block, then exactly 2 numbered lines labeled Counts: and Skips:, under 40 words outside the code. The date column holds real dates, and the formula must still work when more rows are added below. Round the result to whole dollars because the director reads it on a dashboard.","materialLabel":"Sheet layout (attached to your prompt automatically)","material":"Sheet: Sales (Excel) - Sunrise Wholesale\n\nA Order date | B Region | C Rep | D Amount | E Status\n2025-10-03 | West | Imani | 1,200 | Paid\n2025-10-17 | East | Gus | 800 | Paid\n2025-10-21 | West | Imani | 450 | Refunded\n2025-11-02 | West | Lee | 900 | Paid\n2025-10-29 | West | Lee | 600 | Paid\n\nSummary cell:\nF1 holds the first day of the month wanted, as a real date (for example 2025-10-01).\nF2 is where the formula goes.\n\nNotes:\n- The table grows by about 200 rows each month; the formula should cover whole columns or a range that grows.\n- Amount is a number in D. Status is Paid or Refunded; refunded orders must not count.\n- \"Month\" means every date from F1 up to but not including the first day of the next month.\n- Excel 2016.","rules":[{"type":"codeBlocks","count":1},{"type":"numberedItems","count":2},{"type":"maxProseWords","max":40}],"mistakes":[{"title":"Filtering by month name","why":"The AI uses TEXT() or MONTH() tricks that miss the year or break.","fix":"Add: \">= F1 and < EDATE(F1,1) on the date column.\"","checks":["r0"]},{"title":"Counting refunds","why":"Nothing in the formula stops refunded orders from being summed.","fix":"Add: \"Status must equal Paid.\"","checks":["r1"]},{"title":"Fixed small ranges","why":"The AI limits ranges to A2:A6 and it breaks as rows are added.","fix":"Add: \"Whole-column ranges so new rows are included.\"","checks":["r2"]},{"title":"Leaving the format to chance","why":"The AI picks its own length and layout unless told the exact shape.","fix":"Add: \"Put the code in exactly 1 code block. Exactly 2 numbered lines. Keep the writing outside the code under 40 words.\"","checks":["codeBlocks","numberedItems","maxProseWords"]}],"promptHints":[{"label":"Names SUMIFS","patterns":["sumifs"]},{"label":"Gives the date boundaries","patterns":["edate",">=","first day of the next month"]},{"label":"Adds the Paid condition","patterns":["paid","status"]},{"label":"Wants growing ranges","patterns":["whole.column","a:a","grow"]},{"label":"Fixes the shape","patterns":["counts:","skips:","exactly 2"]}],"hint":"Multi-condition sums need the date boundaries and status spelled out, and a shape the AI can't bury in prose.","mission":"Sum west region sales for a month.","musts":["One SUMIFS formula","Month boundaries from F1","Paid orders only"],"rubricLabels":["The code block holds one SUMIFS formula wrapped in ROUND(...,0) (whole dollars) that sums column D with criteria for Region = \"West\" and Status = \"Paid\"","The date criteria use two conditions on column A: \">=\"&F1 and \"<\"&EDATE(F1,1) (or an equivalent end-of-month boundary), not a text match on the month name","The ranges grow with the table (whole columns such as D:D), and the 2 numbered lines are labeled Counts: and Skips:, with Skips mentioning refunded orders or other months"]}