Lesson 25 : IF function




The IF function is one of the most popular functions in Excel, and it allows you to make logical comparisons between a value and what you expect. In its simplest form, the IF function says:


IF(condition or logical test , then do something, otherwise do something else)

So an IF statement can have two results. The first result is if your comparison is True, the second if your comparison is False

Example : 


 we have values in column C and we want to use IF function to check for number 1 in column E  and if we find number 1 the result should be True and if the number is not 1 then the result will be False 

So we starting with equal sign as we said before in cell E1 then we write IF and open a bracket 
the structure of the function IF appear as it seen in the image the function consist of 

Logical test   : the value or function we will make test on in our example is C1=1 
value if true  : the result of function when C1=1 , which we choose to be True 
value if false : the result of function when C1 not equal 1 , which we choose to be False

we seprate every part of the function with comma ','


so the function should be :




=if(c1=1,True,False)

the result will be True as the C1 contain 1 

then we click and drag the function as we illustrate before to E5



* you can change the True or False with other value as we will see in next lessons 


Comments