How to Use the IF Function in Excel

Опубликовал Admin
27-05-2018, 13:00
185
0
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.”

Steps

  1. 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.
  2. Open a workbook. Select the workbook you want to edit, or click Blank workbook to create one from scratch.
  3. 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.
  4. 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:
    • =IF(C2>75,”PASS”,”FAIL”).
  5. 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.
  6. 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.
Теги:
Information
Users of Guests are not allowed to comment this publication.