# Excel IF Then Formula: Else, Nested, AND, OR Examples
> Learn the Excel IF then else formula with worked examples: text, blanks, AND, OR, nested IF, SUM and COUNTIF, plus fixes for common errors.

- Web page: https://logicexcel.com/functions/if
- Language: en
- Also in: [Deutsch](https://logicexcel.com/de/functions/if.md), [Español](https://logicexcel.com/es/functions/if.md), [Français](https://logicexcel.com/fr/functions/if.md)
- Updated: 2026-11-03
- Practice this in the browser: https://logicexcel.com/practice/9

An Excel IF then formula tests a condition and returns one result when it is true and another when it is false. Type `=IF(C2>=100,"Bulk","Standard")` and Excel shows Bulk for any order of 100 units or more, and Standard for the rest. The test comes first, the "then" value second, the "else" value third.

This guide shows IF with text, numbers, blanks, partial matches, AND, OR, nested IF, SUM and COUNTIF, then the errors that break it.

## TL;DR

- The pattern is `=IF(logical_test, value_if_true, value_if_false)`. Text results go in double quotes, numbers and cell references do not.
- For multiple conditions inside one IF, wrap the tests in AND (all must be true) or OR (any one is enough).
- For multiple IF statements, nest one IF inside the else slot of another and put the strictest test first.
- To check whether a cell contains text, use `ISNUMBER(SEARCH(...))` inside IF. A plain equals sign only matches the whole cell.
- Leave the else slot out and a false test shows the word FALSE. Use `""` for an empty-looking cell, but remember it is text, not nothing.
- Past three or four nested levels, switch to IFS, SWITCH or a lookup table.

## Table of Contents

- [Sample data for the examples](#sample-data-for-the-examples)
- [IF syntax and arguments](#if-syntax-and-arguments)
- [How to write an Excel IF then else formula](#how-to-write-an-excel-if-then-else-formula)
- [Return a number, text or a calculation](#return-a-number-text-or-a-calculation)
- [IF text contains: match part of a cell](#if-text-contains-match-part-of-a-cell)
- [IF cell is blank or not blank](#if-cell-is-blank-or-not-blank)
- [IF with AND, OR and NOT for multiple conditions](#if-with-and-or-and-not-for-multiple-conditions)
- [Multiple IF statements: nested IF](#multiple-if-statements-nested-if)
- [IF with SUM and COUNTIF](#if-with-sum-and-countif)
- [Make IF return nothing, zero or FALSE](#make-if-return-nothing-zero-or-false)
- [IF compared with IFS, SWITCH and lookups](#if-compared-with-ifs-switch-and-lookups)
- [Which Excel versions have IF](#which-excel-versions-have-if)
- [IF errors and how to fix them](#if-errors-and-how-to-fix-them)
- [What learners get wrong](#what-learners-get-wrong)
- [A worked job: the dispatch board](#a-worked-job-the-dispatch-board)
- [Practice the IF function](#practice-the-if-function)
- [FAQ](#faq)
- [Sources](#sources)

## Sample data for the examples

Every example below uses one small order desk sheet. Row 1 holds the headings, and the orders sit in rows 2 to 8. Column G holds a dispatch label that the job section builds near the end.

| Row | A: Order | B: Customer | C: Units | D: Total | E: Status | F: Note | G: Dispatch |
|---|---|---|---|---|---|---|---|
| 1 | Order | Customer | Units | Total | Status | Note | Dispatch |
| 2 | A1001 | Kestrel Print | 120 | 1850 | Paid | Express courier | Ship bulk |
| 3 | A1002 | Bluegum Cafe | 40 | 620 | Paid | (blank) | Ship standard |
| 4 | A1003 | Harbor Tools | 250 | 4200 | Hold | Express courier | Hold back |
| 5 | A1004 | Lark Studio | 15 | 210 | Paid | Leave at gate | Ship standard |
| 6 | A1005 | Stonebridge Hardware | 90 | 960 | Pending | (blank) | Hold back |
| 7 | A1006 | Mesa Foods | 100 | 1500 | Paid | Call on arrival | Ship bulk |
| 8 | A1007 | Tern Supplies | 0 | 0 | Pending | (blank) | Hold back |

Type each formula in an empty cell next to row 2, then drag the fill handle down to row 8. The cell references shift down one row each time, which is why every formula below points at row 2.

## IF syntax and arguments

The IF function has three parts:

`=IF(logical_test, value_if_true, value_if_false)`

| Argument | Required | What it does |
|---|---|---|
| logical_test | Yes | Anything that can be TRUE or FALSE, such as `C2>=100`, `E2="Paid"` or a function like `AND(...)`. |
| value_if_true | Yes | What the cell shows when the test is TRUE. A number, quoted text, a cell reference or another formula. |
| value_if_false | No | What the cell shows when the test is FALSE. Leave it out and Excel returns the word FALSE. |

Three rules save most of the pain. Text you type into the formula goes inside straight double quotes. Numbers do not get quotes. And every opening bracket needs a closing one, which is the usual reason a long IF is rejected or misread.

Excel ignores capital letters in text comparisons, so `"paid"`, `"Paid"` and `"PAID"` all match. If you need an exact-case match, that has its own trick further down.

## How to write an Excel IF then else formula

Start with one question that has a yes or no answer. Is the order big enough to count as bulk? Put that question into the first slot, then decide what each answer should show.

`=IF(C2>=100,"Bulk","Standard")`

Row 2 holds 120 units. The test `C2>=100` is TRUE, so the cell shows Bulk. Filled down, you get Bulk, Standard, Bulk, Standard, Standard, Bulk, Standard for rows 2 to 8. Row 7 has exactly 100 units and still counts as Bulk, because `>=` means "greater than or equal to". Change it to `>` and row 7 flips to Standard. Boundaries are where most IF mistakes hide, so say the rule out loud before you type it: "100 or more" means `>=`, "more than 100" means `>`.

That is the whole idea behind every IF then else condition in Excel. The rest of this guide changes what goes into the three slots. If you want a refresher on the comparison symbols themselves, our guide to [logical operators in Excel](https://logicexcel.com/functions/logical-operators) lists all six.

A simple IF function example with two numbers works the same way. To flag orders where the total is more than ten times the unit count, test `D2>C2*10`. Excel does the multiplication first, then the comparison, because arithmetic runs before comparison operators.

## Return a number, text or a calculation

The two result slots can hold more than labels. They can hold sums.

`=IF(D2>=1000,D2*0.05,0)`

This gives a 5% rebate on orders of 1,000 or more and nothing on smaller ones. Row 2 returns 92.5, row 4 returns 210, row 7 returns 75, and the other rows return 0. Notice there are no quotes around `D2*0.05` or `0`. Quotes would turn the result into text, and text cannot be added up later.

For a text test, compare the cell to a quoted word:

`=IF(E2="Paid","Ship","Hold back")`

Row 2 is Paid, so it shows Ship. Row 4 is Hold, so it shows Hold back. Typing `=IF(E2="paid","Ship","Hold back")` with a lowercase p gives the same answer, because the comparison ignores case.

Forget the quotes around the word and Excel treats `Paid` as a name it has never heard of:

`=IF(E2=Paid,"Ship","Hold back")`

That returns #NAME?. Put the quotes back and it works.

If the capital letters matter, use EXACT, which does care:

`=IF(EXACT(E2,"paid"),"Match","No match")`

Row 2 holds Paid with a capital P, so EXACT says they differ and the cell shows No match.

## IF text contains: match part of a cell

An equals sign only passes when the entire cell matches. To test whether a cell contains some text, you need a partial match. Excel has no CONTAINS function, but SEARCH finds text inside text and returns its position as a number. Wrap it in ISNUMBER and you get TRUE or FALSE.

`=IF(ISNUMBER(SEARCH("express",F2)),"Rush","Normal")`

Row 2 says "Express courier". SEARCH finds "express" at position 1, ISNUMBER is TRUE, and the cell shows Rush. Row 3 is blank. SEARCH throws a #VALUE! error there, ISNUMBER turns that into FALSE, and the cell shows Normal. This is why you wrap SEARCH instead of testing it directly.

SEARCH ignores case. FIND is its case-sensitive sibling:

`=IF(ISNUMBER(FIND("express",F2)),"Rush","Normal")`

Row 2 starts with a capital E, so FIND does not see a match and the cell shows Normal. Use FIND only when the capitals carry meaning, such as product codes.

A second route uses COUNTIF with wildcards. The asterisk stands for any run of characters:

`=IF(COUNTIF(F2,"*express*")>0,"Rush","Normal")`

COUNTIF counts one cell here, so the answer is 1 or 0. It is shorter to read and ignores case, but it cannot do case-sensitive work. Our [wildcard characters guide](https://logicexcel.com/functions/wildcard-characters) covers the asterisk, the question mark and the tilde in full.

## IF cell is blank or not blank

Testing for a blank or non-blank cell has more than one good answer.

`=IF(F3="","No note","Has note")`

Row 3 is empty, so the result is No note. The test `F3=""` is TRUE for a truly empty cell and also for a cell holding an empty string. To flip it for "not blank", use the not-equal operator:

`=IF(F2<>"","Has note","No note")`

Row 2 has text, so it shows Has note. The third option is ISBLANK:

`=IF(ISBLANK(F3),"No note","Has note")`

This one is stricter. ISBLANK is TRUE only for a cell with nothing in it. A cell that holds a formula returning an empty string is not blank to ISBLANK, but it does equal `""`, so the first form catches it. A cell holding a single space fails both tests. If a column came from an import or a formula and ISBLANK gives odd results, switch to the `=""` test.

A cell that looks empty and fails both tests usually holds a space. Select it and check the formula bar for a gap, or use TRIM on the source.

## IF with AND, OR and NOT for multiple conditions

An IF has room for one logical test. To test multiple conditions, build the test with AND or OR and put that in the first slot. This is how you write an IF AND formula.

`=IF(AND(C2>=100,E2="Paid"),"Ship now","Wait")`

AND returns TRUE only when every condition is true. Row 2 has 120 units and is Paid, so it ships. Row 4 has 250 units but is on Hold, so AND fails and the cell shows Wait. Row 7 has exactly 100 units and is Paid, so it ships too.

OR needs only one condition to pass:

`=IF(OR(E2="Hold",E2="Pending"),"Chase","Fine")`

Row 2 is Paid, so neither test passes and it shows Fine. Rows 4 and 6 show Chase.

You can nest the helpers inside each other:

`=IF(AND(C2>=100,OR(E2="Paid",E2="Pending")),"Approve","Review")`

Read it from the inside: the OR accepts Paid or Pending, and the AND then insists on 100 units as well. Row 2 gives Approve. Row 4 (250 units, Hold) gives Review. Row 6 (90 units, Pending) gives Review because it falls short on units.

For the opposite of a test, the not-equal operator is the neater tool:

`=IF(E2<>"Paid","Chase","Fine")`

NOT does the same job and reads better when the test inside is long. Our guide to [logical functions](https://logicexcel.com/functions/logical-functions) walks through AND, OR, XOR and NOT with their truth tables.

## Multiple IF statements: nested IF

When two outcomes are not enough, put another IF in the else slot. This is the standard way to write multiple IF statements. Here is a four-tier customer rating:

`=IF(D2>=4000,"Platinum",IF(D2>=1500,"Gold",IF(D2>=600,"Silver","Bronze")))`

Excel works through the tests in order and stops at the first TRUE. Row 2 (1,850) fails the 4,000 test, passes the 1,500 test and returns Gold. The results for rows 2 to 8 are Gold, Silver, Platinum, Bronze, Silver, Gold, Bronze. There is one closing bracket for each IF, which is why the formula ends with three.

Order matters. Reverse the tests and the formula breaks without any error:

`=IF(D2>=600,"Silver",IF(D2>=1500,"Gold",IF(D2>=4000,"Platinum","Bronze")))`

Now row 2 returns Silver, because 1,850 passes the 600 test first and Excel never reaches the Gold line. When you test with greater-than, go from the highest threshold down. When you test with less-than, go from the lowest up.

Nesting also works on text outcomes:

`=IF(E2="Paid","Ship",IF(E2="Hold","Escalate","Wait"))`

The final "Wait" catches anything that is not Paid or Hold, which here means Pending. Always decide what the last else should catch. If you leave it out, unexpected values show FALSE.

Another way to combine several IF clauses in Excel is to join separate IFs instead of nesting them. Use `&` for text:

`=IF(C2>=100,"Bulk ","")&IF(E2="Hold","On hold","")`

Row 4 returns "Bulk On hold" because both tests pass. Row 2 returns "Bulk " and row 6 returns nothing. Use `+` when each IF returns a score:

`=IF(C2>=100,5,0)+IF(E2="Paid",3,0)`

Row 2 scores 8, row 4 scores 5, and row 6 scores 0. Excel allows up to 64 levels of nesting, but nobody can read that. If the formula needs more than three or four levels, the section on IFS and lookups below shows what to use instead.

## IF with SUM and COUNTIF

The logical test can hold any function that produces a number you can compare. SUM is the simplest:

`=IF(SUM(D2:D8)>=9000,"Target met","Below target")`

The totals add up to 9,340, so the cell shows Target met. SUM adds every row, though, and the target might only count paid orders. SUMIF fixes that:

`=IF(SUMIF(E2:E8,"Paid",D2:D8)>=5000,"On track","Behind")`

SUMIF adds the totals in D where E says Paid: 1,850 plus 620 plus 210 plus 1,500, which is 4,180. That is under 5,000, so the cell shows Behind. See the [SUMIF guide](https://logicexcel.com/functions/sumif) for the criteria rules.

COUNTIF is the partner for "how many":

`=IF(COUNTIF(E2:E8,"Hold")>0,"Review holds","All clear")`

One order is on Hold, so the count is 1 and the result is Review holds. The `>0` matters. Without it, any count above zero is read as TRUE and zero as FALSE, which works but hides your intent. Read more in the [COUNTIF guide](https://logicexcel.com/functions/countif).

## Make IF return nothing, zero or FALSE

Three different things can appear when you want "nothing", and they behave differently.

`=IF(E2="Paid",D2,"")`

Row 2 shows 1,850. Row 4 shows an empty-looking cell. That cell holds an empty string, which is text. Adding it with the plus sign gives #VALUE!, while SUM skips it quietly. Charts treat it as zero, which is a common surprise.

Leave the else slot out:

`=IF(E4="Paid",D4)`

Row 4 now shows FALSE. That is Excel's way of saying "the test failed and you gave me nothing else to show." It is rarely what you want on a report.

Use a zero when you need math to keep working:

`=IF(E4="Paid",D4,0)`

Row 4 shows 0. You can hide the zeros with a number format instead of changing the formula.

A related trap runs the other way. If the true slot points at an empty cell, Excel shows 0, not blank:

`=IF(E3="Paid",F3,"No")`

Row 3 is Paid, and F3 is empty, so the cell shows 0. Add `&""` after the reference if you need it to stay empty.

The classic use of the empty string is a guard against division errors:

`=IF(C2=0,"",ROUND(D2/C2,2))`

Row 2 returns 15.42, the price per unit. Row 8 has zero units, so the test catches it and the cell stays empty. Without the guard, `=D8/C8` returns #DIV/0!.

## IF compared with IFS, SWITCH and lookups

IF is the general tool. These are the specialists:

| Tool | Best for | Watch out for |
|---|---|---|
| IF | One test, or two or three outcomes | Gets unreadable beyond three or four nested levels |
| IFS | Many ordered tests in a flat list | Needs Excel 2019 or Microsoft 365. No match returns #N/A unless you add a final TRUE |
| SWITCH | One value matched against exact options | Exact matches only, no ranges |
| Lookup table | Many tiers that change over time | Needs a table on the sheet and an approximate-match lookup |
| IFERROR | Catching an error from another formula | Hides real errors if used everywhere |

The tier example above looks like this in IFS:

`=IFS(D2>=4000,"Platinum",D2>=1500,"Gold",D2>=600,"Silver",TRUE,"Bronze")`

Row 2 returns Gold, the same as the nested version, but the tests read as a flat list. The final `TRUE,"Bronze"` pair is the catch-all. The [IFS guide](https://logicexcel.com/functions/ifs) covers that pattern in depth.

SWITCH fits when you compare one cell to exact values:

`=SWITCH(E2,"Paid","Ship","Hold","Escalate","Wait")`

Row 2 returns Ship. The last argument, Wait, has no partner, so SWITCH uses it as the default. SWITCH cannot test `>=`, so it would not work for the tier example. See the [SWITCH guide](https://logicexcel.com/functions/switch).

If your tiers sit in a table on the sheet, an approximate-match [VLOOKUP](https://logicexcel.com/functions/vlookup) or [XLOOKUP](https://logicexcel.com/functions/xlookup) beats any long IF, because you change the table instead of the formula.

## Which Excel versions have IF

IF is in every version of Excel, from the oldest releases to Microsoft 365, in Excel for the web and in Excel for Mac. The formulas on this page that use only IF, AND, OR, NOT, SUM, SUMIF, COUNTIF, SEARCH, FIND and ISNUMBER run everywhere.

Two things depend on the version. IFS and SWITCH need Excel 2019, Excel 2021, Excel 2024 or Microsoft 365, including the web and Mac editions of those. They do not exist in Excel 2016 without a subscription or in Excel 2013. And Excel 2007 and later allow 64 nested IFs, where older versions stopped at 7.

## IF errors and how to fix them

| What you see | Cause | Fix |
|---|---|---|
| #NAME? | Text without quotes, such as `=IF(E2=Paid,"Ship","Hold back")`, or a misspelled function name | Put straight double quotes around the word, and check the spelling of IF |
| #VALUE! | The test is text that is not TRUE or FALSE, such as `=IF("yes","A","B")`, or a SEARCH inside IF with no ISNUMBER wrapper | Make the first slot a real comparison, or wrap SEARCH in ISNUMBER |
| #DIV/0! | The true or false branch divides by zero | Test the divisor first, as in `=IF(C2=0,"",ROUND(D2/C2,2))` |
| FALSE shown in the cell | The else slot is missing and the test failed | Add a third argument, even an empty `""` |
| 0 shown where you expected blank | The result slot points at an empty cell | Add `&""` to the reference, or return `""` for the empty case |
| Wrong result with no error | Numbers stored as text, or the comparison used `"100"` in quotes | Convert the column to numbers. Remove quotes around numeric criteria |
| "Too many arguments" or "There's a problem" | A comma in the wrong place, a missing bracket, or a fourth argument | Count the commas and brackets. Use AND or OR for more tests |

The quoted-number trap is worth seeing once. Compare a number to a text "100":

`=IF(C2>"100","Bulk","Standard")`

Row 2 holds 120, which is a number, and Excel ranks any text above any number. The test is FALSE and the cell shows Standard, even though 120 is more than 100. Lose the quotes.

## What learners get wrong

Between 26 September and 3 November 2026, learners made 16,169 first attempts across our [IF Function lesson](https://logicexcel.com/practice/9), and 63.2% were right. These counts are first checks of a screen in a page view, not people. The patterns below come from the hardest screens.

The hardest screen asks for a dog food rule: 2 scoops if the weight in D3 is over 30 lbs, otherwise 1. Across 1,729 first attempts only 27.9% were right. The same four mistakes show up again and again. Suppose D3 holds a 42 lb dog.

1. **Quoting the results.** `=IF(D3>30,"2","1")` was the most common wrong answer, with 357 first attempts. It looks correct, but it returns the text "2", not the number 2. The correct form is `=IF(D3>30,2,1)`, which returns the number 2.
2. **Swapped results.** `=IF(D3>30,1,2)` was typed 62 times. The test is right and the answers are the wrong way round, so the heavy dog gets 1 scoop.
3. **The wrong row.** `=IF(D4>30,2,1)` was typed 59 times. The formula points one row down at a different dog. On the next screen, which asks for a vaccination rule using the age in C2, `=IF(C3>=10,2,3)` drew 120 first attempts and `=IF(C4>=10,2,3)` drew 112. The logic was right and the row was wrong. Check which row the question names before you type.
4. **A missing equals sign.** `IF(D3>30,2,1)` was typed 37 times. Without the leading `=`, Excel stores the whole thing as text and shows the formula, not the answer.

The age screen adds two more slips. Of 1,580 first attempts on that screen, 43.7% were right. Thirty-seven first attempts wrote the operator backwards as `=>` instead of `>=`, with the greater-than sign first. Another 39 pointed at the row below and also used `>` instead of `>=`. That second fault matters on its own: with `>`, a dog aged exactly 10 would get 3 vaccinations instead of 2. A 10-year-old gets 2 only when the test uses `>=`.

In our [IF Combinations lesson](https://logicexcel.com/practice/82), 1,208 first attempts landed at 55.8%. The hardest screen asks for "Top Tier" when at least 3 albums are rated above 8. Only 28.3% of its 120 first attempts were right. Take a rating list in B2:B6 that holds 9, 7, 6, 8 and 5. Only one rating is above 8, so the answer should be Mid Tier. The wrong form `=IF(COUNTIF(B2:B6,">8"),"Top Tier","Mid Tier")` returns Top Tier anyway. It drops the `>=3`, and Excel reads any count above zero as TRUE. The right form is `=IF(COUNTIF(B2:B6,">8")>=3,"Top Tier","Mid Tier")`, which returns Mid Tier.

The same lesson shows a related slip with SUM. Three first attempts on the Eminem screen were `=IF(B3>20,"Legend","Rising")`, a single cell instead of the total. With the five values above, B3 holds 7, so that returns Rising, while `=IF(SUM(B2:B6)>20,"Legend","Rising")` adds all five and returns Legend. When the question says "total", the test needs SUM.

## A worked job: the dispatch board

You get the order list above on Monday morning and need a board that tells the warehouse what to do. Build it in four steps.

1. **Label each order.** In G2 type the dispatch rule. Only paid orders ship, and bulk orders get their own label:

   `=IF(E2<>"Paid","Hold back",IF(C2>=100,"Ship bulk","Ship standard"))`

   Fill it down to row 8. You get Ship bulk, Ship standard, Hold back, Ship standard, Hold back, Ship bulk, Hold back.

2. **Count the holds.** Under the table, count the orders that carry the Hold back label and warn when the number gets high:

   `=IF(COUNTIF(G2:G8,"Hold back")>=3,"Call the holds","Fine")`

   Three orders are held, so the cell shows Call the holds.

3. **Check the cash.** Compare paid revenue against the day's target:

   `=IF(SUMIF(E2:E8,"Paid",D2:D8)>=4000,"Cash target met","Cash target missed")`

   Paid orders total 4,180, so the cell shows Cash target met.

4. **Pull out the rebate.** Add a rebate column that only fires for paid, big orders:

   `=IF(AND(E2="Paid",D2>=1000),D2*0.05,"")`

   Row 2 returns 92.5 and row 7 returns 75. Rows 3 and 5 stay empty. Row 4 stays empty because it is on hold, even though the total is large.

Each step uses a different part of IF, and the whole board runs on one rule per column. Change the Monday data and every label updates.

## Practice the IF function

Reading about IF only goes so far. Open [Practice Lesson 9](https://logicexcel.com/practice/9) and type the formula yourself, because most mistakes come from the fingers: a missing quote, a drifted row. Then try [IF Combinations](https://logicexcel.com/practice/82) to nest IF around SUM and COUNTIF, and [True & False](https://logicexcel.com/practice/48) to get comfortable with how a comparison turns into TRUE or FALSE before IF reads it.

For the next step, see [conditional formatting formulas](https://logicexcel.com/functions/conditional-formatting-formulas) to colour a row with the same tests you wrote here.

## FAQ

### How do I write an IF THEN formula in Excel?

Type `=IF(` then the test, a comma, the result for TRUE, another comma, and the result for FALSE, then close the bracket. For example, `=IF(C2>=100,"Bulk","Standard")`. There is no separate THEN or ELSE keyword. The commas do that job: the first result is the then, the second is the else.

### Can Excel do IF ELSE?

Yes. The IF function is Excel's if else. The second argument is the "then" result and the third is the "else" result. For more branches, put another IF in the third slot, which is Excel's version of else if. IFS gives a flatter way to do the same on Excel 2019 and Microsoft 365.

### How do I use multiple IF statements in Excel?

Nest them. Put a second IF inside the false slot of the first, then a third inside the second, and so on. Test the strictest condition first so Excel does not stop early. Close one bracket per IF at the end. If you go past three or four levels, use IFS or a lookup table instead.

### How do I use IF with multiple conditions?

Put AND or OR in the first slot. `AND(C2>=100,E2="Paid")` needs both conditions to be true. `OR(E2="Hold",E2="Pending")` needs just one. You can nest them, as in `AND(C2>=100,OR(...))`. The IF itself still has only three slots.

### How do I check if a cell contains text in an IF formula?

Wrap SEARCH in ISNUMBER: `=IF(ISNUMBER(SEARCH("express",F2)),"Rush","Normal")`. SEARCH returns a position when the text is found and an error when it is not, and ISNUMBER turns both into TRUE or FALSE. Use FIND instead of SEARCH when capital letters must match. A plain equals sign only matches the whole cell.

### How do I make IF check whether a cell is blank?

Use `=IF(F3="","Blank","Not blank")`, or ISBLANK for a strict test of a truly empty cell. To test for not blank, use `<>""` as in `=IF(F2<>"","Has note","No note")`. The `=""` form also catches cells that hold an empty string from another formula, which ISBLANK misses.

### Why does my IF formula show FALSE instead of a value?

The test failed and the third argument is missing, so Excel returns FALSE. Add a value or an empty string as the third argument, for example `=IF(E4="Paid",D4,"")`. If the formula shows FALSE when you expected a value, check the test itself too, because a quoted number or a trailing space can make a true test fail.

### How many IFs can you nest in Excel?

Up to 64 in Excel 2007 and later, and 7 in older versions. In practice, three or four is the limit of what anyone can maintain. Past that, use IFS for flat ordered tests, SWITCH for exact matches, or a lookup table when the thresholds are likely to change.

## Sources

- [IF function, Microsoft Support](https://support.microsoft.com/en-us/office/if-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2)
- [AND function, Microsoft Support](https://support.microsoft.com/en-us/office/and-function-5f19b2e8-e1df-4408-897a-ce285a19e9d9)
- [Calculation operators and precedence in Excel, Microsoft Support](https://support.microsoft.com/en-us/office/calculation-operators-and-precedence-in-excel-48be406d-4975-4d31-b2b8-7af9e0e2878a)
