FREE LESSON 5 OF 47 · EXCEL AND GOOGLE SHEETS
Excel IF function practice
IF lets a formula make a decision: check a condition, then return one answer when it is true and another when it is false. Practice it below on an order list, with specific feedback when the answers are swapped or the text is missing its quotes.
- Free, no account
- Works for Excel
- Works for Google Sheets
- Works for LibreOffice Calc
How it works
The pattern is =IF(test, value if true, value if false). The test is any comparison that is either true or false.
Comparisons use = (equal), <> (not equal), > and < (greater and less than), and >= and <= (or equal). “20 or more” is >=20.
Text answers go inside straight double quotes: "Bulk". Numbers and cell references do not: =IF(C2>=20,B2*0.9,B2).
The true answer always comes first. Read the formula aloud as “if C2 is at least 20, then Bulk, otherwise Single”.
Pattern=IF(C2>=20,"Bulk","Single")
Worked example
Quantities are in column C. An order of 20 units or more is labeled Bulk.
| Formula | Result | Why |
|---|---|---|
=IF(C2>=20,"Bulk","Single") | Single | The notebook order is 12 units. |
=IF(C3>=20,"Bulk","Single") | Bulk | The pen order is 40 units. |
=IF(C5>=20,"Bulk","Single") | Single | The folder order is 16 units. |
Common mistakes and how to fix them
- =IF(C2>=20,Bulk,Single)Text without quotes is read as a name that does not exist, which gives a #NAME? error. Write "Bulk" and "Single".
- =IF(C2>=20,"Single","Bulk")The answers are the wrong way round. The value if true comes first.
- =IF(C2>20,"Bulk","Single")> 20 leaves out an order of exactly 20. “20 or more” is >=20.
- Curly quotes pasted from a documentExcel and Sheets reject “Bulk” with typographic quotes. Retype them as straight quotes in the formula bar. (This practice grid quietly straightens them for you.)
Excel, Google Sheets and LibreOffice Calc
IF works identically in Microsoft Excel and Google Sheets. In LibreOffice Calc it is the same function, but depending on your language settings the separator between arguments may be ; instead of , (the practice grid accepts both).
Keep going
Next free lesson: Excel COUNTIF practice
More free spreadsheet lessons
- Excel formulas for beginners
- Excel SUM function practice
- AVERAGE, MIN and MAX practice
- Excel absolute reference practice
- Excel COUNTIF practice
Where the Pro lessons go next
- Conditional totals with SUMIF
- Several conditions with SUMIFS and COUNTIFS
- Finding a row with VLOOKUP
- XLOOKUP, the modern lookup
- INDEX and MATCH
- Handling errors with IFERROR
Learn Pro continues through lookups, conditional totals, text and date functions, charts and pivot tables, with capstone workbooks at the end. The same hands-on style covers Word and Google Docs, PowerPoint and Google Slides and AI skills for work.
Abonvero Learn is independent and not affiliated with or endorsed by Microsoft, Google or The Document Foundation. Product names are trademarks of their respective owners. Operated by Andronykus Technologies LLC · contact@abonvero.com · Terms · Privacy