{"id":"code-work-fin-variance-label-favorable","audience":"finance","category":"coding","track":"coding","technique":"context","title":"Label budget variances as favorable or unfavorable","free":false,"task":"Write one Excel formula for Budget!F2 (filled down) that shows the variance of Actual (D2) against Budget (C2) as text like +4.2% F or -3.0% U. Percent = (D2 - C2) / C2 with a sign and one decimal. Revenue lines (B2 = Revenue) are favorable when actual is at or above budget; Expense lines are favorable when actual is at or below budget. A budget of 0 must show No budget. One formula in one code block, then under 25 words outside the code.","materialLabel":"Budget vs. actual export (attached to your prompt automatically)","material":"BUDGET VS ACTUAL - Northgate Supply, October (row 1 is headers)\nA Line | B Type | C Budget | D Actual | E Owner | F Variance\nProduct sales | Revenue | 240,000 | 250,080 | Kofi | ?\nService fees | Revenue | 18,000 | 17,460 | Kofi | ?\nFreight | Expense | 12,000 | 12,360 | Ama | ?\nOffice rent | Expense | 9,500 | 9,500 | Ama | ?\nSoftware | Expense | 4,000 | 3,880 | Raj | ?\nNew warehouse lease | Expense | 0 | 2,400 | Raj | ?\n\nNotes from Kofi (controller):\n- The variance column gets pasted into the board pack.\n- The board asked us to mark lines F or U so they don't have to think about signs.\n- Last month someone marked higher freight costs as favorable because the number went up.\n- The warehouse lease wasn't budgeted; it was approved in September.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not explaining favorable","why":"The AI treats every increase as good, so higher costs show as favorable.","fix":"Add: \"Revenue: at or above budget is F. Expense: at or below budget is F.\"","checks":["r1"]},{"title":"Not showing the label","why":"The AI returns 0.042 or a separate F/U column.","fix":"Add an example: \"text like +4.2% F or -3.0% U.\"","checks":["r0"]},{"title":"Forgetting unbudgeted lines","why":"Dividing by a 0 budget shows #DIV/0! in the board pack.","fix":"Add: \"Budget of 0 shows No budget.\"","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":"Explains favorable by type","patterns":["revenue","expense","favorable"]},{"label":"Shows the label","patterns":["\\+4\\.2% f","[+-]\\d\\.\\d% [fu]","sign"]},{"label":"Handles zero budgets","patterns":["no budget","zero|\\b0\\b"]},{"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":"Whether \"up\" is good depends on the line type. Tell the AI that rule, show the exact label, and say what an unbudgeted line shows.","rubricLabels":["Shows the percent as (D2-C2)/C2 with a sign and one decimal, for example TEXT(...,\"+0.0%;-0.0%\"), followed by a space and F or U","Flips the F/U test by type: Revenue is F when D2 >= C2, Expense is F when D2 <= C2, so higher freight shows U and flat rent shows F","Shows No budget when C2 is 0, checked before dividing"]}