GPTExcel
Guides

Formula Generation

Generate, explain and optimize formulas for Excel, Google Sheets, LibreOffice Calc and Airtable from plain English.

Describe the calculation you need and GPTExcel writes the formula. Paste a formula you don't understand and it explains it step by step. There are two places to do this:

  • The Formulas tool, for a formula on its own. Quickest when you know what you want.
  • Chat, when the formula depends on a file you've uploaded. GPTExcel can see your real column names and sheet names.

The Formulas tool

The GPTExcel Formulas tool generating an XLOOKUP formula from a description of a price lookup

Generate mode: a plain-English description on the left, the formula and how it works on the right.

Pick a mode

  • Generate: describe the result, get the formula.
  • Explain: paste a formula, get a plain-English walkthrough of each part.
  • Optimize: paste a slow or messy formula, get a cleaner, faster version and what changed.

Pick your platform

Microsoft Excel, Google Sheets, LibreOffice Calc or Airtable. Functions and syntax differ between them, so the formula is written for the one you choose.

Describe it, or paste it

Then click the button under the box. Short on ideas? Click one of the examples to fill it in.

The GPTExcel Formulas tool explaining an INDEX and MATCH formula step by step

Explain mode breaks an INDEX/MATCH formula into its parts.

Formula settings

Click the settings icon next to Input to save your defaults to your account:

SettingWhat it changes
PlatformExcel, Google Sheets, LibreOffice Calc or Airtable
Formula languageFunction names in your spreadsheet's language, for example SUMME instead of SUM in German Excel
Argument separatorComma (,) or semicolon (;), matching your regional settings
VersionWhich Excel version to target, so you only get functions you have
Response languageThe language of the explanation

Example prompts

Lookups

Find the price in Sheet2 column C for the product ID in A2
Excel formula
=XLOOKUP(A2, Sheet2!A:A, Sheet2!C:C, "Not found")

Conditional totals

Average of column D for rows where B is "West" and C is above 100
Excel formula
=AVERAGEIFS(D:D, B:B, "West", C:C, ">100")

Text

Extract the domain from the email address in A2
Excel formula
=MID(A2, FIND("@", A2) + 1, LEN(A2))

Dates

Flag rows where the due date in C2 is more than 30 days ago and status in D2 isn't "Paid"
Excel formula
=IF(AND(TODAY() - C2 > 30, D2 <> "Paid"), "Overdue", "")

Formulas in Chat

Formulas in Chat: on your real columns, a lookup between sheets, a #N/A fixed, and the formulas written into your file.

In Chat, GPTExcel can write formulas into a workbook for you, not just show them. After it creates or edits formulas, the Formula validator recalculates the workbook and checks every formula for errors such as #REF! or #DIV/0! before you download it.

Ask Chat about a function that's newer than the AI, like Excel's FLATTEN, and it checks Microsoft's or Google's documentation first, warns you if the function is Beta-only, and links the source. See New and preview functions.

Tip

Name the cells, columns and sheets involved when you know them ("price in Products!C:C"). A formula built on your real layout needs no adjusting.

Formula tutorials

Explain a formula you inherited

Paste a formula into Chat and ask what it does. Attach the workbook too, and GPTExcel walks through it on a real row, checks it across every row for problems an IFERROR might be hiding, and rewrites it with LET so it's easier to read.

A nested IF, VLOOKUP and IFERROR explained, walked through on a real row, checked on every row and rewritten with LET.

Speed up a slow workbook

Attach a workbook that's slow to recalculate and ask why. GPTExcel counts what each formula reads, rewrites the slow patterns (SUMPRODUCT over whole columns, volatile OFFSET, repeated VLOOKUPs), and compares every value with the original before you download it. The full worked example is in How to speed up a slow Excel workbook.

A nested IF made simple, then a slow workbook diagnosed and rewritten: all 20,060 values match the original.

Which lookup to use

XLOOKUP, VLOOKUP and INDEX/MATCH side by side on a real workbook: the same price three ways, a lookup to the left, and what an inserted column does to each. Written up in XLOOKUP vs VLOOKUP vs INDEX/MATCH.

The three lookups compared, then used on a real price list: a lookup to the left and the inserted-column trap.

More generators

The same generate, explain and optimize modes are available for scripts (VBA, Google Apps Script, LibreOffice Basic, Airtable scripts and Python), SQL and regex.