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/ Your data stays in your browser.
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?
- Type the cell to test (for example A2), pick the condition and enter the value to compare with.
- 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.
- 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.
- 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.
Related tools
Excel Formula Explainer
Paste a formula you inherited or copied from the web and see what every function, reference and operator does, in nested order.
Excel Tools
Excel VLOOKUP Formula Generator
Fill in four fields and get a VLOOKUP with the right last argument, an optional IFERROR and warnings about the classic pitfalls.
Excel Tools
Excel XLOOKUP Formula Generator
Enter the value to find, where to look and what to return, and get a working XLOOKUP plus versions for older Excel.
Excel Tools
Excel SUMIFS Formula Generator
Pick the range to add up, add up to four conditions and get a SUMIFS with correctly quoted criteria, ready to paste.
Excel Tools
Excel COUNTIFS Formula Generator
Describe up to four conditions and get a COUNTIFS that counts the rows matching all of them, with dates and wildcards written correctly.
Excel Tools
Excel Column Letter ↔ Number Converter
Paste column letters or column numbers, one per line, and get the matching number or letters instantly, with a note for every line.
Excel Tools