The best way to Use IF-THEN Statements in Excel

by | Jul 26, 2023 | Etcetera | 0 comments

To enjoy Excel completely, you’ll have to know how to use the IF-THEN function.

Download 10 Excel Templates for Marketers [Free Kit]

The IF-THEN is one in every of Excel’s most impressive functions, as you’ll be capable to use it to research wisdom, draw inferences and make alternatives beneath positive preset must haves. On the other hand what exactly are IF-THEN statements, and the way in which can you get began the use of them?

In this knowledge, we’ll show you use IF-THEN statements to strengthen your mastery of Excel.

Table of Contents

What are IF-THEN Statements in Excel?

IF-THEN statements are functions in Excel that return a novel set of actions after your preset state of affairs is met.

Simply put, whilst you use the “If” commentary, you’re atmosphere a state of affairs and educating Excel to perform a novel set of actions when your preset state of affairs is true and another when the location is faux.

To use the “If “ function in Excel, you get began by the use of writing the an identical sign (=), followed by the use of “if,” then your state of affairs, and a two-part syntax educating the program on what to do when your must haves are or aren’t met.

The syntax in most cases turns out like this:

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

writing if then statements in excel, if then statements in excel with text

The “If” function is at hand, specifically you probably have a large wisdom amount and need to keep away from the stress of computing components for every wisdom. Proper right here’s an example of how simple it’s to use IF-THEN statements in Excel:

In this example, I’ve a spreadsheet containing 3 columns of data. Where column A comprises name wisdom, and columns B and C, include integer wisdom.

The usage of the If function, I set a state of affairs the use of the syntax:

  • =IF(B1>C1, “positive,” “no”)

This function initiates a command telling the Excel program to test if the data value in cellular B1 is larger than the data value in cellular C1.

I’ve simply advised Excel to offer me a response of “positive” beneath the location that the cost of cellular B1 is larger than cellular C1 and a response of “no” beneath the location that the cost of cellular B1 is not up to the cost of cellular C1.

I then extended this function to the other respective cells the use of a simple autofill trick. Check out our knowledge on the usage of Excel like a professional for some helpful tricks to make your Excel experience easier.

It’s vital to note that the IF-THEN commentary only means that you can set a state of affairs for two variables. That suggests you’ll be capable to only set must haves at the side of, say, the data value in cells B1 and C1 or a state of affairs at the side of wisdom values in cellular B1 and a defined integer or text.

For instance, you’ll be capable to set a state of affairs educating Excel to return a response of “Positive” if the cost in cellular B1 is larger than the cost of cellular B2 as confirmed inside the example above. Or, you’ll be capable to set a state of affairs asking Excel to return the response ”positive” or “no” if the cost of cellular B1 is larger or not up to 1000.

Proper right here’s a handy guide a rough example:

writing if then statements in excel, if then statements in excel with text

Proper right here, I instructed Excel to return the response “positive” if the data value in cellular C1 is larger than 5000 and “no” if the cost is not up to 5000.

See also  Methods to Repair WordPress Nav Menu Showing Underneath Admin Bar

Proper right here’s the response Excel returned:

writing if then statements in excel, if then statements in excel with text

As mentioned earlier, the IF-THEN commentary is an excellent Excel function with a large number of benefits. Learning to use this function appropriately will astronomically building up your mastery of Excel.

The Benefits of IF-THEN Statements In Excel

Listed below are some benefits that IF-THEN statements in Excel can provide you with:

Checking for Errors in Wisdom

You’ll use IF-THEN statements to check for errors when inputting wisdom into the spreadsheet.

For instance, in case you are feeling such as you’ve made a mistake by the use of inputting a number as an alternative of a text into your spreadsheet, you’ll be ready to try the use of an if function:

  • IF(B1 = “”, “Text”, “Amount”)

Calculating Debt Schedule or Depreciation Schedule

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

The usage of the IF-THEN commentary, you’ll be capable to set must haves asking the program to return a response for months with exceptional balances and even draw up a reimbursement schedule.

For Budgeting

As a financial analyst, the use of IF-THEN statements would make budgeting easier. IF-THEN functions will will will let you create up to 64 must haves, which is able to have the same opinion you to your budgeting process.

To Get ready Wisdom

The primary ability of IF-THEN statements is atmosphere instructions beneath positive must haves. Thus it’s easy to prepare wisdom to your spreadsheet beneath positive must haves the use of if statements.

You’ll set must haves for a decided on cellular box or a couple of cells and get ready your spreadsheet wisdom beneath discussed must haves.

Works Well With Other Components

An exhilarating good thing about IF-THEN statements is their flexibility. On account of its flexibility, you’ll be capable to use IF-THEN statements with other components in Excel.

