{"id":"code-work-sb-sales-tax-wholesale","audience":"small-business","category":"coding","track":"coding","technique":"context","title":"Write a sales tax formula that skips wholesale orders","free":false,"task":"Write the tax formula for Orders!F2 (filled down). The tax rate lives in cell $J$1, so don't type 8.25% into the formula. Charge tax only when column D is Y and the customer type in column E is Retail, because wholesale buyers have resale certificates; everything else gets 0. Round the tax to cents with ROUND. One formula in one code block, then under 20 words outside the code.","materialLabel":"Orders sheet preview (attached to your prompt automatically)","material":"ORDERS sheet - Copper Kettle Candle Co. (row 1 is headers)\nA Item | B Qty | C Unit price | D Taxable | E Customer type | F Tax | G Total\nLavender 8oz | 3 | $18.00 | Y | Retail | ? | ?\nGift card $25 | 1 | $25.00 | N | Retail | ? | ?\nCedar 16oz | 24 | $14.50 | Y | Wholesale | ? | ?\nWick trimmer | 2 | $9.99 | Y | Retail | ? | ?\nSampler box | 10 | $32.00 | Y | Wholesale | ? | ?\n\nNotes from Bea:\n- The county raised our rate to 8.25% on Oct 1 (it was 8%).\n- Shipping is billed separately in the Shipping tab.\n- Wholesale orders are usually 10 or more of an item.\n- The Total column is just price times quantity plus tax.\n- Gift cards are never taxed.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":20}],"mistakes":[{"title":"Not saying where the rate lives","why":"The AI types 8.25% into the formula, so the next rate change means editing every row.","fix":"Add: \"Use the rate in $J$1.\"","checks":["r0"]},{"title":"Forgetting the wholesale rule","why":"The AI only checks the Taxable column, so wholesale orders get taxed.","fix":"Add: \"Tax only if D is Y and E is Retail; otherwise 0.\"","checks":["r1"]},{"title":"Leaving rounding to chance","why":"The AI skips rounding or uses formatting, so totals drift by pennies.","fix":"Add: \"Round the tax to cents with ROUND(...,2).\"","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 12 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Points at the rate cell","patterns":["j1","rate (is )?in","cell"]},{"label":"Explains the wholesale rule","patterns":["wholesale","retail","resale"]},{"label":"Asks for rounding","patterns":["round","cents","2 decimals"]},{"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":"The sheet doesn't say wholesale buyers are exempt or where the rate is kept. Tell the AI both, and how to round.","rubricLabels":["Multiplies B2*C2 by the rate in $J$1 (locked), with no typed-in rate like 8.25% or 0.0825","Charges tax only when D2 is \"Y\" and E2 is \"Retail\" (for example IF(AND(D2=\"Y\",E2=\"Retail\"),...)), and returns 0 otherwise","Rounds the tax to 2 decimals with ROUND(...,2), not ROUNDUP, ROUNDDOWN or cell formatting"]}