Library › Data AI › Finance and accounting

Total a department's card spending by category

Practice: Catching mistakes and made-up facts. About 5 minutes.

About this exercise

Your department head wants October card spending by category. Write exactly 3 numbered lines, one per category, sorted by total from highest to lowest, each in the form "Category: $total (a + b + ...)" so the addition is visible. Count the refund as a negative, skip the declined charge, keep it under 70 words, and use plain text. Write a prompt that gets you exactly that.

Common mistakes when you ask AI for this

  • No fixed shape. The AI builds a table with every transaction and a summary. Try: Be exact: "Exactly 3 numbered lines: Category: $total (a + b)."
  • Trusting the AI to count words. AI is bad at counting. Ask for "under 70 words" and it often lands well over. Try: Cap each part instead: "each line under 15 words."
  • Counting what didn't post. The AI adds the declined charge or treats the refund as spending. Try: Add: "Skip the declined charge. Subtract the refund."
  • Hiding the addition. A bare total can't be checked. Try: Add: "Show the addition in parentheses on each line."
  • Keeping table order. The AI lists categories in the order they first appear. Try: Add: "Sort from highest total to lowest."

What a strong prompt includes

  • Handles the refund
  • Skips the declined charge
  • Shows the addition
  • Sorts by total
  • Sets a word limit

Practice this now ↑

Related exercises