---
title: "IF practice: 6 exercises with answers | ExcelSavvy"
description: "Practice the Excel IF function: pass or fail, a bonus, nested IFs, ISBLANK and comparing two cells, in a live spreadsheet that checks you instantly."
canonical_url: "https://excelsavvy.com/practice/if"
meta:
  "og:description": "Practice the Excel IF function: pass or fail, a bonus, nested IFs, ISBLANK and comparing two cells, in a live spreadsheet that checks you instantly."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~SUYgcHJhY3RpY2U6IDYgZXhlcmNpc2VzIHdpdGggYW5zd2Vycw%2Cdescription_~UHJhY3RpY2UgdGhlIEV4Y2VsIElGIGZ1bmN0aW9uOiBwYXNzIG9yIGZhaWwsIGEgYm9udXMsIG5lc3RlZCBJRnMsIElTQkxBTksgYW5kIGNvbXBhcmluZyB0d28gY2VsbHMsIGluIGEgbGl2ZSBzcHJlYWRzaGVldCB0aGF0IGNoZWNrcyB5b3UgaW5zdGFudGx5Lg%2Ceyebrow_Excel%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJDIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIlN0dWRlbnQiLCJTY29yZSIsIlJlc3VsdCJdfSx7Im4iOjIsImNlbGxzIjpbIkFubmEiLCI2MiIsIiJdfV0sInRhcmdldCI6WzEsMl19fQ%2Cp_Ii9wcmFjdGljZS9pZiI%2Cs__Y_0fZ8cXg3jjJW_.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "IF practice: 6 exercises with answers | ExcelSavvy"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~SUYgcHJhY3RpY2U6IDYgZXhlcmNpc2VzIHdpdGggYW5zd2Vycw%2Cdescription_~UHJhY3RpY2UgdGhlIEV4Y2VsIElGIGZ1bmN0aW9uOiBwYXNzIG9yIGZhaWwsIGEgYm9udXMsIG5lc3RlZCBJRnMsIElTQkxBTksgYW5kIGNvbXBhcmluZyB0d28gY2VsbHMsIGluIGEgbGl2ZSBzcHJlYWRzaGVldCB0aGF0IGNoZWNrcyB5b3UgaW5zdGFudGx5Lg%2Ceyebrow_Excel%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJDIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIlN0dWRlbnQiLCJTY29yZSIsIlJlc3VsdCJdfSx7Im4iOjIsImNlbGxzIjpbIkFubmEiLCI2MiIsIiJdfV0sInRhcmdldCI6WzEsMl19fQ%2Cp_Ii9wcmFjdGljZS9pZiI%2Cs__Y_0fZ8cXg3jjJW_.png"
---