For instance, you’ll be capable to use it with the DATEVALUE() function, the SUM() function, or even the COUNT() function.

One of the best ways to Use IF-THEN Statements in Excel

Now that what an IF-THEN commentary is and how it can benefit you, the next move is working out use it appropriately.

There are two how you can use the function, and we’ll get began with the basics. First, proper right here’s a simple step-by-step procedure for writing IF-THEN statements in Excel.

Step 1: Click on on on the cellular you wish to have to format, say cellular A1.

Step 2: Write the IF-THEN function components straight away into the cellular box.

writing if then statements in excel, if then statements in excel with text

Or inside the components box. writing if then statements in excel, if then statements in excel with text

Step 3: Get started writing your must haves and expected responses to discussed must haves.

writing if then statements in excel, if then statements in excel with text

Take note: All the time get began the components with an “an identical” sign and input the correct punctuation in order that you don’t get an error message after inputting the function.

Proper right here’s another step-by-step you’ll be capable to use.

Selection Step 1: Click on on on the “Components” tab inside the taskbar menu of your Excel program.

writing if then statements in excel, if then statements in excel with text

Selection Step 2: Click on on on the “Insert Function” selection, which will free up a dialog menu:

 writing if then statements in excel, if then statements in excel with text

Selection Step 3: Select “IF” from the tick list of alternatives inside the dialog menu and click on on “OK.” It’ll free up a dialog box.

writing if then statements in excel, if then statements in excel with text

Selection Step 4: Throughout the dialog box, input your state of affairs and instructions telling the program what answers to return when the location is met and when it isn’t met.

writing if then statements in excel, if then statements in excel with text

Apply: It’s upper to use the “Insert Function” means in case you’re writing a simple IF-THEN function, as it launches a components builder that will help you do away with the dangers of errors when inputting your components.

The program will automatically input the correct punctuations and formats and only require you to go into your must haves and instructions inside the 3 fields of the dialog box.

Now that you know how initially the IF-THEN function, let’s evaluate the other use cases for if functions.

Writing IF-THEN Function for texts

writing if then statements in excel, if then statements in excel with text

IF-THEN functions for texts are commonplace IF-THEN functions, then again in this case, the function tests for a string of text and then returns a preset response depending on whether or not or no longer the location is fulfilled.

See also  What are ISVs? [Examples, Benefits, and More]

The usage of the IF-THEN function is reasonably simple, and we’ve touched on it a few circumstances inside the examples so far. On the other hand, proper right here’s a step-by-step procedure for writing IF-THEN statements in Excel with text.

Step 1: Click on on on the cellular box where you wish to have to insert the function.

Step 2: Write the “an identical” (=) sign.

Step 3: Get began writing the if commentary, at the side of the must haves for the check out and the responses to be returned.

Step 4: After writing the if commentary, click on on enter.

Proper right here’s an example showing generate a observation mentioning who passed or failed a course for a first-year magnificence the use of IF-THEN statements in Excel with text:

In this example, the use of the IF-THEN function:

  • If(B2 = “Transfer,” “Scored above 50”, “Didn’t ranking above 50”)

The program was asked to return a response of “Scored above 50” or “Didn’t ranking above 50” if the string of text in cellular B2 is equal to “Transfer.”

On the other hand, we will check out the wrong way spherical the use of the function:

  • If(B2 “Transfer,” “Scored above 50”, “Didn’t ranking above 50”)

The program was asked to return a response of “Scored above 50” or “Didn’t ranking above 50” if the string of text in cellular B2 isn’t an identical to “Transfer.”

Apply: All the time insert double quotation marks when mentioning your text parameters.

IF-THEN statements are case-insensitive till another way stated.

To make an IF-THEN commentary case-sensitive, you’ll have to precede your state of affairs parameters with the word “EXACT.” The usage of the example above, Excel will check out for uppercase text with this components:

  • IF(EXACT(B2, “PASSED”), “Scored above 50”, “Didn’t ranking above 50”)

Writing IF-THEN Functions for Numbers

You’ll have to know the basic Excel operators and their signs previous than writing IF-THEN statements in Excel for numbers. Proper right here’s a knowledge to Excel that will help you be informed the fundamental Excel formulation, operators, and extra.

Follow the ones steps.

Step 1: Click on on on the cellular box where you wish to have to insert the function.

Step 2: Write the “an identical” (=) sign.

Step 3: Get began writing the if commentary, at the side of the must haves for the check out and the responses to be returned.

Step 4: After writing the if commentary, click on on enter. Your components should seem to be this:

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

The usage of the function above, we will write an IF-THEN commentary to check if a student passed or failed a course. Proper right here’s an example:

writing if then statements in excel, if then statements in excel with text

