How To Apply If In Excel

Use the IF function in Excel to easily run logical tests.

Using AND, OR and NOT with Conditional Formatting in Excel. In Excel, you can also use AND, OR and NOT to set Conditional Formatting criteria with the formula option. When you do this you can omit the IF function and use AND, OR and NOT on their own. In Excel, from the Home tab, click Conditional Formatting gt New Rule.

IF is a logical function and implies setting 3 arguments logical_test - The logical condition that you want to test. This will return either a TRUE or a FALSE value. value_if_true - optional The value or formula which will be used when logical_test is TRUE. value_if_false - optional The value or formula which will be used when logical_test is FALSE.

Open Excel and click Blank Document. This will create a new spreadsheet. If Excel has already opened to a blank spreadsheet, you can skip this step. Alternatively, open an existing Excel file if you already have a dataset you want to apply the IF function to.

How to use the IF Function in Excel. Download the example spreadsheet used to demonstrate the IF function in the upcoming section. Practice is the key to success! Download Now. Example 1 IF Function Basics. Our task is to find the students who could score 40 marks in the given exam. We will mark them as Passed or Failed based on their scores.

Use the IF function in combination with the AND function and the OR function and become an Excel expert. 1. For example, take a look at the IF function in cell D2 below. Explanation the AND function returns TRUE if the first score is greater than or equal to 60 and the second score is greater than or equal to 90, else it returns FALSE.

You can use the IF function in Excel to achieve this. Try this formula MAXA1 - B1, 0 Or, if you prefer using an IF statement, you can use IFA1 - B1 . 0, 0, A1 - B1 Both formulas will subtract the value in B1 from A1 and display 0 if the result is negative. Otherwise, it will show the actual result.

The maximum number of nested IF statements allowed in Excel is 64. Now, look at the following four examples of how to use nested IF statements in Excel. Example 1 Use Multiple IF Statements to Assign Letter Grades Based on Numeric Scores. Let's consider the following dataset showing some students' scores on a Math test.

Logical_test The first argument is a logical test which is a required argument. Value_if_true The second argument is the value you want to be returned by the IF function if the logical test turns true. It is an optional argument and can be omitted only if the value_if_false argument is supplied. Value_if_false The third argument is the value you want to be returned by the IF function if the

The Excel IF function performs a logical test and returns one result when the logical test returns TRUE and another when the logical test returns FALSE. For example, to quotpassquot scores above 70 IFA1gt70,quotPassquot,quotFailquot. More than one condition can be tested by nesting IF functions. The IF function can be combined with AND, OR, and NOT to create more advanced logical tests.