Library › Data AI › Office and admin
Write a formula that flips Last, First names
- For Office and admin
- You practice Setting limits and rules
- Time about 5 minutes
- Level Beginner
About this exercise
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.
Common mistakes when you ask AI for this
- Using brand-new functions. The AI reaches for TEXTAFTER or TEXTSPLIT, which Excel 2016 lacks. Try: Add: "Excel 2016: use FIND, MID and LEFT only."
- Double spaces. The result keeps or loses spaces after the comma. Try: Add: "Wrap the after-comma text in TRIM."
- Errors on one-word names. A cell with no comma gives #VALUE!. Try: Add: "If there is no comma, return the original text (IFERROR)."
- Leaving the format to chance. The AI picks its own length and layout unless told the exact shape. Try: Add: "Put the code in exactly 1 code block. Keep the writing outside the code under 10 words."
What a strong prompt includes
- Says the Excel version
- Names the functions
- Handles missing spaces
- Handles one-word names
- Limits to one formula
Related exercises
- Accept the buyer's counteroffer on three stated conditions (Sales AI · Sales and customer success)
- Accrue goods received but not invoiced at PO price (Finance AI · Accountants)
- Acknowledge a cancellation request without a save attempt (Customer Support & Success AI · Customer success managers)
- Acknowledge an accessibility bug without a promised date (Customer Support & Success AI · Customer support teams)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)