How to Use the IF Function in Excel
This article teaches you how to use the IF function in Excel to make a logical comparison between a value and the expected result. The IF function basically says “If something is true, then do something. If not, do something else.”


Open Microsoft Excel. If you’re using Windows, Type excel into the search bar and click Microsoft Excel in the results. If you’re on a Mac, you should find Excel on the Launchpad.

Open a workbook. Select the workbook you want to edit, or click Blank workbook to create one from scratch.

Click the cell where you want the IF function’s results to show. This is the cell in which you’ll type the formula.
Let’s say column C contains test scores ranging from 72 to 98. These scores appear in cells C2, C3, C4, and C5. A passing grade is 75 and higher, while all scores below 75 are fails. We’d like the word “PASS” to appear next to a passing grade, and “FAIL” next to a failing grade. In this case, we’d want to enter the formula in D2, next to the first score.
Type the formula using this example. The syntax for IF is =IF(logical_test,[value_if_true], [value_if_false]). Here’s what the formula would look like for our test scores example:
Press ↵ Enter or ⏎ Return. This runs the formula.
Using our example, if the score is 75 or over, the word PASS will appear in the cell. If it’s less than 75, you’ll see FAIL.
Drag the formula down to the other cells in the column. In our example, we’ve entered the formula into C2, so we’d drag the bottom-right corner of C2 cell down until all cells between C2 and C5 are highlighted. This runs the formula on the remaining data.
You’re helping people by reading wikiHow
wikiHow’s mission is to help people learn, and we really hope this article helped you. Now you are helping others, just by visiting wikiHow.

Hack the Hood is a non-profit that introduces low-income youth of color to careers in tech by hiring and training them to build websites for small businesses in their own communities. Participants learn coding, design, and 21st century workplace skills, while gaining valuable leadership and entrepreneurship experience.

Click below to let us know you read this article, and wikiHow will donate to Hack the Hood on your behalf. Thanks for helping us achieve our mission of helping people learn how to do anything.

Yes, I read the article
Quick Summary
The syntax for IF is =IF(logical_test,[value_if_true], [value_if_false])

Related wikiHows
How to
Change from Lowercase to Uppercase in Excel
How to
Make a Line Graph in Microsoft Excel
How to
Make a Spreadsheet in Excel
How to
Make a Bar Graph in Excel
How to
Convert Excel to PDF
How to
Write a Simple Macro in Microsoft Excel
How to
Calculate Mean and Standard Deviation With Excel 2007
How to
Prepare Amortization Schedule in Excel
How to
Reduce Size of Excel Files
How to
Subtract in Excel
How to
Run a Multiple Regression in Excel
How to
Create a Mortgage Calculator With Microsoft Excel
How to
Copy Formulas in Excel
How to
Use Excel
About This Article
Co-authors: 4
Updated: May 15, 2018
Views: 124
Categories: Microsoft Excel
Sources and Attribution
Is this article up to date?