{"id":"code-work-office-rep-email-lookup-excel-2016","audience":"office","category":"coding","track":"coding","technique":"context","title":"Write a rep email lookup that works in Excel 2016","free":false,"task":"You need a formula for Orders!E2 (filled down) that pulls each rep's email by the rep name in Orders column C. The staff list is on a tab named Staff 2026 (with a space), rows 2-40. Your laptops run Excel 2016, so no XLOOKUP, and the shop system adds a trailing space to every rep name, so trim C2. If a name isn't found, show CHECK NAME. Give one formula in one code block, then one line; under 25 words outside the code, no alternatives.","materialLabel":"Sheet previews (attached to your prompt automatically)","material":"ORDERS sheet (row 1 is headers, data rows 2-640)\nA Order # | B Date | C Rep | D Amount | E Rep email\n10421 | 10/02/2026 | Priya Nand | $1,240 | (empty)\n10422 | 10/02/2026 | Tom Okafor | $310 | (empty)\n10423 | 10/03/2026 | Lena Brooks | $2,050 | (empty)\n10424 | 10/03/2026 | Sam Wilde | $95 | (empty)\n\nSTAFF LIST (row 1 is headers)\nA Name | B Team | C Email | D Start date\nPriya Nand | East | pnand@harborline.co | 2021\nTom Okafor | West | tokafor@harborline.co | 2023\nLena Brooks | East | lbrooks@harborline.co | 2019\n\nNotes from Dee (ops):\n- Sam Wilde left in August.\n- Orders gets pasted in fresh from the shop system every Monday.\n- The Team column is for the holiday party seating chart.\n- Amounts include tax.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not saying your Excel version","why":"The AI reaches for XLOOKUP, which shows #NAME? in Excel 2016.","fix":"Add: \"Excel 2016, no XLOOKUP.\"","checks":["r0"]},{"title":"Not naming the tab","why":"The AI guesses a tab name like Staff, so the formula points at nothing.","fix":"Add: \"The tab is named Staff 2026, with a space.\"","checks":["r0"]},{"title":"Hiding the messy data","why":"The AI can't see trailing spaces, so every match fails.","fix":"Add: \"Names in column C end with a space; trim them.\"","checks":["r1"]},{"title":"Leaving the not-found text open","why":"The AI shows #N/A or its own wording, not the text your team looks for.","fix":"Add: \"If not found, show CHECK NAME.\"","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"]},{"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 15 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Names the Excel version","patterns":["2016","no xlookup","older excel"]},{"label":"Names the staff tab","patterns":["staff 2026","tab (is )?(named|called)"]},{"label":"Mentions the trailing space","patterns":["trim","trailing","space"]},{"label":"Sets the not-found text","patterns":["check name","not found"]},{"label":"Asks for one answer only","patterns":["\\b(one|single|1)\\s+(formula|code block|block|version)","only one","no (alternatives|options|other versions)"]}],"hint":"Three things the AI can't see: your Excel version, the exact tab name and the hidden space after each name. Tell it all three.","rubricLabels":["Points at the staff tab with quotes as 'Staff 2026'! and returns the email from its column C, using VLOOKUP with FALSE or INDEX/MATCH with 0 (not XLOOKUP, which Excel 2016 lacks)","Wraps the Orders name in TRIM (TRIM(C2)) so the trailing space doesn't break the match","Shows the exact text CHECK NAME when the name isn't found (for example IFERROR or IFNA around the lookup)"]}