Working Professionals

How to get Excel formulas from ChatGPT: plain-word prompts and worked examples

You can get Excel and Google Sheets formulas from ChatGPT or Google Gemini by describing your sheet in plain words: the sheet names, what each column holds, and the result you want in which cell. Use column headers and dummy rows only, never real salary or customer data, and test every formula on a few rows before trusting it.

You do not need to know formula names to start. You need to describe your sheet clearly, the way you would explain it to a colleague standing behind your chair. The examples below use invented sheets and columns. Adapt the descriptions to your own layout, not your own data.

How do you ask ChatGPT for an Excel formula?

1. Name the tool and version: Excel on a laptop, Excel online, or Google Sheets. Some functions differ between them.

2. Describe the layout: the sheet name, the column letters, what each column holds, and whether row 1 has headers.

3. Say exactly what you want and where the answer goes: "In cell G2, the total for the department written in F2."

4. Mention the awkward cases: blank cells, text that looks like numbers, or dates typed in different formats.

5. Ask for a plain explanation along with the formula, so you understand what you are pasting.

What do good formula requests look like?

1. Totals by department with SUMIFS. "In Excel, a sheet called Expenses has Date in column A, Department in column B and Amount in column C, with headers in row 1. In cell G2 of another sheet, I want the total amount for the department typed in F2." A typical answer is =SUMIFS(Expenses!C:C, Expenses!B:B, F2). You can then ask it to add a date range using two more conditions.

2. Looking up between two sheets. "Sheet Orders has Product Code in column B. Sheet Products has Product Code in column A and Product Name in column B. In column C of Orders, show the product name, or 'Not found' if the code is missing." Newer Excel and Google Sheets support =XLOOKUP(B2, Products!A:A, Products!B:B, "Not found"). On older Excel, ask for the VLOOKUP version, such as =IFERROR(VLOOKUP(B2, Products!A:B, 2, FALSE), "Not found").

3. Finding duplicates. "Column A has invoice numbers from row 2 to row 500. In column B, show 'Duplicate' if the invoice number appears more than once, otherwise leave it blank." Expect something like =IF(COUNTIF($A$2:$A$500, A2)>1, "Duplicate", ""). Ask how to highlight duplicates with conditional formatting too.

4. Date differences. "Column B has the date a request was raised and column C the date it was closed. In column D, I want the number of days between them, and in column E the number of working days, excluding Saturdays and Sundays." Expect =C2-B2 and =NETWORKDAYS(B2, C2), and ask whether the count should include the first day.

5. IF with conditions. "Column D has an invoice amount and column E has a status of Paid or Pending. In column F, show 'Follow up' if the amount is above 10,000 and the status is Pending, otherwise 'OK'." Expect =IF(AND(D2>10000, E2="Pending"), "Follow up", "OK").

How do you get an inherited formula explained?

Every office has a sheet built by someone who left years ago. Copy only the formula, not the data around it, and ask: "Explain this Excel formula step by step in plain English. Tell me what each part does, what happens if a cell is blank, and whether there is a simpler way to write it." Then paste something like =IFERROR(VLOOKUP($B2, Rates!$A:$D, MATCH(C$1, Rates!$1:$1, 0), FALSE), 0).

Ask follow-up questions until you could explain it to someone else. If the AI suggests a simpler version, test it side by side with the old formula before replacing anything.

How do you test a formula before trusting it?

1. Work on a copy of the file, never the original.

2. Create eight to ten dummy rows where you already know the right answer by working it out by hand.

3. Include the awkward cases on purpose: a blank cell, a duplicate, a name with an extra space, and a number stored as text.

4. Compare the formula's results with your hand-worked answers. If even one differs, tell the AI which row failed and what you expected.

5. Only then apply it to the full sheet, and spot-check a few real rows by hand.

ChatGPT can give a formula that looks right but uses the wrong range, ignores blanks or suits a different version of Excel. The test rows are what turn a suggestion into something you can rely on. If your sheet is full of such problems, our guide on cleaning messy data in Excel and Google Sheets shows how to fix them first.

What should you never paste from a spreadsheet?

Do not paste or upload real salary sheets, customer lists, vendor bank details, GST data or anything your office treats as confidential. The AI does not need real rows to write a formula. Give it the column headers and two or three invented rows instead, such as Department: Admin, Amount: 1,200. For the wider list of what stays out of AI at work, see our guide to using ChatGPT for office work. Finance teams can also look at AI for CAs, accountants and finance teams, which covers lookups and reconciliation helpers with client data kept out.

Training your whole team?

The free recorded course AI at Work for office professionals has a full session on Excel: formulas in plain words, inherited sheets explained, data cleanup, and practising only on dummy data. For a course built entirely around spreadsheets, Excel and Google Sheets with AI covers SUMIFS, lookups, cleanup, dates, pivot tables and charts, testing every formula on dummy rows.

If a whole department works in spreadsheets every day, our office AI training builds the exercises around your own sheet layouts, with dummy data, at your office or live online. Teams in Jaipur can book in-person training in Jaipur.

Common questions

Does ChatGPT work for Google Sheets formulas too?

Yes. Say Google Sheets in your prompt, because a few functions and separators differ from Excel. Most everyday formulas, such as SUMIFS, COUNTIF, IF, VLOOKUP and XLOOKUP, work in both. If a formula shows an error, paste the exact error message back into the chat, say which tool you are using, and ask for a corrected version you can test again.

Should I use XLOOKUP or VLOOKUP?

If your Excel or Google Sheets supports XLOOKUP, it is usually easier, because it looks in any direction and handles missing values in one formula. Older Excel versions only have VLOOKUP, so ask the AI for that version if XLOOKUP shows an error. Whichever you use, test it on dummy rows where you already know the right answer.

Can I upload my Excel file to ChatGPT?

Only if the file contains nothing confidential and your company allows it. Real salary sheets, customer lists and financial data should never be uploaded to a public AI tool. For formula help you rarely need the file at all: describe the columns, add two or three invented rows, and the AI can write the formula just as well.

What if the formula ChatGPT gives me is wrong?

It happens, so always test first. Tell the AI exactly which test row gave the wrong result, what it showed, and what you expected. Mention any blanks, spaces or text-stored numbers in that row. A second or third attempt usually fixes it. If it still fails, ask the AI to break the formula into smaller steps across helper columns.