IF statement (Function) has the syntax if(logical text, value if true, value if false)
As any other logical statement if tests if a given condition is met and then assigns the a given value if the condition is met and a different value if the condition is not met.
A good example wood be if a student has reached a given pass mark or not as a logical test. The the value if true would be passed and if not true would be failed.
Have an excel worksheet with some values as shown below
click a cell where we want our results of the test to be and type = followed by if and then a opening bracket as shown below.
Then click the cell containing the data that we want to test then the greater than sign “>” then “50” then put a comma(,) followed by the string “Passed” followed by another comma(,) then the string “Failed”
Close the brackets and enter for your formula to take effect.
Auto fill your formula in the other cells below
NOTE: A string must be inside opening and closing quotes
We can now move to other tutorials