{"id":"code-work-office-flip-last-first-names","audience":"office","category":"coding","track":"coding","technique":"examples","title":"Flip \"LAST, first\" names into clean First Last","free":false,"task":"Column A of the Google Sheet has visitor names typed every which way, mostly as Last, First. You need one formula for B2 (filled down) that returns First Last in proper case with no extra spaces, e.g. \"  ORTIZ,  ana \" becomes \"Ana Ortiz\". Names typed without a comma must come out proper-cased and trimmed, not as an error. One formula in one code block, at most 3 lines, then under 20 words outside the code.","materialLabel":"Visitor log, column A (attached to your prompt automatically)","material":"VISITOR LOG - front desk sign-in sheet, copied from the paper binder\nRow 1 header: A Name | B Clean name | C Host | D Time in\n\nA2:   ORTIZ,  ana \nA3: kim, jae\nA4: Mehta,Raj\nA5: dana ruiz\nA6:  BROOKS , LENA\nA7: o'neil, pat\nA8: Wu, Mei-Lin\nA9: TOM OKAFOR\n\nC column hosts: Priya Nand, Facilities, Lou Grant\nD column times: 9:05, 9:20, 10:45, 11:00\n\nNotes from reception:\n- The binder is scanned on Fridays and the sheet is re-typed by temps.\n- About one in ten visitors writes First Last with no comma.\n- Badges print from column B, so it has to look right.\n- Old visitor logs before June are in the shared drive.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":3},{"type":"maxProseWords","max":20}],"mistakes":[{"title":"Not showing the target","why":"The AI guesses at the format and may keep Last, First or ALL CAPS.","fix":"Add an example: \"'  ORTIZ,  ana ' becomes 'Ana Ortiz'.\"","checks":["r0","r1"]},{"title":"Forgetting the odd rows","why":"The AI splits on the comma and returns an error when there isn't one.","fix":"Add: \"Names with no comma: just trim and proper-case them.\"","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","maxCodeLines"]},{"title":"Letting the code sprawl","why":"The AI pads the formula with extras nobody asked for, so it grows long and harder to check.","fix":"Add: \"At most 3 lines of code.\"","checks":["maxCodeLines"]},{"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":"Shows an example","patterns":["becomes","->","=>","e\\.g\\.","for example","like \""]},{"label":"Covers names without a comma","patterns":["no comma","without (a )?comma","missing comma"]},{"label":"Asks for proper case and trimming","patterns":["proper","capitali","trim","extra spaces"]},{"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":"Show the AI one messy name and exactly what it should become, and tell it what to do with names that have no comma.","rubricLabels":["For names with a comma, returns the part after the comma first and the part before it second (\"ORTIZ,  ana\" gives \"Ana Ortiz\")","Uses TRIM and PROPER (or equivalent) so extra spaces are removed and each name is capitalized like \"Lena Brooks\"","Handles names with no comma (like \"dana ruiz\") by returning them trimmed and proper-cased, not an error, using a check such as IF with ISNUMBER(SEARCH(\",\",A2)) or IFERROR"]}