To enjoy Excel fully, you must know how to use the IF-THEN function.

The IF-THEN is one of Excel’s most impressive functions, as you can use it to analyze data, draw inferences and make decisions under certain preset conditions. But what exactly are IF-THEN statements, and how can you start using them?

In this guide, we’ll show you how to use IF-THEN statements to improve your mastery of Excel.

**Table of Contents**

## What are IF-THEN Statements in Excel?

The syntax usually looks like this:

Using the If function, I set a condition using the syntax:

I then extended this function to the other respective cells using a simple autofill trick. Check out our guide on using Excel like a pro for some helpful tricks to make your Excel experience easier.

It’s important to note that the IF-THEN statement only allows you to set a condition for two variables. That means you can only set conditions including, say, the data value in cells B1 and C1 or a condition including data values in cell B1 and a defined integer or text.

For example, you can set a condition instructing Excel to return a response of “Yes” if the value in cell B1 is greater than the value of cell B2 as shown in the example above. Or, you can set a condition asking Excel to return the response ”yes” or “no” if the value of cell B1 is greater or less than 1000.

Here’s a quick example:

Here, I told Excel to return the response “yes” if the data value in cell C1 is greater than 5000 and “no” if the value is less than 5000.

Here’s the response Excel returned:

As mentioned earlier, the IF-THEN statement is a powerful Excel function with numerous benefits. Learning to use this function properly will astronomically increase your mastery of Excel.

## The Benefits of IF-THEN Statements In Excel

Here are some benefits that IF-THEN statements in Excel can offer you:

### Checking for Errors in Data

You can use IF-THEN statements to check for errors when inputting data into the spreadsheet.

### Calculating Debt Schedule or Depreciation Schedule

Financial Analysts can use IF-THEN statements to calculate debt and depreciation schedules.

### For Budgeting

### To Organize Data

### Works Well With Other Formulas

## How to Use IF-THEN Statements in Excel

**Step 1:** Click on the cell you wish to format, say cell A1.

**Step 2: **Write the IF-THEN function formula directly into the cell box.

**Step 3:** Begin writing your conditions and expected responses to said conditions.

Here’s an alternative step-by-step you can use.

**Alternative Step 1:** Click on the “Formulas” tab in the taskbar menu of your Excel program.

**Alternative Step 2:** Click on the “Insert Function” option, which will launch a dialog menu:

### Writing IF-THEN Function for texts

**Step 1: **Click on the cell box where you want to insert the function.

**Step 2:** Write the “equal” (=) sign.

**Step 4: **After writing the if statement, click enter.

In this example, using the IF-THEN function:

However, we can test the other way around using the function:

Note: Always insert double quotation marks when stating your text parameters.

IF-THEN statements are case-insensitive unless otherwise stated.

### Writing IF-THEN Functions for Numbers

You must know the basic Excel operators and their signs before writing IF-THEN statements in Excel for numbers. Here’s a guide to Excel that will help you learn the basic Excel formulas, operators, and more.

Follow these steps.

**Step 1:** Click on the cell box where you want to insert the function.

**Step 2: **Write the “equal” (=) sign.

**Step 3:** Start writing the if statement, along with the conditions for the test and the responses to be returned.

**Step 4: **After writing the if statement, click enter. Your formula should look like this:

- IF(B2>=50, “Passed”, “Failed”)

Using the function above, we can write an IF-THEN statement to check if a student passed or failed a course. Here’s an example:

This function sets a condition to test if cell B2 contains an integer value greater than or equal to 50. If this condition is met, the program will return a response of “Passed” and a “Failed” response if the condition isn’t met.

**Note: **IF-THEN functions do not only work for integers. They can also work for real numbers and negative numbers.

### Writing IF-THEN functions for dates

One of the unique forms of writing IF-THEN functions is the date format. Many people may think they can write IF-THEN functions for dates like they write IF-THEN functions for numbers.

Unfortunately, that is not so.

Since the Excel program cannot read the regular date format of mm/dd/yyyy, you’ll have to insert the “DATEVALUE” function into your IF-THEN function to make the Excel program know that you’re testing a date condition.

Your function should look like this:

- IF(B2>=DATEVALUE(“mm/dd/yyyy”), “yes,” “no”)

Here’s a step-by-step procedure on how to use this in your spreadsheet:

**Step 1: **In your spreadsheet, click on the cell where you want to input the function.

**Step 2: **Write the “equal” (=) sign.

**Step 3:** Start writing the if function. Your syntax should look something like this:

**Step 4:** Click Enter on your keyboard, and the function will return a status response of either “Released” or “Unreleased.”

The function above tests whether the date in cell B2 is greater than the 11th of April 2023. The function will give a “Released” or “Unreleased” response depending on whether the conditions are met or not.

**Note:** You can set the IF-THEN function to compare against the current date by inputting the TODAY() function into your IF-THEN function.

This is what your function should look like:

- IF(B2>TODAY(), “Released”, “Unreleased”)

### Writing IF-THEN Functions for Multiple Conditions (Nested IF statements)

Multiple IF-THEN statements or Nested if statements, as commonly called, allow you to add multiple if statements into one if statement.

A Nested if statement will look like this:

- IF(logical_test, [value_if_true], if(logical test, [value_if_true], if(logical test, [value_if_true], [value_if_false])))

If you wanted to write an IF-THEN function to assign remarks to scores of first-year students in a particular course. Here’s how to do this in a few steps:

**Step 1: **Click on the cell box where you want to insert the function

**Step 2: **Write the “equal” (=) sign.

**Step 3: **Begin writing the IF-THEN function. Your function should look something like this:

- IF(B2>90, “Excellent”, IF(B2>=80, “Very Good”, IF(B2>=70, “Good”, IF(B2>= 50, “Fair”, “Poor”))))

**Step 4: **Click the Enter key to receive a response to your function.

The function will return a response of “Excellent” for students who score 90 or above; “Very Good” for students who score between 79 and 90; “Good” for students who score 69 and 80; “Fair” for students who score between 49 and 70; and “Fair” for students that score below 50.

## Best Practices for IF-THEN Statements in Excel

Here are some practices to follow to get the best out of your IF-THEN functions in Excel.

### Always use parentheses.

### Use range instead of cells.

### Write out each section as its own formula.

### Never hesitate to use other formulas.

## Getting Started

So don’t hesitate to visit this guide anytime you face a problematic IF-THEN statement challenge.