If only this is x, then it’s y. Things always have conditions – you can have this on the condition that / if you do that. That’s essentially what IF statements mean. There are many IF statements – IFERROR, SUMIF/S, COUNTIF/S, AVERAGEIF/S… (all which I’ll cover in future posts). IF statements are so useful for categorizing and summarizing.
Excel Formula = IF(logical_test, [value_if_true], [value_if_false])
Formula Made Easy:
|logical_test||What do I want to test & what are my conditions|
|value_if_true||What do I want if the result is true|
|value_if_false||What do I want if the result is false|
I have a list of customers with their titles: Mr, Mrs & Miss and I want to know their gender.
Formula Applied = IF(A2=”Mr”,”Male”,”Female”)
Description: If cell A2 said “Mr”, then the gender should be “Male”, otherwise “Female”
- Instead of having to copy and paste the function (formula) down, if you click the black cross when you hover your mouse to the bottom right-hand corner of the cell, the rest of the column will populate.
The above example is pretty straightforward as there is only one “male gender” condition being “Mr”. What happens if there were more than one, i.e. “Mr” and “Sir” or if I reversed the formula around such that: If cell A3 said Mrs or Miss, then the gender should be “Female”, otherwise “Male”?
It becomes a little bit more complicated but possible :). In these instances it’s called