{"id":"code-work-hr-tenure-years-months","audience":"hr","category":"coding","track":"coding","technique":"format","title":"Show employee tenure as years and months","free":false,"task":"Write one Excel formula for Staff!E2 (filled down) that shows tenure from the start date in C2 to the review date in $H$1 (not today) as text exactly like 4y 7m. New hires whose start date is after $H$1 must show Not started. One formula in one code block, then under 25 words outside the code.","materialLabel":"Staff sheet preview (attached to your prompt automatically)","material":"STAFF sheet - Fernbrook Dental Group (row 1 is headers)\nA Name | B Role | C Start date | D Location | E Tenure\nMaya Chen | Office Coordinator | 03/14/2022 | Eastside | ?\nLuis Romero | Bookkeeper | 11/01/2019 | Main | ?\nPriya Shah | Receptionist | 06/30/2026 | Main | ?\nTom Fisher | Hygienist | 01/12/2015 | Eastside | ?\nAiko Tanaka | Assistant | 12/07/2026 | Main | ?\n\nH1: 11/30/2026 (annual review cutoff)\n\nNotes from Gwen (HR):\n- Tenure goes into the review letters, so it has to read naturally.\n- Aiko accepted her offer last week and starts in December.\n- Service awards are given at 5, 10 and 15 years.\n- Two people transferred between locations; transfers don't reset tenure.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not giving the review date","why":"The AI uses TODAY(), so tenure in the letters changes daily.","fix":"Add: \"Measure to the review date in $H$1.\"","checks":["r0"]},{"title":"Not showing the format","why":"The AI returns 4.6 years or \"4 years, 7 months\".","fix":"Add an example: \"exactly like 4y 7m\".","checks":["r1"]},{"title":"Forgetting future hires","why":"DATEDIF errors when the start date is after the end date.","fix":"Add: \"If C2 is after $H$1, show Not started.\"","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 10 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Uses the review date","patterns":["h1","review date","not today"]},{"label":"Shows the format","patterns":["\\dy \\dm","4y 7m","years and months"]},{"label":"Handles future hires","patterns":["not started","future","after"]},{"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":"Show the AI exactly how tenure should read, which date to measure to, and what new hires should show.","rubricLabels":["Measures from C2 to $H$1 (locked), not TODAY()","Builds the text exactly like 4y 7m using DATEDIF with \"y\" for years and \"ym\" for leftover months (or equivalent math)","Shows Not started when C2 is after $H$1, checked before DATEDIF (which would otherwise error)"]}