---
title: "IF in Google Sheets: practice exercises | ExcelSavvy"
description: "Practice the IF function in Google Sheets: conditions, text results and nested IFs, in exercises that are checked as you type."
canonical_url: "https://excelsavvy.com/sheets/practice/if"
meta:
  "og:description": "Practice the IF function in Google Sheets: conditions, text results and nested IFs, in exercises that are checked as you type."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~SUYgaW4gR29vZ2xlIFNoZWV0czogcHJhY3RpY2UgZXhlcmNpc2Vz%2Cdescription_~UHJhY3RpY2UgdGhlIElGIGZ1bmN0aW9uIGluIEdvb2dsZSBTaGVldHM6IGNvbmRpdGlvbnMsIHRleHQgcmVzdWx0cyBhbmQgbmVzdGVkIElGcywgaW4gZXhlcmNpc2VzIHRoYXQgYXJlIGNoZWNrZWQgYXMgeW91IHR5cGUu%2Ceyebrow_Google%2BSheets%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJDIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIlN0dWRlbnQiLCJTY29yZSIsIlJlc3VsdCJdfSx7Im4iOjIsImNlbGxzIjpbIkFubmEiLCI2MiIsIiJdfV0sInRhcmdldCI6WzEsMl19fQ%2Cp_Ii9zaGVldHMvcHJhY3RpY2UvaWYi%2Cs_TUk2h07yssD4F_Y4.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "IF in Google Sheets: practice exercises | ExcelSavvy"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~SUYgaW4gR29vZ2xlIFNoZWV0czogcHJhY3RpY2UgZXhlcmNpc2Vz%2Cdescription_~UHJhY3RpY2UgdGhlIElGIGZ1bmN0aW9uIGluIEdvb2dsZSBTaGVldHM6IGNvbmRpdGlvbnMsIHRleHQgcmVzdWx0cyBhbmQgbmVzdGVkIElGcywgaW4gZXhlcmNpc2VzIHRoYXQgYXJlIGNoZWNrZWQgYXMgeW91IHR5cGUu%2Ceyebrow_Google%2BSheets%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJDIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIlN0dWRlbnQiLCJTY29yZSIsIlJlc3VsdCJdfSx7Im4iOjIsImNlbGxzIjpbIkFubmEiLCI2MiIsIiJdfV0sInRhcmdldCI6WzEsMl19fQ%2Cp_Ii9zaGVldHMvcHJhY3RpY2UvaWYi%2Cs_TUk2h07yssD4F_Y4.png"
---

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

# **IF practice in Google Sheets**

IF works the same way in Google Sheets as in Excel: IF(condition, value\_if\_true, value\_if\_false). Text results go in quotes, and IFs can be nested inside each other.

[**Start the first exercise**](https://excelsavvy.com/sheets/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/sheets/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/sheets/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/sheets/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/sheets/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/sheets/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/sheets/practice/if/if-cell-contains-text)

## **Functions in this topic**

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

## **Questions**

<details>

<summary>

### Is IF in Google Sheets the same as in Excel?

</summary>

Yes. It takes the same three arguments, and conditions with =, &lt;&gt;, &lt;, &gt;, AND and OR are written the same way.

</details>

<details>

<summary>

### How do I use IF on a whole column in Google Sheets?

</summary>

Wrap it in ARRAYFORMULA and use an open range: =ARRAYFORMULA(IF(B2:B&gt;=50,"Pass","Fail")). One formula then fills the whole column, and new rows are included. Empty cells count as 0 and show Fail, so test for them first with IF(B2:B="","",...).

</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/sheets/practice/if#webpage","description":"Practice the IF function in Google Sheets: conditions, text results and nested IFs, in exercises that are checked as you type.","name":"IF in Google Sheets: practice exercises","url":"https://excelsavvy.com/sheets/practice/if","@type":["WebPage","CollectionPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/sheets/practice/if#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/sheets/practice/if#/schema/question/1"},{"@id":"https://excelsavvy.com/sheets/practice/if#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/sheets/practice/if"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/sheets/practice/if#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Google Sheets practice exercises","item":"https://excelsavvy.com/sheets","position":2},{"@type":"ListItem","name":"IF in Google Sheets: practice exercises","position":3}]},{"@id":"https://excelsavvy.com/sheets/practice/if#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"Is IF in Google Sheets the same as in Excel?","acceptedAnswer":{"@type":"Answer","text":"Yes. It takes the same three arguments, and conditions with =, \u003C>, \u003C, >, AND and OR are written the same way."}},{"@id":"https://excelsavvy.com/sheets/practice/if#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I use IF on a whole column in Google Sheets?","acceptedAnswer":{"@type":"Answer","text":"Wrap it in ARRAYFORMULA and use an open range: =ARRAYFORMULA(IF(B2:B>=50,\"Pass\",\"Fail\")). One formula then fills the whole column, and new rows are included. Empty cells count as 0 and show Fail, so test for them first with IF(B2:B=\"\",\"\",...)."}},{"@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.
