{"id":"sheet-hr-service-award-years-formula","audience":"hr","category":"spreadsheets","track":"data","technique":"context","title":"Get a years-of-service formula for a fixed award date","free":false,"task":"Service awards go to people reaching 5, 10, 15 or 20 full years as of December 31, 2026, not as of today. Ask for one formula for D2 that returns full years of service from the hire date in C2 to Dec 31, 2026, in one code block, then exactly 2 numbered lines: Why not today: and Check: (which says what Lena Ortiz's row should show). Under 50 words outside the code.","materialLabel":"Your employee sheet (attached to your prompt automatically)","material":"Sheet: Service Awards 2026 (Google Sheets)\n\nA Employee | B Dept | C Hire date | D Years at Dec 31, 2026 | E Award\nLena Ortiz | Finance | 2016-03-15 | |\nMarcus Bell | Warehouse | 2021-07-01 | |\nHoa Tran | IT | 2011-01-10 | |\nGabe Lund | Sales | 2017-01-05 | |\nAsha Rao | HR | 2006-11-30 | |\n\nNotes:\n- 212 employees, rows 2-213\n- Awards dinner is in January, list goes to the engraver Dec 1\n- Someone last year used =YEAR(TODAY())-YEAR(C2) and gave a 10-year plaque to a person at 9 years 2 months\n- Column E will use D to pick the award later","rules":[{"type":"codeBlocks","count":1},{"type":"numberedItems","count":2},{"type":"maxProseWords","max":50}],"mistakes":[{"title":"Not giving the cutoff date","why":"The AI uses TODAY(), so anyone with an anniversary in November or December is missed.","fix":"Add: \"Years as of December 31, 2026, not today.\"","checks":["r0"]},{"title":"Accepting year subtraction","why":"Subtracting years rounds people up, which is how someone got a plaque early last year.","fix":"Add: \"Full completed years only.\"","checks":["r1"]},{"title":"No check row","why":"Without one known answer you can't tell whether the formula works.","fix":"Add: \"Check: say what Lena Ortiz's row should 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 20 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Gives the cutoff date","patterns":["dec(ember)? 31","2026,\\s*12,\\s*31","not today"]},{"label":"Asks for full years","patterns":["full years","completed years","datedif"]},{"label":"Asks for a check row","patterns":["check","lena"]},{"label":"Asks for one formula","patterns":["one formula","one code block","no alternatives"]}],"hint":"Date formulas need a date to count to. Give the AI the cutoff and one row whose answer you already know.","rubricLabels":["The formula counts full years from C2 to December 31, 2026 (for example =DATEDIF(C2, DATE(2026,12,31), \"Y\")), not to TODAY()","The formula counts completed years only, not a subtraction of year numbers like YEAR(...)-YEAR(C2)","After the code there are 2 numbered lines labeled Why not today: (the list is made before Dec 31, so today would undercount) and Check: (Lena Ortiz, hired March 15, 2016, shows 10)"]}