Library › Data AI › Nonprofit staff
Pull donor names onto the donations tab from another tab
- For Nonprofit staff
- You practice Giving the right context
- Time about 5 minutes
About this exercise
You want donor names in column D of the Donations tab, pulled by Donor ID from the Donors tab in Google Sheets, where the ID sits in column B to the right of the name. New walk-in donors aren't on the Donors tab yet, so the cell must say Not found instead of an error. Ask for one formula for D2 in one code block, then exactly 2 numbered lines: Why not VLOOKUP: (one sentence) and Volunteers: (one sentence telling volunteers that Not found means they should add the donor to the Donors tab first). Under 45 words outside the code.
Common mistakes when you ask AI for this
- Not describing the layout. The AI assumes the ID is the first column and writes a VLOOKUP that can't work. Try: Add: "On Donors, name is column A and ID is column B."
- Forgetting missing IDs. The AI's formula shows #N/A for walk-in donors, which confuses volunteers. Try: Add: "Show Not found when the ID isn't on Donors."
- Getting a menu of options. The AI likes to offer two or three versions of the formula, so you're left to pick and test them yourself. Try: Add: "Give one formula only, in one code block, no alternatives."
- Forgetting the volunteers. The AI explains the formula to you but never says what volunteers should do when they see Not found. Try: Add: "Then 2 numbered lines: Why not VLOOKUP: and Volunteers:."
What a strong prompt includes
- Describes the column layout
- Handles missing IDs
- Asks for one formula
- Asks why VLOOKUP fails
Related exercises
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add type hints that still run on Python 3.8 (Coding AI · Software developers)
- Announce a discount-approval process change in three bullets (Sales AI · Managers and team leads)
- Announce a hybrid work policy change with clear actions (Writing AI · HR and recruiting)
- Announce a new weekend rotation in three clear rules (Productivity AI · Managers and team leads)