{"id":"code-work-teach-attendance-percent","audience":"teachers","category":"coding","track":"coding","technique":"context","title":"Calculate attendance rates the way your school counts","free":false,"task":"Write one Google Sheets formula for W2 (filled down) that gives each student's attendance rate from the day codes in C2:V2. School policy: P and T (tardy) both count as present, H (holiday) days don't count at all, and blank days haven't happened yet. The report card import needs text like 93.8%, so wrap the result in TEXT with one decimal. One formula in one code block, then under 25 words outside the code.","materialLabel":"Attendance sheet preview (attached to your prompt automatically)","material":"ATTENDANCE - Mr. Ferraro, Homeroom 7B, November (row 1 is headers)\nA Student | B ID | C..V days (Nov 2 to Nov 27) | W Rate\n\nAmari J. | S204811 | P P T P P | P P P A P | H H P P P | P T P\nBen L. | S204812 | P A A P P | T T P P P | H H P P A | P P P\nCarla M. | S204815 | P P P P P | P P P P P | H H P P P | P P P\nDev P. | S204820 | A A A P P | P P P P A | H H A P P | P P P\n\nCodes on the sheet: P present, A absent, T tardy, H school holiday.\nThe last two columns are still blank (the month isn't over).\n\nNotes:\n- The office emails rates to families every month.\n- Students under 90% get a check-in call from the counselor.\n- Codes are typed in capitals by the attendance app.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not giving the tardy rule","why":"The AI counts only P as present, so tardy students look absent.","fix":"Add: \"P and T both count as present.\"","checks":["r0"]},{"title":"Not mentioning holidays and blanks","why":"The AI divides by every column, so holidays and future days drag rates down.","fix":"Add: \"H days and blanks don't count in the total.\"","checks":["r1"]},{"title":"Leaving the format open","why":"The AI returns 0.9375, which the import can't read.","fix":"Add: \"Return text like 93.8% using TEXT.\"","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":"Gives the tardy rule","patterns":["tardy","\\bt\\b.{0,20}present"]},{"label":"Excludes holidays and blanks","patterns":["holiday","\\bh\\b","blank"]},{"label":"Sets the output format","patterns":["text","93\\.8%","0\\.0%","percent"]},{"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 codes don't say how your school counts them. Tell the AI the tardy and holiday rules and how the result must look.","rubricLabels":["Counts both P and T as present (for example COUNTIF(C2:V2,\"P\")+COUNTIF(C2:V2,\"T\"))","Leaves H days and blanks out of the total (for example COUNTA(C2:V2)-COUNTIF(C2:V2,\"H\")), not a fixed 20 days","Wraps the rate in TEXT(..., \"0.0%\") so it shows like 93.8%"]}