IF function is one of the most important function in Excel.
Life is full of conditions and decisions. The same option in Excel is fulfilled by the IF FUNCTION.
In this section, let us try to use IF with the TEXT and try to solve many problems.
The learning is best using the examples, so we will learn by discussing the examples.
EXAMPLE : USING IF FOR TEXT AND PERFORM FURTHER ACTION
Let us start with the simple example.
Suppose we have two columns. One column is having the values as YES and NO.
We will put the value PASS if the first column contains YES otherwise NO.
DECIDING FACTOR | DECISION |
YES | |
NO | |
YES | |
YES | |
NO | |
NO | |
We have to take the decision using the IF and checking the presence of TEXT in the first column.
STEPS TO USE IF FOR TEXT AND TAKE DECISION:
- Select the cell in the first decision cell and write the function as =IF(DECIDING FACTOR CELL=”YES”,”PASS”,”FAIL”).
- For our example, we have the deciding factor in E7 so our formula becomes IF(E7=”YES”,”PASS”,”FAIL”)
- The result came out as PASS which is correct.
- Now drag down the formula through the column.
- The result is shown in the picture.
TEXT ALWAYS GOES INSIDE “”. IF TEXT IS NOT INSIDE THE INVERTED COMMAS , IT’LL CREATE AN ERROR.