Skip to content

Excel Formula Generator

Pick a function, fill in the fields with your own cells, and copy a working formula. The formula and its explanation update as you type.

Updated

Function
The cell holding the code or name you are searching for.
The first column must contain the lookup values.
Counted from the left of the table.
Your formula
F2fx=VLOOKUP(E2, A2:C6, 3, FALSE)

Looks for E2 down the first column of A2:C6 and returns what is in column 3 of that row, only if it matches exactly.

Paste the formula into cell F2 or any empty cell. The coloured parts match the coloured fields. Using a different list separator? Replace the commas with semicolons.

How to use the generator

  1. Under Function, select the function you need. The table below helps you choose.
  2. Fill in the fields. Each one starts with an example value, such as A2:A20, that you replace with your own cells.
  3. Read Your formula on the right. It changes with every keystroke, and the sentence below it says what the formula does.
  4. Select Copy and paste the formula into your sheet.

The coloured parts of the formula match the coloured fields, so you can see which field produced which argument. This is a builder with fixed fields for each function. It does not read descriptions written in plain English, and it never guesses: you choose the function and the cells.

The ten functions

Function Use it when
VLOOKUP You need a value from a table, found by a code or name in the table’s first column.
XLOOKUP You want the same kind of lookup in Excel 2021 or Microsoft 365, in any direction, with a built-in fallback.
INDEX + MATCH You need a lookup that works in every Excel version and can return a column to the left.
SUMIF You want to add up numbers in rows that meet one condition.
SUMIFS You want to add up numbers in rows that meet two or more conditions.
COUNTIF You want to count the cells that meet one condition.
COUNTIFS You want to count the rows that meet two or more conditions.
IF You want one result when a test is true and another when it is false.
IFERROR A formula may return an error and you want to show something else instead.
TEXTJOIN You want to join the values of several cells into one, with a separator between them.

What each form produces

With the starting values, the generator writes these formulas:

Function Example formula
VLOOKUP =VLOOKUP(E2, A2:C6, 3, FALSE)
XLOOKUP =XLOOKUP(E2, A2:A6, C2:C6, "Not found")
INDEX + MATCH =INDEX(C2:C6, MATCH(E2, A2:A6, 0))
SUMIF =SUMIF(A2:A20, "East", C2:C20)
SUMIFS =SUMIFS(C2:C20, A2:A20, "East", B2:B20, ">100")
COUNTIF =COUNTIF(A2:A20, "Done")
COUNTIFS =COUNTIFS(A2:A20, "East", B2:B20, ">100")
IF =IF(B2>=50, "Pass", "Fail")
IFERROR =IFERROR(B2/C2, 0)
TEXTJOIN =TEXTJOIN(", ", TRUE, A2:A10)

Note the order in SUMIF and SUMIFS. SUMIF puts the column to add up last. SUMIFS puts it first. The form handles that for you.

How to fill in the fields

Cells and ranges

Type references as they appear in Excel: E2 for one cell, A2:A20 for a range. For another sheet, put the sheet name and an exclamation mark first, as in Prices!A2:C200. Use single quotes when the name has spaces: 'Price list'!A2:C200.

Text, numbers and conditions

You do not type quotation marks. The generator adds them where Excel requires them.

You type The formula gets
East "East"
100 100
E2 E2
>100 ">100"
>=B1 ">="&B1
<>Done "<>Done"

The last three rows are the part people most often get wrong by hand. In SUMIF, COUNTIF and their plural versions, a comparison must be inside quotation marks, and a cell reference must be joined on with &.

Lookups that find nothing

The three lookup forms have a field named If nothing is found, show. For XLOOKUP the text goes into the function’s own fourth argument. For VLOOKUP and INDEX with MATCH the generator wraps the formula in IFERROR. Leave the field empty to see the plain #N/A error, which is useful while you are still checking the formula.

After you paste the formula

  • Lock ranges before filling down. When you copy a formula down a column, every reference shifts by one row. Add dollar signs to ranges that should stay put, as in $A$2:$C$6. Press F4 with the cursor on the reference to add them.
  • Check the list separator. If Excel shows an error as soon as you press Enter, your regional settings may use semicolons between arguments. Replace the commas with semicolons.
  • Match the range sizes. In SUMIFS, COUNTIFS, XLOOKUP and INDEX with MATCH, the ranges must have the same number of rows. A2:A20 with C2:C19 returns an error or a wrong result.
  • Test on a row you can check by eye. Pick a value you know the answer for and confirm the formula returns it before you rely on the whole column.

Which lookup to choose

Three of the ten functions do the same job. Use XLOOKUP if everyone who opens the file has Excel 2021 or Microsoft 365. Use VLOOKUP when the file must open in older versions and the search column is the first column of the table. Use INDEX and MATCH when you need old-version support and the result sits to the left of the search column.

Limits

  • Ten functions, one at a time. To nest one inside another, build the inner formula first and paste it into the outer one. The IFERROR form accepts any formula in its first field.
  • SUMIFS and COUNTIFS take up to two conditions in the form. Add further range and condition pairs by hand in the same pattern.
  • The generator checks nothing against your workbook. It cannot see your file, so confirm the ranges point at the right cells.

Questions

How does the Excel formula generator work?

You choose one of ten functions and fill in a short form with your cell references and conditions. The page puts the arguments in the right order, adds quotation marks where Excel needs them, and shows the finished formula with an explanation.

Does it use AI or understand plain-English descriptions?

No. It is a form-based builder. You pick the function and enter the cells yourself, and the same inputs always produce the same formula. Nothing you type is sent anywhere.

Which Excel functions can I build?

VLOOKUP, XLOOKUP, INDEX with MATCH, SUMIF, SUMIFS, COUNTIF, COUNTIFS, IF, IFERROR and TEXTJOIN. Each one has a reference page under Excel functions.

Do the formulas work in Google Sheets?

Yes. All ten functions exist in Google Sheets with the same arguments in the same order, so the formulas can be pasted there unchanged.

Why does Excel reject the formula I pasted?

The most common cause is the list separator. In many regional settings Excel expects semicolons between arguments instead of commas. Replace each comma that separates arguments with a semicolon.

Why does my formula show #NAME?

Your version of Excel does not have that function. XLOOKUP needs Excel 2021 or Microsoft 365, and TEXTJOIN needs Excel 2019 or later. For lookups, INDEX and MATCH work in every version.

Related