IF...THEN...ELSE - always fascinated me since I first learned about IF statements back in the 1980's when I first learned programming. Logic is central to IF statements - that's why I like them. I always had fun writing them and testing then to see if they worked.
IF statements can be used in Excel as conditional statements. My latest video show Excel users how to write a basic IF statement. The syntax is quite simple:
IF(logical_test, "value_if_true", "value_if_false")
In the video I use the example of using an IF statement to check if a student score is a pass or a fail - the IF statement for this is as follows (assuming a pass mark of 40%):
IF(B2>=40, "Pass", "Fail")
where "B2" is the cell where the mark is located on the Excel spreadsheet. In this statement you are testing to see IF a value (the contents of cell B2) is greater than or equal to 40 - if this is True, then the word "Pass" is displayed. If this is not True, then the word "Fail" is displayed. So for example, if the value in cell B2 is 60, then this is greater than or equal to 40 - therefore the statement is True, while a value of 30 is not greater than or equal to 40 - therefore the statement is false. Check out the video on YouTube and see what you think: