# How to use the IF function in Excel 2010

The IF function is a useful operation that you can perform in Excel. In this post’ I’ll show you how to use the IF function in Excel 2010.

## Structure of the IF function in Excel 2010

The IF function in Excel has the following structure:

IF (logical_test, [value_if_true], [value_if_false])

Where:

logical_test is the logic or condition specified by the user

value_if_true is the value that will be displayed if the condition is met

value_if_false is the value that will be displayed if the condition is not met

## Applying the IF function in Excel

We will now illustrate how you can use the IF function in Excel.

Let’s suppose you want to determine whether each of the individuals below needs to pay taxes.

The logic/condition that you will use to determine whether a person needs to pay taxes is as follows:

• The person needs to pay taxes for an income that is equal or above \$20,000. This is your logical test that you can automate using the IF function in Excel

But before we start, you’ll need to either copy, or type, the following information in Excel:

 Name Income Income Equal or Above \$20,000 Need to Pay Taxes Steve \$20,000 Jane \$50,000 Ian \$5,000 Nancy \$75,000 Mark \$15,000 Maria \$12,000 Paul \$65,000 Alex \$8,000 Mona \$70,000 Emily \$50,000

Your Excel spreadsheet should look similar to this: ## Steps to execute the IF function

Once you copied, or typed, the data above in Excel, you’ll need to execute the following steps:

(1) To start, double-click on the cell you would like to apply the IF function. In our example, we will double-click on the cell C2 as highlighted in red below

(2) Then, type the following in cell C2: =IF(B2>=20000,“YES,”NO”)

Where:

logical_test is the condition that you want to test of whether the income is equal or above \$20,000 (where cell B2 represents the person’s income)

value_if_true is the value “YES” that will be displayed if the condition is met (i.e., Income is indeed equal or above \$20,000)

value_if_false is the value “NO” that will be displayed if the condition is not met (i.e., Income is below \$20,000)

This is how your Excel spreadsheet should look like: (3) Once you typed the above IF function in cell C2, you’ll need to press Enter.

You’ll now see that the word YES is displayed in cell C2. This is accurate, as the condition was met for an income equal or above \$20,000 (4) To apply your IF function across all the individuals in the list below, you’ll need to point with your mouse on the bottom-right of cell C2 until you see the plus symbol (+)

(5) Press the plus symbol (+), and then drag it down all the way to the bottom-right of cell C11.

By doing so, you effectively applied the IF function across all the individuals in the table (rather than typing the IF function multiple times) (6) This is how your spreadsheet would look like in Excel: ## Another logical test using the IF function

Let’s try another logical test to determine whether a person needs to pay the taxes:

(1) First, double-click on cell D2 where we will apply the IF function

(2) Then, type the following in cell D2: =IF(C2=”YES”, “YES”,“NO”)

Where:

logical_test is the condition that you want to test of whether a person needs to pay taxes

value_if_true is the value “YES” that will be displayed if the condition is met

value_if_false is the value “NO” that will be displayed if the condition is not met

This is how your Excel spreadsheet would look like: (3) Now, press Enter. You’ll see that the value “YES” will be displayed in cell D2: (4) As before, drag down the plus symbol (+) all the way from cell D2 to cell D11 in order to apply your IF function across all the individuals in the table: (5) Finally, this is how your table would look like after applying the IF function in Excel: You are now ready to use the IF function in Excel!

Excel is a powerful tool that you can use in order to automate different functions such as applying different arithmetic operations, finding the maximum and so on…