{"id":"data2-formula-split-name-last-first","audience":"office","category":"spreadsheets","track":"data","technique":"constraints","level":"beginner","title":"Write a formula that flips Last, First names","free":false,"task":"Your volunteer list has names typed as 'Last, First' and you want 'First Last' in column B. Ask for one Excel formula for B2 in a single code block, then one line starting 'Example:' showing one row, under 10 words outside the code. Print the family name in capitals, like 'Ngozi OKAFOR', because the mailing labels need that. It must work if there is no space after the comma, and leave a name with no comma untouched.","materialLabel":"Your sheet (attached to your prompt automatically)","material":"Sheet: Volunteers (Excel)\n\nA Name as typed | B First Last\nOkafor, Ngozi |\nReyes,Marco |\nLindqvist, Astrid |\nBartholomew |\nTran, Linh-Mai |\n\nNotes:\n- About 300 names, rows 2-301.\n- Some people typed the comma with no space after it (Reyes,Marco).\n- A few cells hold only one word, with no comma at all (Bartholomew). Leave those exactly as they are.\n- Do not use Power Query or Flash Fill; the sheet is shared with people on Excel 2016.\n- Extra spaces: names have no leading spaces, but may have a space after the comma.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":10}],"mistakes":[{"title":"Using brand-new functions","why":"The AI reaches for TEXTAFTER or TEXTSPLIT, which Excel 2016 lacks.","fix":"Add: \"Excel 2016: use FIND, MID and LEFT only.\"","checks":["r0"]},{"title":"Double spaces","why":"The result keeps or loses spaces after the comma.","fix":"Add: \"Wrap the after-comma text in TRIM.\"","checks":["r1"]},{"title":"Errors on one-word names","why":"A cell with no comma gives #VALUE!.","fix":"Add: \"If there is no comma, return the original text (IFERROR).\"","checks":["r2"]},{"title":"Leaving the format to chance","why":"The AI picks its own length and layout unless told the exact shape.","fix":"Add: \"Put the code in exactly 1 code block. Keep the writing outside the code under 10 words.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Says the Excel version","patterns":["2016","no textsplit","no textafter"]},{"label":"Names the functions","patterns":["find","mid","left","search"]},{"label":"Handles missing spaces","patterns":["trim","no space","spaces?"]},{"label":"Handles one-word names","patterns":["no comma","unchanged","iferror"]},{"label":"Limits to one formula","patterns":["one formula","single","code block"]}],"hint":"The AI loves the newest functions. Say the Excel version and list the edge cases up front.","mission":"Fix 'Last, First' names into 'First Last' in one formula.","musts":["One formula only","Handles no-space comma","Leaves one-word names alone"],"rubricLabels":["The formula finds the comma (FIND or SEARCH on \",\") and builds First then Last by joining the text after the comma and the text before it, with the family name wrapped in UPPER (Okafor, Ngozi gives Ngozi OKAFOR)","The formula uses TRIM (or an equivalent) so Reyes,Marco and Okafor, Ngozi both give a single space between first and last name","The formula returns A2 unchanged when there is no comma (for example with IFERROR or IF(ISNUMBER(FIND(...)))), and uses no Power Query, Flash Fill, TEXTSPLIT or TEXTAFTER, and the reply has a line starting 'Example:'"]}