Skip to content

Excel IF Formula Generator

Choose the cell, the test and the results, and get a ready-to-paste IF formula with an explanation and an IFS version when you add branches.

Processed locally in your browser

Options

A cell (B2), a number, text (quoted for you), a date like 2024-01-31, or a formula starting with "=".

Each extra branch is tested in order after the main condition; the IFS version is shown below the formula.

Excel uses ";" when the regional settings use a decimal comma. Decimal numbers are then written with a comma too.

What is Excel IF Formula Generator?

The IF function returns one value when a test is true and another when it is false, but the syntax gets awkward as soon as you need text quotes, "contains" tests or several outcomes. This generator writes the formula for you: pick the cell, a condition such as greater than, contains or is blank, and the values for true and false.

You can add a second condition joined with AND or OR, and up to three extra ELSE-IF branches. The chain becomes nested IFs, and an IFS alternative is shown beside it, together with a plain-language explanation. Text is quoted with doubled inner quotes, references stay as references, and you can switch the argument separator to ";" and the function names to French or Spanish for regional versions of Excel.

How does it work?

  1. Type the cell to test (for example A2), pick the condition and enter the value to compare with.
  2. Enter what the formula should return when the test is true and when it is false. Text is quoted automatically; type B2 to return another cell.
  3. Optionally tick "Add a second condition" to combine two tests with AND or OR, or choose extra ELSE-IF branches for a grading-style chain.
  4. Pick the separator and function language for your Excel, then copy the formula. The explanation and the IFS or nested equivalents appear under it.

Common use cases

  • Turning scores into Pass or Fail, or a grade letter with three thresholds.
  • Flagging rows where a status equals "Overdue" and the amount exceeds a limit, using AND.
  • Checking whether a cell contains a keyword, begins with a code or is empty without memorising ISNUMBER(SEARCH()).
  • Converting a nested IF into the more readable IFS, or writing the formula in the language your Excel uses.

Examples

Choose the cell, the test and the results, and get a ready-to-paste IF formula with an explanation and an IFS version when you add branches.

Privacy

Excel IF Formula Generator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

The generator builds one formula from the fields shown: it does not read your workbook, so check the cell references. Contains tests use SEARCH, which ignores case, and IFS needs Excel 2019 or Microsoft 365.

Frequently asked questions

How do I test whether a cell contains some text?

Excel has no "contains" operator inside IF, so the formula uses ISNUMBER(SEARCH("text",A2)): SEARCH returns a position when the text is found and an error when it is not, and ISNUMBER turns that into TRUE or FALSE. It ignores upper and lower case, and the generator escapes the wildcards ? and * for you.

When should I use AND, OR or nested IFs?

Use AND when both tests must pass, OR when either is enough, and nested IFs (or IFS) when different results depend on different tests. With a second condition the tool also shows the nested-IF form, which behaves the same and avoids AND and OR.

How many IFs can I nest, and what is IFS?

Excel allows 64 nested levels, but three or more are already hard to read. IFS, available in Excel 2019 and Microsoft 365, lists the pairs of test and result in a flat sequence and ends with TRUE for the default value. The tool builds it for you whenever you add ELSE-IF branches.

More tools in Excel Tools →