This function gadgets a state of affairs to test if cellular B2 comprises an integer value greater than or an identical to 50. If this case is met, the program will return a response of “Passed” and a “Failed” response if the location isn’t met.

Apply: IF-THEN functions don’t only art work for integers. They can moreover art work for exact numbers and harmful numbers.

Writing IF-THEN functions for dates

One of the crucial unique kinds of writing IF-THEN functions is the date format. Many people would possibly assume they are able to write IF-THEN functions for dates like they write IF-THEN functions for numbers.

Unfortunately, that isn’t so.

For the reason that Excel program cannot be told the average date format of mm/dd/yyyy, you’ll should insert the “DATEVALUE” function into your IF-THEN function to make the Excel program know that you simply’re testing a date state of affairs.

Your function should seem to be this:

  • IF(B2>=DATEVALUE(“mm/dd/yyyy”), “positive,” “no”)

Proper right here’s a step-by-step procedure on use this to your spreadsheet:

Step 1: In your spreadsheet, click on on on the cellular where you wish to have to go into the function.

Step 2: Write the “an identical” (=) sign.

Step 3: Get began writing the if function. Your syntax should look something like this:

writing if then statements in excel, if then statements in excel with text

Step 4: Click on on Enter to your keyboard, and the function will return a status response of each “Introduced” or “Unreleased.”

writing if then statements in excel, if then statements in excel with text

The function above tests whether or not or no longer the date in cellular B2 is larger than the 11th of April 2023. The function will give a “Introduced” or “Unreleased” response depending on whether or not or no longer the must haves are met or now not.

See also  What’s an E mail Blast? And The best way to Ship an E mail Blast for Absolute best Effects

Apply: You’ll set the IF-THEN function to test in opposition to the current date by the use of inputting the TODAY() function into your IF-THEN function.

That’s what your function should seem to be:

  • IF(B2>TODAY(), “Introduced”, “Unreleased”)

Writing IF-THEN Functions for Multiple Prerequisites (Nested IF statements)

Multiple IF-THEN statements or Nested if statements, as normally referred to as, will will let you add a couple of if statements into one if commentary.

A Nested if commentary will seem to be this:

  • IF(logical_test, [value_if_true], if(logical check out, [value_if_true], if(logical check out, [value_if_true], [value_if_false])))

For many who wanted to write an IF-THEN function to assign remarks to ratings of first-year students in a decided on course. Proper right here’s how to do this in a few steps:

Step 1: Click on on on the cellular box where you wish to have to insert the function

Step 2: Write the “an identical” (=) sign.

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

  • IF(B2>90, “Superb”, IF(B2>=80, “Very Very good”, IF(B2>=70, “Very good”, IF(B2>= 50, “Honest”, “Poor”))))

writing if then statements in excel, if then statements in excel with text

Step 4: Click on at the Enter key to procure a response to your function.

The function will return a response of “Superb” for students who ranking 90 or above; “Very Very good” for students who ranking between 79 and 90; “Very good” for students who ranking 69 and 80; “Honest” for students who ranking between 49 and 70; and “Honest” for students that ranking below 50.

Easiest Practices for IF-THEN Statements in Excel

Listed below are some practices to use to get the best out of your IF-THEN functions in Excel.

All the time use parentheses.

One of the simplest ways to keep away from errors to your components in Excel is by the use of the use of parentheses. Therefore, if you wish to have your if commentary to function appropriately, you should definitely use parentheses correctly.

For instance, when writing a couple of conditionals or a nested if commentary, you should definitely use parentheses in the correct places to keep away from “#NAME?” errors.

Use range as an alternative of cells.

Whilst you use Range as an alternative of Cells, you’ll be capable to keep away from errors bobbing up when cellular wisdom changes or your components should be adjusted.

Write out every section as its private components.

It is going to sound unnecessary, then again writing every spreadsheet section as its private components would make your wisdom additional readable and easier to take hold of.

Every other benefit to doing this is that you just’ll be capable to find the whole thing you want in one place and edit it in line with your needs.

A lot more, if there’s an error at the side of your function, writing every section as its private components makes it easier so that you could debug and find any errors to your components.

Certainly not hesitate to use other components.

One fantastic issue about Excel is that it means that you can use a couple of functions by the use of hanging them into one another.

Like other components in Excel, you’ll be capable to insert other functions into your IF-THEN function to get the best out of it.

The usage of your IF-THEN function alongside other components makes it easier to make calculations, saves time (specifically whilst you’re working with large wisdom), and makes it easy to spot any errors.

Getting Started

IF-THEN statements are positive to make your life easier. Despite the fact that it may be difficult to snatch the whole thing at once, you’ll find it easy with constant follow and secure use.

So don’t hesitate to talk about with this knowledge anytime you face a problematic IF-THEN commentary downside.

excel graph templates

WordPress SEO

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!