Using AI to Write Excel Formulas: A Safe 5-Step Checklist

⏱ 2 min readUpdated 27 September 2026

Asking an AI assistant for an Excel formula saves real time. Asking it badly produces formulas that look right and quietly return wrong numbers. Use this checklist.

In this article
  1. 1. Say your Excel version
  2. 2. Describe the layout exactly
  3. 3. Paste 5 sample rows (with fake data)
  4. 4. Ask for an explanation
  5. 5. Test on rows you know
  6. Example prompt

1. Say your Excel version

XLOOKUP, FILTER, LET and LAMBDA exist only in Excel 365/2021+. If colleagues use Excel 2016, say so or you will get formulas that show #NAME? on their machines.

2. Describe the layout exactly

Sheet names, columns, header row, where the answer goes, and what should happen with blanks and missing matches.

3. Paste 5 sample rows (with fake data)

A tiny table removes most misunderstandings. Replace names, phone numbers and amounts with dummy values first.

4. Ask for an explanation

Explain each part of the formula in one line. If the explanation does not match what you asked, the formula is wrong too.

5. Test on rows you know

Check a match, a non-match, a blank, a duplicate and a boundary value (exactly the cut-off date or amount). Only then fill down.

Example prompt

“`text
Excel 365. Sheet “Sales”: A=Invoice, B=Date, C=Region, D=Amount (rows 2-5000).
In G2 I type a region, in H2 a month (e.g. 01-Mar-2025).
Write one formula for I2 that sums Amount for that region and month.
Return 0 if nothing matches. Explain each part in one line.
“`

⚠️ Never paste confidential data β€” salaries, customer lists, unpublished financials β€” into a public AI tool unless your company has approved it.

Want to understand the formulas you get? Try them in the free Formula Lab.