Find Duplicate Expenses with AI: Free Gemini Prompt (Tested)

Find duplicate expenses before year end with a free Gemini prompt. Our test caught all 4 planted problems, a bill paid twice, and adds a Sheets formula.

Updated

10 min read

Workflow Owl title card: Find duplicate expenses with AI, free Gemini prompt and Google Sheets formula

Some links in this guide are affiliate links. If you buy through them we may earn a commission at no extra cost to you. We only recommend tools we have tested. How we make money.

In this guide

You can find duplicate expenses in your books before year end by pasting your expense list into a free AI chatbot like Gemini with a short set of rules: same amount, dates within a few days, vendor names that may be spelled differently, and invoice numbers that prove two charges are different. In our test on a 17-row bakery ledger, Gemini found all four problems we planted, including a plumbing bill that was paid twice, and correctly left five look-alike rows alone.

Below is the exact prompt, the full result, the one place Gemini was inconsistent, and a Google Sheets formula (written by Gemini, checked by us row by row) that flags possible duplicates in any ledger.

Tested on November 26, 2026 in the free Gemini web app (gemini.google.com, “Auto” model), signed in with a standard Google account. Maple Street Bakery and every row in the ledger are made up for this test. This is a bookkeeping workflow, not tax or accounting advice; your accountant has the final word on your books.

Why duplicate expenses happen (and why they matter at year end)

Most small businesses end up with duplicates for one of three reasons:

  1. Two ways in for one purchase. Your bookkeeping app imports the card charge from the bank feed, and someone also types in the paper receipt. Now the same $87.43 trip to the hardware store is in the books twice.
  2. Re-imported bank feeds. A bank connection breaks, you reconnect it, and a week of transactions comes in again as exact copies.
  3. A bill paid twice. One person mails a check, another pays the same invoice by card the next day. This is not just a bookkeeping error; real money left the account and you need it back from the vendor.

Duplicates inflate your expenses, which makes profit look smaller than it is and can throw off the numbers your accountant uses at tax time. The IRS expects your records to support every expense you report (see its recordkeeping page for small businesses), and a cleaned-up ledger is much easier to back up than one where half the receipts are entered twice.

The hard part is that duplicates rarely look identical. The bank says “Home Depot” two days after the receipt says “THE HOME DEPOT #4521”. That is exactly the kind of fuzzy matching AI is good at, as long as you tell it what does and does not count as a duplicate.

What you need before you start

  • An export of your expenses for the period you want to check (a month, a quarter or the year so far) as CSV or a copy of the rows from Google Sheets or Excel. Most bookkeeping apps have an export button on the expenses or transactions screen.
  • These columns, if you have them: date, vendor, description or memo, amount, how it was paid (card, check, ACH) and where the row came from (bank feed or manual entry). The last two columns make the AI’s job far easier.
  • A row ID in the first column (1, 2, 3…) so you can find each row the AI mentions.
  • A free Gemini, ChatGPT or Claude account. We used Gemini.

Before you paste anything, remove columns you don’t need, such as full card numbers, bank account numbers or customer names. The last four digits of a card are enough.

Step by step: find duplicate expenses with Gemini

Step 1: Add a row ID and paste your ledger below the prompt

Open gemini.google.com and start a new chat. Copy the prompt below, replace nothing in the rules unless your business works differently, and paste your rows (with the header row) at the bottom.

You are helping a small business clean up its bookkeeping before year end. Below is our expense ledger (CSV). Bank-feed rows were imported automatically; manual rows were typed in from paper receipts, so some purchases may be in the ledger twice.

Find likely duplicate entries. Rules:
- Vendor names can be spelled differently for the same vendor (e.g. a store number added).
- A bank date can be 1-3 days after the receipt date for the same purchase.
- Different invoice or order numbers mean different purchases, even with the same amount.
- Recurring monthly charges and refunds/credits are NOT duplicates.
- Also flag any bill that looks like it was PAID twice (two payments going out for one invoice).
- Do not delete anything and do not guess missing facts.

