{"id":"code-work-office-room-hours-sumifs","audience":"office","category":"coding","track":"coding","technique":"context","title":"Total room booking hours by month with SUMIFS","free":false,"task":"On your Summary sheet, cell A2 holds a room name and cell B1 holds the first day of a month (like 3/1/2026). Write the formula for Summary!B2 that totals Bookings hours for the room in A2 within B1's month; you'll copy it down to B3:B6 for the rooms in A3:A6, so lock B1. No typed-in room names or dates. One formula in one code block (one line), then under 20 words outside the code.","materialLabel":"Bookings sheet preview (attached to your prompt automatically)","material":"BOOKINGS sheet - exported from Roomly every Friday (row 1 is headers, data in rows 2-400)\nA Date | B Room | C Booked by | D Hours | E Purpose\n02/27/2026 | Room B | Jae Kim | 2 | Vendor call\n03/02/2026 | Room B | Ana Ortiz | 1.5 | Interviews\n03/02/2026 | Atrium | Ana Ortiz | 3 | All-hands prep\n03/09/2026 | Room C | Raj Mehta | 1 | 1:1\n03/31/2026 | Room B | Lou Grant | 4 | Training\n04/01/2026 | Room B | Jae Kim | 2 | Budget review\n\nNotes:\n- Column A holds real dates, not text.\n- Hours are in half-hour steps.\n- The Atrium is shared with the 3rd floor tenant.\n- Last year we tracked this by hand in a notebook at reception.\n- Room D is being turned into storage in May.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":1},{"type":"maxProseWords","max":20}],"mistakes":[{"title":"Not saying where the inputs live","why":"The AI types \"Room B\" and the dates straight into the formula, so it breaks for every other room and month.","fix":"Add: \"Room name is in A2, first day of the month is in B1. No typed-in names or dates.\"","checks":["r0","r1"]},{"title":"Forgetting you'll copy it down","why":"The AI leaves B1 unlocked, so the next row points at B2 and the totals go wrong.","fix":"Add: \"I'll copy it down to B6, so lock B1 as $B$1.\"","checks":["r2"]},{"title":"Getting a menu of options","why":"The AI likes to offer two or three versions of the formula, so you're left to pick and test them yourself.","fix":"Add: \"Give one formula only, in one code block, no alternatives.\"","checks":["codeBlocks","maxCodeLines"]},{"title":"Letting the code sprawl","why":"The AI pads the formula with extras nobody asked for, so it grows long and harder to check.","fix":"Add: \"At most 1 lines of code.\"","checks":["maxCodeLines"]},{"title":"Getting a tutorial","why":"By default the AI explains every part of the code at length, which you then have to scroll past.","fix":"Add: \"After the code, one line under 12 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Says where the room and month are","patterns":["a2","b1","cell"]},{"label":"Mentions copying it down","patterns":["copy","fill down","drag","\\$b\\$1","lock"]},{"label":"Asks for the month's date range","patterns":["month","eomonth","edate"]},{"label":"Asks for one answer only","patterns":["\\b(one|single|1)\\s+(formula|code block|block|version)","only one","no (alternatives|options|other versions)"]},{"label":"Limits the explanation","patterns":["\\d+\\s*words","no (explanation|notes|commentary)","one (short )?(line|sentence)","nothing else"]}],"hint":"The AI can't see your Summary sheet. Tell it which cells hold the room and the month, and that you'll copy the formula down.","rubricLabels":["Uses SUMIFS on the Bookings hours column D with the Bookings room column B matched to cell A2 (not the typed text \"Room B\")","Limits dates with cell B1: on or after B1 and before EDATE(B1,1), or on or before EOMONTH(B1,0), with no typed-in dates","Locks the month cell (as $B$1 or B$1) while leaving A2 relative, so copying down to rows 3-6 still works"]}