How do you use an IF and function in Excel? 2022.

This informative article explains how to operate the IF-THEN function in Stick out for Microsoft 365, Stick out 2019, 2016, 2013, 2010 Stick out for Mac, and Stick out Online, additionally to a few examples.

Inputting IF-THEN in Stick out

The IF-THEN function in Stick out can be a effective approach to add selection for the spreadsheets. It tests an condition to determine if the simple truth is or false then performs a specific number of instructions using the results.

For example, by input an IF-THEN in Stick out, you can try in case your specific cell is much more than 900. Whether it’s, you possibly can make the formula return the writing “PERFECT.” Whether it’s not, you possibly can make the formula return “Not Large Enough.”

There are numerous conditions you’ll be able to go into the IF-THEN formula.

The IF-THEN function’s syntax includes the particular function as well as the function arguments inside the parenthesis.

This really is really the correct syntax in the IF-THEN function:

=IF(logic test,value if true,value if false)

The IF part of the function could be the logic test. This is where you employ comparison operators to check on two values.

The THEN part of the function uses the initial comma and includes two arguments separated having a comma.

The initial argument informs the part what direction to go once the comparison is true.

The second argument informs the part what direction to go once the comparison is fake.

A Simple IF-THEN Function Example

Prior to getting to more difficult calculations, let’s think about a straightforward instance of an IF-THEN statement.

Our spreadsheet is defined with cell B2 as $100. We could input the following formula into C2 to suggest when the value is larger than $1000.

  • =IF(B2>1000,”PERFECT”,”Not Large Enough”)
  • This function gets the following arguments:
  • B2>1000 tests when the value in cell B2 is larger than 1000.
  • “PERFECT” returns the word PERFECT in cell C2 if B2 is larger than 1000.
  • “Not Large Enough” returns the old saying Not Large Enough in cell C2 if B2 is not larger than 1000.
  • The comparison part of the function compares 3 values. Either of people two values might be:
  • Fixed number
  • A string of figures (text value)
  • Date or time
  • Functions that return the above
  • A reference on a vacation cell inside the spreadsheet which contains these values

The Actual or FALSE part of the function might also return these. Meaning you possibly can make the IF-THEN function very advanced by embedding additional calculations or functions there (see below).

When inputting true or false conditions from the IF-THEN statement in Stick out, you should employ speech marks around any text you have to return, unless of course obviously you use TRUE and FALSE, which Stick out instantly recognizes. Other values and formulas don’t require speech marks.

Inputting Calculations To the IF-THEN Function

You’ll be able to embed different calculations for your IF-THEN function to complete, with regards to the comparison results.

  • In this particular example, one calculation may be used to calculate the tax owed, with regards to the total earnings in B2.
  • The logic test compares total earnings in B2 to determine if it’s greater than $50,000.00.
  • =IF(B2>50000,B2*.15,B2*.10)
  • In this particular example, B2 is not larger than 50,000, and so the “value_if_false” condition will calculate and return that result.
  • In this particular situation, that’s B2*.10, that’s 4000.
  • It seems sensible put in cell C2, where the IF-THEN function is positioned, will probably be 4000.
  • You may even embed calculations to the comparison side in the function.

For example, if you want to estimate that taxed salary is only 80% of total earnings, you are able to affect the above IF-THEN function for the following.

  • =IF(B2*.8>50000,B2*.15,B2*.10)
  • This could perform calculation on B2 before evaluating it to 50,000.
  • Never enter a comma when entering figures inside the thousands. For the reason that Stick out interprets a comma since the finish from the argument inside a function.
  • Among embedding calculations inside an IF-THEN function in Stick out.
  • Nesting Functions Inside an IF-THEN Function
  • You may even embed (or “nest”) the reason inside an IF-THEN function.
  • This allows you to perform advanced calculations then compare the specific results in the expected results.

In this particular example, let’s for those who have a spreadsheet with five students’ grades in column B. You are able to average individuals grades while using the AVERAGE function. With regards to the class average results, you may have cell C2 return either “Excellent!” or “Needs Work.”

This is one way you’d input when-THEN function:

  • =IF(AVERAGE(B2:B6)>85,”Excellent!”,”Needs Work”)
  • This function returns the writing “Excellent!” in cell C2 once the class average is finished 85. Otherwise, it returns “Needs Work.”
  • As you have seen, inputting the IF-THEN function in Stick out with embedded calculations or functions allows you to certainly create dynamic and highly functional spreadsheets.
  • Embedding other functions inside a IF-THEN function in Stick out.

Was this website helpful?