Give me: (1) a table of duplicate groups with the row IDs, why, confidence (high/medium/low) and which row to keep; (2) a short list of rows that look similar but are NOT duplicates, and why; (3) the total amount the expenses are overstated if all high-confidence duplicate entries are removed. Show the math.

[PASTE YOUR ROWS HERE, WITH THE HEADER ROW]

The rules are the important part. Without them, an AI will happily call your two monthly software charges “duplicates” or miss the hardware store pair because the names don’t match.

Step 2: Read the duplicate table

Here is the 17-row ledger we used. We planted four problems and five traps that look like duplicates but are not:

Rows What we planted Real duplicate?
1 and 2 Sysco order #88412 from the bank feed, and the same invoice typed in from a receipt as “SYSCO FOODS” Yes
4 and 5 “THE HOME DEPOT #4521” receipt on Oct 9, “Home Depot” bank charge on Oct 11, same $87.43 Yes
7 and 8 Two identical Costco bank-feed rows on Oct 18 (a re-imported feed) Yes
16 and 17 Joe’s Plumbing invoice 1043 paid by check on Nov 20 and by card on Nov 21 Yes, paid twice
1 and 13 Sysco, same $412.60, but a different order number a month later No
3 and 14 Square POS subscription, $60 each month No (recurring)
6 and 15 Monthly electric bills No (recurring)
10 and 11 Uline pastry boxes and the return credit No (refund)
7 and 12 Costco, same $156.90, ten days later on a different card No (separate purchase)

Gemini’s answer came back in about ten seconds. It flagged exactly the four real groups, all as high confidence, and listed all five traps under “not duplicates” with the right reason for each: different order numbers, recurring monthly charges, a refund, and a Costco purchase that was “10 days later… outside the 1-3 day window” and on a different card.

It also handled the plumbing bill well. Instead of telling us to delete a row, it said both payments were real money going out and that we should check with the vendor and the bank before changing anything. That is the correct call: deleting one row would hide a $240 overpayment you should be asking for back.

Step 3: Check the “overstated” total yourself

Gemini removed one row from each high-confidence ledger duplicate and showed its math: $412.60 + $87.43 + $156.90 = $656.93 of expenses counted twice. We added it up separately and got the same figure. It kept the $240 plumbing payment out of that total and listed it as a separate issue to resolve with the vendor, which is right, because it is a cash problem, not a data-entry one.

Always re-add the AI’s total yourself or with a quick SUM in a spreadsheet. In this test it was correct, but a total is exactly the kind of thing you should never paste into your books without checking.

Step 4: Fix the “keep” rule (the one thing Gemini got inconsistent)

The weak spot was the “which row to keep” column. For the Sysco pair, Gemini said to keep the bank-feed row. For the Home Depot pair, it said to keep the receipt row because it “keeps specific Shelving brackets description”. Each choice is defensible, but using two rules in one cleanup is how ledgers end up out of step with the bank statement.

One follow-up fixed it:

Your 'keep' column uses two different rules. Use one rule for every group: keep the bank-feed row and mark the receipt row as 'attached receipt'. Redo the table.

The new table kept the bank-feed row in every group, marked the receipt rows as attached receipts, and still told us to keep both plumbing payments until the vendor confirms. Keeping the bank-feed row is the simplest rule for most owners, because it is the row that matches your bank statement when you reconcile. Attach the receipt photo to that row in your bookkeeping app instead of keeping it as a separate expense.

Step 5: Add a formula that flags duplicates automatically

For next year, you don’t need to ask the AI every month. We asked Gemini for a Google Sheets formula that writes “CHECK” next to any row that has the same amount as another row within three days. With dates in column B and amounts in column E (rows 2 to 18), it gave us:

=IF(COUNTIFS($E$2:$E$18, E2, $B$2:$B$18, ">="&(B2-3), $B$2:$B$18, "<="&(B2+3)) > 1, "CHECK", "")

