Library › People & HR AI › HR and recruiting
Work out leave balances from a ledger and show the math
- For HR and recruiting
- You practice Setting limits and rules
- Time about 5 minutes
- Level Intermediate
About this exercise
Calculate each employee's remaining PTO as of Nov 9 and return a table with the header Employee | Accrued | Used | Remaining | Over cap?. Remaining = Accrued minus Used, in days. Over cap? is Yes if Remaining is more than the 10-day carry-over cap, else No. Show numbers only in the first four columns. Sort by Remaining, largest first. Plain text, no bold. After the table, one line: Over cap: followed by the names, or None. HR reviews before any message goes out.
Common mistakes when you ask AI for this
- Double-counting Theo. The AI uses Used 10 for Theo. Try: Say: "The duplicate 5 counts once, so Theo used 5."
- Wrong cap. The AI uses the old 5 day cap. Try: Say: "The cap is 10 days; ignore the 2024 handbook."
- Sort and header. The AI keeps ledger order or changes columns. Try: Say: "Exact header, sorted by Remaining largest first."
- Trusting the AI to count words. AI is bad at counting. Ask for a total word limit and it often lands over it. Try: Cap each part instead, for example: "each line under 15 words."
- Markdown. The AI bolds words or adds headings. Try: Say: "Plain text, no bold, no headings."
What a strong prompt includes
- Exact header
- Math
- Sort
- Cap
- Last line
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)
- Acknowledge an employee's concern without promising outcomes (People & HR AI · HR and recruiting)