{"id":"sheet-mkt-campaign-days-running-formula","audience":"marketing","category":"spreadsheets","track":"data","technique":"context","title":"Count campaign days, including ones still running","free":false,"task":"You want column D of the Campaigns sheet to show how many days each campaign has run, counting both the start and end dates, and campaigns with a blank end date are still live and should count through today. Ask for one formula for D2 in one code block, then exactly 2 numbered lines labeled Counts: (in plain words) and Check: (the Fall Sale row's answer). Under 45 words outside the code.","materialLabel":"Your Campaigns sheet (attached to your prompt automatically)","material":"Sheet: Campaigns (Google Sheets)\n\nA Campaign | B Start | C End | D Days running\nFall Sale | 2026-10-01 | 2026-10-31 |\nBack to School | 2026-08-10 | 2026-09-05 |\nHoliday Gift Guide | 2026-11-01 | |\nLoyalty Push | 2026-09-15 | 2026-09-15 |\n\nNotes:\n- Blank End means the campaign is still live\n- Loyalty Push was a one-day email blast\n- My first try, =C2-B2, said Fall Sale ran 30 days and Loyalty Push ran 0 days\n- Spend per day = budget / days, so the days have to be right","rules":[{"type":"codeBlocks","count":1},{"type":"numberedItems","count":2},{"type":"maxProseWords","max":45}],"mistakes":[{"title":"Not saying both days count","why":"The AI subtracts the dates, so a one-day campaign shows 0, like your first try.","fix":"Add: \"Count both the start and end dates.\"","checks":["r0"]},{"title":"Forgetting live campaigns","why":"The AI's formula shows a negative number for blank end dates.","fix":"Add: \"Blank end date means still live; count through today.\"","checks":["r1"]},{"title":"No check row","why":"Without a known answer, you can't tell if it's right.","fix":"Add: \"Check: the Fall Sale row's answer.\"","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":"Counts both days","patterns":["both (the )?(start and end|days)","\\+\\s*1","inclusive"]},{"label":"Handles live campaigns","patterns":["blank","today","still (live|running)"]},{"label":"Asks for a check row","patterns":["check","fall sale"]},{"label":"Asks for one formula","patterns":["one formula","one code block","single formula","no alternatives"]}],"hint":"Date math has two edge cases here: whether both days count and what a blank end date means. Say both.","rubricLabels":["The formula adds 1 so both the start and end dates count (end minus start plus 1), so Loyalty Push shows 1, not 0","The formula uses TODAY() as the end when C2 is blank (for example =IF(C2=\"\",TODAY(),C2)-B2+1)","After the code there are 2 numbered lines labeled Counts: (plain words, no function names) and Check: (Fall Sale shows 31)"]}