Paste it in H2 and fill down. COUNTIFS counts rows that match several conditions at once; here that is “same amount” and “date between three days before and three days after”. Every row matches itself, so the formula only flags a row when the count is more than 1.

We checked the formula’s logic against all 17 test rows. It flags rows 1, 2, 4, 5, 7, 8, 16 and 17, which are exactly the four real problem pairs, and leaves every trap blank. Two limits to know:

  • It only works if column B holds real dates. If your export brought dates in as text, convert them first (Format, Number, Date).
  • It matches on amount and date only. A row it flags still needs a human look, and a duplicate that was typed in with a typo in the amount ($87.34 instead of $87.43) will slip past. That is where the AI review in Step 2 helps.

Change the ranges ($E$2:$E$18 and $B$2:$B$18) to cover your whole sheet, for example $E$2:$E$2000.

Gemini vs a formula vs your bookkeeping app

Method Catches spelling differences Catches “paid twice” Explains why Best for
AI chat with rules (our test) Yes, in our test Yes, in our test Yes A one-off year-end cleanup
COUNTIFS formula Not needed (ignores vendor name) Flags it, but can’t tell you why No Ongoing monthly checks in Google Sheets
Your bookkeeping app’s own duplicate checks Depends on the app Depends on the app Partly Stopping duplicates as they are imported

Many bookkeeping apps warn you when an imported transaction looks like one you already entered. Check your app’s help pages for how it matches transactions; we did not test any bookkeeping app for this article.

Pros and cons of using AI to find duplicate expenses

Pros

  • Handles messy vendor names and posting-date gaps that simple formulas miss.
  • Explains each match, so you can make the call quickly.
  • Separates “entered twice” from “paid twice”, which need different fixes.
  • Free for a ledger of a few hundred rows.

Cons

  • Can be inconsistent in its recommendations (our “keep” column) unless you give it one rule.
  • Very long ledgers may need to be checked a month at a time.
  • You are pasting financial data into a chat; strip account numbers and names first and check your account’s privacy settings.
  • It cannot see your bank statement, so it cannot confirm a payment actually cleared.

Cost and who it’s for

Cost: $0. Our test used the free Gemini web app, and the formula works in any free Google Sheets file.

Who it’s for: owners and bookkeepers of small businesses who enter receipts by hand alongside a bank feed, anyone who reconnected a bank feed this year, and anyone who wants a cleaner ledger before handing it to their accountant in January. If your books are already reconciled every month by a professional, this is a quick second check, not a replacement.

FAQ

How many rows can I paste into Gemini at once?

Our test used 17 rows. For a full year, paste one month or one quarter at a time so the AI can compare rows properly, and keep the row IDs so you can match its answer back to your sheet.

Should I delete duplicate expenses or mark them?

Follow your bookkeeping app’s normal process, and ask your accountant if you are unsure. A common approach is to keep the bank-feed transaction, attach the receipt to it, and remove or exclude the manual copy so it is not counted twice.

What do I do about a bill that was paid twice?

Contact the vendor with both payment dates and ask for a refund or a credit on your next invoice. Keep both payments in your books until the money comes back, so your ledger matches your bank.

Is it safe to paste my expenses into an AI chatbot?

Remove full card and bank account numbers, customer names and anything personal first. Vendor names, dates and amounts are usually enough for this job. Check your AI account’s data settings and your company’s own policy.

Conclusion

Finding duplicate expenses is a perfect AI job: tedious, rule-based and full of near-misses. In our test, Gemini found every planted duplicate, spotted the bill that was paid twice, and left all five look-alike rows alone. Its only slip was using two different “keep” rules, which one follow-up fixed. Add the COUNTIFS formula to your sheet and the same check runs on its own next year.

If you are still entering receipts by hand, start with our guide to turning receipts into a spreadsheet with AI, then use your cleaned-up numbers in a year-end business review with AI.

Zaib Avatar

Written & tested by

Keep learning