

The syntax for the IF function is =IF. This lets Excel know that it is an IF function. Logical operators are easy to useespecially when youve seen how they work with different types of numbers.Īnd theyre even more useful when combined with the IF function.The IF function helps to determine what will be displayed to those who view your worksheets in Excel. Because of its purpose, it's one of the most important functions you will learn. IF functions can be used to add comments to your data. They can also be used to hide errors in calculations.ĭisplaying formulas from one cell in another Kasper Langmann, Co-founder of Spreadsheeto Wrapping things up Try writing your own IF function that finds a false condition and displays the value_if_false using the example workbook! If that condition had been false, it would have displayed value_if_false, the second string in the formula. The IF function checked to see whether the logical condition (A7>B7) was true (it was), and then displayed the value_if_true. And because of that, we get FALSE.Īnd less than or equal to (=) and less than or equal to (B7, The first value is greater, The second value is greater)Īfter you hit Enter, youll see the text The first value is greater. Z is later in the alphabet than R, so the second word is considered to be larger. When Excel compares the first two letters, theyre the same, so it moves onto the next letter.

Lets see what happens when we compare the words Arctos and Azimuth with this operator. Excel doesnt look at the formula: only the values. This resolves to TRUE, because the value in cell A9 is larger than the value in B9. =A2>SUM(B1:B4) Greater than (>) and less than () and less than (B9 But you can also use formulas in these operators.įor example, you could use something like this:

In our examples, were comparing simple values.
#How to do a if then formula in excel pro#
Pro tip: logical operators can take formulas as arguments. Kasper Langmann, Co-founder of Spreadsheeto Spoiler: youll get the same results as before, because these operators compare values, and not formulas. Try using these two operators on those cells. The next two rows both contain values that werent entered directly, but were created by formulas. This row contains text, but the operator will work just as well as it would if we were comparing numbers.Īgain, we get TRUE, because Blue and Red arent identical. Lets try the not equal to operator in the next row. This operator resolves to TRUE, because 1 and 1 are identical. Keep in mind that these operators work with text well see how in just a moment.įirst, well try out the equal to operator. The not equal to operatorreturns FALSE if the two values are identical, and TRUE otherwise. The equal to operator returns TRUE if the two values being compared are identical, and FALSE otherwise. The equal to (=) and not equal to () operators These operators are simple: they tell you whether two values are equal or not equal to each other. Got a different version? No problem, you can still follow the exact same steps.Ĥ: Greater than (>) and less than (=) and less than or equal to () *This tutorial is for Excel 2019/Microsoft 365 (for Windows).
:max_bytes(150000):strip_icc()/nested-if-functions-excel-0521ba9a37704ff88becee56543316b4.png)
Lets take a look at each one of these operators, and then see how you can use them with the IF function. These comparison operators return a TRUE or FALSE value that can be used with logical functions to give you even more options. Statements like greater than, less than or equal to, and not equal to can be very useful when youre analyzing data. Most of the operators you use in Excel are probably mathematical, like +, -, *, and /.īut theres another set of useful operators: the logical operators. Written by co-founder Kasper Langmann, Microsoft Office Specialist. Equal to, Not equal to, Greater than, Less than (+much more)
