This guide will teach you how to create a logical formula using IF statements in Microsoft Excel. The formula created will have the following syntax: =IF(condition1, value_if_true1, IF(condition2, value_if_true2, value_if_false2)).
Steps
Step 1. Open Microsoft Excel
You will find it in the macOS Applications folder or in the Windows start menu.
Step 2. Click Blank Document
If Excel has already opened a blank spreadsheet, skip this step. In this article, a blank document will be used for creating an example formula.
-
In the formula, it will be assumed that if the value of TO 1 is greater than
Step 5., a multiplication will be done by
Step 1.. If less than or equal
Step 5., the multiplication will be done by
Step 2..
- The final result of the formula will be written as follows: =IF(A1>5, A1*1, IF(A1<5, A1*2, A1*2))
Step 3. Type 2 in A1 and press ↵ Enter
Step 4. Double click on cell B1
This is where the example formula will be inserted.
Step 5. Type =IF(in the cell
This will start the formula.
Step 6. Enter the first condition followed by a comma
This is the first test being performed.
-
In the example, a certain action must take place if the value of TO 1 is greater than
Step 5.. type it A1>5,.
-
The formula will now contain =IF(A1>5, - in other words, " if the number in TO 1 is greater than
Step 5. ".
Step 7. Enter the desired result if the condition is true
This is the action you want to take place if the result of the first condition is true.
-
In the example, the value must be multiplied by
Step 1. if bigger than
Step 5.. type it A1*1.
-
The formula will now look like this: =IF(A1>5, A1*1. In other words, " if the value of TO 1 is greater than
Step 5., multiply the po value
Step 1. ".
Step 8. Type, (comma) and press the spacebar
The formula will now look like this: =IF(A1>5, A1*1,.
Step 9. Type SE(after the space
Now everything is ready to add the second part of the formula.
Step 10. Enter the second condition followed by a comma
This is the second test performed worth TO 1.
-
In the example, an action will be specified to take place if TO 1 is less than
Step 5.. type it A1<5.
- The formula will now be: =IF(A1>5, A1*1, IF*A1<5, .
Step 11. Enter the desired result if the condition is true, followed by a comma
This is the action that must take place if TO 1 is less than
Step 5
-
In the example, the value must be multiplied by
Step 2. if it is smaller than
Step 5.. type it A1*2.
- The formula will now look like this: =IF(A1>5, A1*1, IF(A1<5, A1*2, .
Step 12. Enter the desired result if the condition is false
As a greater or lesser operation is being performed, the only value that could be false would be
Step 5., since the search is for a value greater or less than
Step 5
-
In the example, the equal value should be multiplied by
Step 2.. type it A1*2.
-
The formula will now look like this: =IF(A1>5, A1*1, IF(A1>5, A1*2, A1*2. In other words, if the value of TO 1 is equal to
Step 5., the multiplication will be done by
Step 2..
Step 13. Type))
This ends both statements. IF, as each of them needs its own parenthesis to complete.
-
The formula will now look like this:
=IF(A1>5, A1*1, IF(A1<5, A1*2, A1*2))
Step 14. Press ↵ Enter
This runs the formula and displays the result in the cell. B1. The result of the example will be
Step 4. - as the value of TO 1 (what
Step 2.) is less than
Step 5., then it will have been multiplied by