This wikiHow 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.”
EditSteps
- Open Microsoft Excel. If you’re using Windows, Type 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 . Here's what the formula would look like for our test scores example:
- .
- Press or . 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.
No comments:
Post a Comment