Latest posts by techwriter (see all)
- Test Your Knowledge of 4 Basic Fonts – Drag & Drop - January 27, 2017
- How NOT to Design a Web Site - January 25, 2017
- Hazards of Poorly Written Technical Documentation - December 26, 2016
By Chris Le Roy
The IF function in Microsoft Excel seems to really cause many people a lot of heartache and grief, but all in all it is actually really not that difficult of a tool to use. The essential role of the IF function is to test whether a condition is either True or False and if the condition is True it will return one value and if it is False it will return an alternate value.
Let us look at an example –
Let us say you have two values. In one cell you have a value of 65 and in the other cell you have a value of 23. What the IF function allows us to do is to do a test and lets say we want to see if the value of 65 is greater than 23. When the numbers are plugged into the If statement, the result will be that 65 is greater than 23 and it will return something from the True return area.
So how do we create an if statement…
The secret to the IF function is really in its syntax. The syntax for the IF function is as follows –
IF(Logical Test, True Result, False Result)
What we can do is to now create the example we did earlier so begin by simply opening a Microsoft Excel Work sheet. In cell address A1 enter the text IF Test Condition. In cell A2 enter the text – Numeric Value 1, in A3 enter the text – Numeric Value 2, and in cell A5 enter the text Which Value is Larger?
Now we need to put a few numbers to test into our Excel Spreadsheet, so in cell address B2 enter the value of 65 and in cell address B3 enter the value of 23. In cell B5 we need to create our formula. If we use the example above we want to find out if the value in B2 is greater than the value in B3. If the condition is true we want to return the text – Numeric Value 1 and if the condition is false we want to return the text – Numeric Value 2.
The structure of the IF Function to do the test will look like this –
= IF(B2>B3, “Numeric Value 1″,”Numeric Value 2”)
What you will notice in the function above is that the text values are encapsulated in double quotes. Whenever working with text in Formulas the text must always have double quotes around it. If you type in the formula above into cell address B5 you should see the resulting text – Numeric Value 1. If you change the value in B2 now to 12, the automatic result in B5 should be – Numeric Value 2.
The IF function is a really diverse tool and it allows you to test an unlimited number of conditions to get the required outcome, you can even nest IF functions within IF functions but the bottom line is this, for every IF function the syntax should always look the same as above.
Chris Le Roy has available Microsoft Excel Shortcuts to help you with Microsoft Excel. To learn more about the IF Function simply check our Chris’s correspondence course where you can earn yourself Microsoft Excel Certificates issued by his company without even leaving home – Microsoft Excel Spreadsheet Training
Tips on Microsoft Excel are also Available.