In an If…Then…Else statement, one or more conditions are checked. If the condition is found to be True, the statements following the if statement are executed. If the condition is found to be False, each Else If statement (if any) is evaluated in order. When a True else-if condition is found, the statements immediately following the associated Else-If are executed. If there are no Else-If statements, the statements following Else are executed.
The IF condition is acommonly used function in Excel that you are likely to come across.It becomes important that you know how to write these statements.
You may also need to write a Nested IF statement which are complicated to look at, but are simple the moment you understand the concept.
A Nested IF statement will look like this:
=IF(“if this condition stated here is true”, then enter “this value, else if(“if this condition stated here is true”, then enter “this value, else enter “this value”))
Now lets understand the If function.
IF: Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
Logical test is the condition or a value that you want to test.
value_if_true is optional. It is the value that is returned if the condition is TRUE.
value_if_false is optional. It is the value that is returned if the condition is FALSE.
For example – We have marks in column A and we need to get the Grade in column B. The various grades are given below -
Lets take another Example of Nested if to understand more:
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.