Introduction
Because Microsoft Excel is not a programming environment, it doesn't use conditional statements seen in traditional languages such as C/C++, Pascal, C#, Visual Basic, etc. Instead, Microsoft Excel provides functions that can perform the same types of tests on cells' values and produce the same types of results
A logical function is one that evaluates an expression and returns a Boolean result. For example, imagine you have a series of cells that represent employees last name. If you are interested to know what cell doesn't have a value (a last name), you can use a function. On the other hand, imagine you have a cell that is supposed to indicate whether an item must receive a discount, you can use a conditional function to check it.
Most, if not all, logical functions check a condition and render a result. The condition is also called a criterion. A criterion can be something like "Check if the cell contains Male", or "Check if the salary is less than $12.35".
IF
To check whether a criterion is true or false before taking a subsequent action, you can use the IF() function. Its syntax is:
IF(ConditionToTest, WhatToDoIfConditionIsTrue, WhatToDoIfConditionIsFalse)
When it is called, the IF() function checks the truthfulness or negativity of the ConditionToTestargument. If the result is true, then it will execute the first expression, WhatToDoIfConditionIsTrue in our syntax. If the result is false, it will consider the second option, the WhatToDoIfConditionIsFalse parameter in our syntax.
Nested IF
The IF() function we have introduced above is used to check one condition and then take one or the other action. In some cases, you will need to check more than one condition. In other words, you may want to check a first condition. If that condition is false, you may want to yet check another condition. The pseudocode used for such a scenario is:
If Condition1 is True 

Execute Statement1 

Else If Condition2 is True 

Execute Statement2 

Else 

Execute ElseStatement 
Consequently, you can check as many conditions as you need to. The truthfulness of each condition would lead to its own statement. If none of the conditions is true, then you can execute the last statement. To implement this scenario, you can include an IF() function inside of another. You can also include as many IF() functions inside of other IF() functions.
We are going to use the IF() function to find out whether a student passes the mark or fails the class, based on the overall average of the student's grades. We will set the mark at 12.50. If a student's average is above 12.50, then he goes to the next grade, otherwise, …
Practical Learning: Using the IF Functions
Checking For Cell Emptiness
To check whether a cell is empty, you can call the Boolean ISBLANK() function.
Conditional Counting
In some cases you will need to count the frequency of (the number of times that) a value repeat itself in a series of cells. For example, suppose you have a list of students recognized by their gender using a certain column. Provided the genders are, for example, Male or Female. You may be interested in knowing the number of boys. In this case you can count the number of occurrences of Male in the range of cells.
The count the number of occurrences of a value in a series, you can use the COUNTIF()function. Its syntax is
COUNTIF(Range, Criteria)
The functions include MDETERM, MINVERSE, MMULT, PRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, and SUMXMY2.