AI tools · 2 min read

How to Get Excel and Google Sheets Formulas From AI (With Examples)

You don't need to remember formulas any more. Describe what you want in plain words and ChatGPT, Claude or Gemini will write the formula and explain it. Here is how to ask so it works first time, with real examples for sales, stock and attendance sheets.

To get a working formula from AI, tell it which program you use, which columns hold what, and the result you want in plain words. ChatGPT, Claude and Gemini will write the formula and explain how it works. Test it on a few rows you can check by hand, and if it errors, paste the error back. You'll rarely need to search for a formula again.

How to ask so it works first time

Include these four things:

  1. The program: Excel or Google Sheets
  2. The layout: which column holds what, and which row the data starts on
  3. The result: what you want to calculate, in plain words
  4. Where it goes: which cell the answer goes in

I use Google Sheets. Column A has dates, column B has product names, column C has quantity sold, column D has price. Data starts in row 2. In cell G2, I want the total sales value for the product name typed in F2.

Real examples

Total sales for one product

"Add up quantity times price, only for rows where the product matches F2."

Stock alerts

"Column B is current stock, column C is the minimum level. In column D, show 'Reorder' if stock is below the minimum, otherwise leave it blank."

Attendance

"Each row is a staff member, columns B to AF are days of the month with P or A. In AG, count the number of P's."

Days overdue

"Column C has the invoice due date. In column D, show how many days overdue it is, or 'Paid' if column E says Paid."

Cleaning messy data

"Column A has phone numbers in different formats, some with +91, some with spaces. Give me a formula for column B that shows just the last 10 digits."

Ask it to explain

Don't just paste formulas you don't understand. Ask:

Explain this formula in simple words, one part at a time.

Understanding the formula means you can fix it later, and you'll learn the common functions as you go.

When it shows an error

Copy the exact error (#VALUE!, #N/A, #REF!) and the formula into the chat:

This formula gives #N/A in some rows: [formula]. My product names sometimes have extra spaces. Fix it.

Common causes AI can spot fast: extra spaces, numbers stored as text, wrong date formats, and ranges that don't line up.

Keep your data safe

You usually don't need to upload your real spreadsheet. Describe the columns and paste three or four sample rows with fake values. Never paste customer details, salaries or bank information into an AI tool unless your AI policy allows it and you're on a business plan with the right data controls.

Beyond formulas

Once formulas are easy, AI can also help you:

  • Plan a better layout for a messy sheet
  • Build a simple dashboard summary
  • Write a short report from the numbers
  • Automate repetitive copying between sheets

These are the kinds of everyday tasks covered in corporate AI training, where each person practises on their own real spreadsheets and documents.

Questions people ask

Can ChatGPT write Excel formulas?

Yes. ChatGPT, Claude and Gemini can all write Excel and Google Sheets formulas from a plain description. Tell it your columns and what you want, and test the formula on a few rows.

Should I upload my spreadsheet to AI?

Only if it doesn't contain private customer or financial data, and your company policy allows it. Usually you only need to describe the column headings and paste a few sample rows with fake values.

What if the formula shows an error?

Copy the exact error message and the formula back into the chat, and tell it which program and version you use. It can usually fix it in one try.

Do formulas from AI work in both Excel and Google Sheets?

Most do, but some functions differ. Always say which one you use so it gives a formula that works there.