> Index of every page on this site: [llms.txt](https://excelsavvy.com/llms.txt)

# **IF practice exercises**

Make a formula choose between two answers with IF: pass or fail, bonus or none, and nested IFs for more than two outcomes.

[**Start the first exercise**](https://excelsavvy.com/practice/if/if-pass-fail)

IF(

## **How IF works**

IF makes a formula choose between two answers. It takes three arguments: a test that is either true or false, what to show when it is true, and what to show when it is false.

`**=IF(B2>=50,"Pass","Fail")**` shows Pass when the score in B2 is 50 or more and Fail otherwise. Text answers go in quotes; numbers and formulas don't, so `**=IF(C2>1000,C2*0.05,0)**` works out a 5% bonus only on sales over 1,000.

For more than two outcomes you can put one IF inside another, but past two or three levels IFS or a lookup table is easier to read. To test two conditions at once, put AND or OR inside the test. The exercises below cover pass or fail, a calculated bonus, comparing two cells, checking for text or an empty cell, and a nested IF.

1. [**1****Pass or fail with IF**The passing score is 50. In C2, use IF to show "Pass" when the score in B2 is 50 or more, and "Fail" otherwise.](https://excelsavvy.com/practice/if/if-pass-fail)
2. [**2****Calculate a bonus with IF****Premium**Sellers with sales over 1000 get a 10% bonus; everyone else gets 0. In C2, use IF to calculate the bonus for B2.](https://excelsavvy.com/practice/if/if-calculate-bonus)
3. [**3****Three outcomes with nested IF****Premium**Grade the score in B2: 90 or more is "A", 70 or more is "B", anything lower is "C". In C2, put a second IF inside the first.](https://excelsavvy.com/practice/if/nested-if)
4. [**4****Flag missing values with ISBLANK****Premium**In D2, show "Missing" when the hours in B2 are blank, and otherwise the pay, B2\*C2. Use IF with ISBLANK.](https://excelsavvy.com/practice/if/if-isblank-missing)
5. [**5****Compare two cells with IF****Premium**In D2, show "Over budget" if the amount spent in C2 is more than the budget in B2, and "OK" if not.](https://excelsavvy.com/practice/if/if-compare-two-cells)
6. [**6****IF a cell contains a word****Premium**In B2, show "Pro" if the product name in A2 contains "pro" anywhere, and "Standard" if it does not. IF has no wildcards, so test with ISNUMBER(SEARCH("pro",A2)).](https://excelsavvy.com/practice/if/if-cell-contains-text)

## **Functions in this topic**

- [**IF**](https://excelsavvy.com/functions/if)

## **Read the guide**

- [**Excel test for a job interview: what it looks like and how to practice**](https://excelsavvy.com/learn/excel-for-job-interviews)
- [**Free Excel course online: learn Excel from your first formula to job-ready**](https://excelsavvy.com/learn/how-to-learn-excel)
- [**Excel IF formulas: from one condition to many**](https://excelsavvy.com/learn/excel-if-function)
- [**Best Excel courses online in 2026: 10 places to learn Excel, ranked**](https://excelsavvy.com/learn/best-places-to-learn-excel)
- [**Udemy vs Coursera vs LinkedIn Learning for Excel: which to pick**](https://excelsavvy.com/learn/udemy-vs-coursera-vs-linkedin-learning-excel)

## **Questions**

<details>

<summary>

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

</summary>

Put AND or OR inside the test. =IF(AND(B2&gt;=50,C2="Yes"),"Pass","Fail") needs both conditions, and =IF(OR(B2&gt;=50,C2="Yes"),"Pass","Fail") needs only one. For several different outcomes, IFS is easier to read than nested IFs, but it needs Excel 2019 or Microsoft 365.

</details>

<details>

<summary>

### Why does my IF formula return FALSE or 0?

</summary>

If you leave out the last argument, IF shows FALSE when the test fails: =IF(B2&gt;=50,"Pass") gives FALSE for a 40. If you type the comma but nothing after it, you get 0. Add "" as the last argument, =IF(B2&gt;=50,"Pass",""), to show an empty cell instead.

</details>

<details>

<summary>

### How do I color a cell with IF?

</summary>

IF can only change the value, not the color. Use conditional formatting instead: select the cells, choose Conditional Formatting, New Rule, Use a formula, and enter the test, such as =B2&gt;=50. Pick a fill color, and every cell that passes the test gets it.

</details>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://excelsavvy.com/#identity","@type":"Organization","name":"ExcelSavvy","url":"https://excelsavvy.com/","logo":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/#website","@type":"WebSite","inLanguage":"en-US","name":"ExcelSavvy","url":"https://excelsavvy.com/","alternateName":["Excel Savvy","ExcelSavvy.com","PracticeExcel","Practice Excel Online"],"publisher":{"@id":"https://excelsavvy.com/#identity"},"workTranslation":[{"@id":"https://excelopgaver.dk/#website"},{"@id":"https://excelpraxis.de/#website"}]},{"@id":"https://excelsavvy.com/practice/if#webpage","description":"Practice the Excel IF function: pass or fail, a bonus, nested IFs, ISBLANK and comparing two cells, in a live spreadsheet that checks you instantly.","name":"IF practice: 6 exercises with answers","url":"https://excelsavvy.com/practice/if","@type":["WebPage","CollectionPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/practice/if#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/practice/if#/schema/question/1"},{"@id":"https://excelsavvy.com/practice/if#/schema/question/2"},{"@id":"https://excelsavvy.com/practice/if#/schema/question/3"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/practice/if"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/practice/if#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Excel practice exercises","item":"https://excelsavvy.com/practice","position":2},{"@type":"ListItem","name":"IF practice: 6 exercises with answers","position":3}]},{"@id":"https://excelsavvy.com/practice/if#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I use IF with multiple conditions?","acceptedAnswer":{"@type":"Answer","text":"Put AND or OR inside the test. =IF(AND(B2>=50,C2=\"Yes\"),\"Pass\",\"Fail\") needs both conditions, and =IF(OR(B2>=50,C2=\"Yes\"),\"Pass\",\"Fail\") needs only one. For several different outcomes, IFS is easier to read than nested IFs, but it needs Excel 2019 or Microsoft 365."}},{"@id":"https://excelsavvy.com/practice/if#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"Why does my IF formula return FALSE or 0?","acceptedAnswer":{"@type":"Answer","text":"If you leave out the last argument, IF shows FALSE when the test fails: =IF(B2>=50,\"Pass\") gives FALSE for a 40. If you type the comma but nothing after it, you get 0. Add \"\" as the last argument, =IF(B2>=50,\"Pass\",\"\"), to show an empty cell instead."}},{"@id":"https://excelsavvy.com/practice/if#/schema/question/3","@type":"Question","inLanguage":"en-US","name":"How do I color a cell with IF?","acceptedAnswer":{"@type":"Answer","text":"IF can only change the value, not the color. Use conditional formatting instead: select the cells, choose Conditional Formatting, New Rule, Use a formula, and enter the test, such as =B2>=50. Pick a fill color, and every cell that passes the test gets it."}},{"@id":"https://excelsavvy.com/#logo","@type":"ImageObject","caption":"ExcelSavvy","contentUrl":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3","inLanguage":"en-US","url":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3"}]}
```

## Sitemap

See the full [sitemap](https://excelsavvy.com/sitemap.md) for all pages.
