{"id":"sheet-off-visitor-log-extension-lookup","audience":"office","category":"spreadsheets","track":"data","technique":"context","title":"Look up host extensions on the visitor log from the staff tab","free":false,"task":"You want column D of the Visitor Log to show each host's phone extension from the Staff tab. The front desk types host names with stray spaces, and names not on the Staff tab must show Ask front desk instead of an error. Ask for one formula for D2 in one code block, then exactly 2 numbered lines labeled Fixes: (what the formula handles) and Shows: (what Marta Gil's row will show). Under 45 words outside the code.","materialLabel":"Your two tabs (attached to your prompt automatically)","material":"VISITOR LOG tab (Google Sheets)\nA Time in | B Visitor | C Host | D Host extension\n9:02 | Sam Lee | Marta Gil  |\n9:15 | Ola Diaz |  Ken Wu |\n9:40 | Ray Tan | Priya Shah |\n10:05 | Lia Moss | Tom Briggs |\n\nSTAFF tab\nA Name | B Extension | C Floor\nKen Wu | 4410 | 3\nMarta Gil | 4512 | 5\nPriya Shah | 4127 | 2\nDana Cole | 4630 | 5\n\nNotes:\n- Tom Briggs is a contractor this month, not on the Staff tab\n- Some host cells have a space before or after the name (copied from emails)\n- About 60 visitors a day; the front desk fills rows top to bottom\n- Last week's formula showed #N/A for half the rows","rules":[{"type":"codeBlocks","count":1},{"type":"numberedItems","count":2},{"type":"maxProseWords","max":45}],"mistakes":[{"title":"Not mentioning the spaces","why":"The AI writes a plain lookup, and \"Marta Gil \" with a trailing space never matches.","fix":"Add: \"Host names have stray spaces; trim them.\"","checks":["r0"]},{"title":"No plan for missing names","why":"The formula shows #N/A for contractors, the same problem as last week.","fix":"Add: \"Show Ask front desk when the name isn't on Staff.\"","checks":["r1"]},{"title":"No check row","why":"Without one known answer you can't tell if it works.","fix":"Add: \"Shows: what Marta Gil's row will show.\"","checks":["r2","numberedItems"]},{"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"]},{"title":"Getting a tutorial","why":"By default the AI explains every part of the formula at length.","fix":"Add: \"Each line under 15 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Mentions stray spaces","patterns":["space","trim"]},{"label":"Handles missing names","patterns":["ask front desk","not found","missing","#n/a"]},{"label":"Asks for a check row","patterns":["marta","shows:","check"]},{"label":"Asks for one formula","patterns":["one formula","one code block","single formula","no alternatives"]}],"hint":"Lookups fail on invisible spaces and missing names. Mention both, and ask for one row whose answer you already know.","rubricLabels":["The formula looks up the trimmed host name (TRIM(C2)) on the Staff tab with exact match and returns the Extension column (for example VLOOKUP(TRIM(C2),Staff!A:B,2,FALSE) or XLOOKUP)","The formula shows the text Ask front desk when the name isn't found (for example with IFERROR or XLOOKUP's not-found argument), so Tom Briggs doesn't show #N/A","After the code there are 2 numbered lines labeled Fixes: (stray spaces and missing names) and Shows: (the line contains the number 4512)"]}