Difference makes the DIFFERENCE

**Categorised Menu List**

I believe no much introduction is required for IF statement, because, when we have to decide between two values, we use IF Condition or IF statement (Excel Usage).

eg: if you have a spreadsheet with total marks, and say for example, 50 marks is the cut-off mark, then we put a condition to check, if, that particular cell's value, is Greater than 50 or not, if it is greater than 50, the current cell content should be PASS else the current cell content should be FAIL. before, you continue, please consider to check the given examples, so that they may prepare you to learn the following content, in-fact it is good practice to study the questions first and then continue onto comprehension

When IF statement is used with Logical Operators, it is called Compound IF Statement.

Taking the same Marks example, Management want to concentrate more on the students who are on the border of pass mark of 50, so that a bit more concentration on these students will raise the pass percentage of the school, hence to get students whose marks are greater than 35 and less than 50,

then: Write the following statement, for students with marks between 35 and 50.

When an IF statement is used within another IF Statement, it is called Nested IF Statement. This can accommodate any number of conditions within another condition, including Logical operators.

Taking the same Marks example,

Now, the task is to Grade the students based on the marks in Col D (Total Marks). The classification would be as: students securing 75 marks and above are in Grade A, less than 25 marks are in Grade D, between 50 and 75 are with Grade B, between 25 and 50 are with Grade C.

As the situation demands, one can have any number of If statements required (Excel 2007 and later can contain up to 64 nesting levels, function can handle 30 arguments, which implies to testing 30 different conditions (in theory, I did not check)

The following examples can be used either in spreadsheet to check/validate the above given IF Statement, or can be used in programming...

- Check if the given number is greater than zero or less than zero.
- Check if the given number is Odd number or even number.
- Check, if the given number is prime numbe or not, display message accordingly.
- Check if the given alphabet is a vowel or consonant.
- Check if the given number is greater than 50, if greater than 50, check if it is greater than 75, if it is not greater than 50, check if that number is less than 25, if all fails, check if the given input is a number or not.
- Check if the given number is greater than zero or less than zero or equal to zero.
- In a set of three given numbers, which of them is greater than the rest, which of them is less than the rest.
- Check if the first letter of a given input is vowel.
- Check if given two number's sum is postive or negetive or equal to zero.
- Given three numbers, print them in asceding order.
- Given three numbers, also in descending order.
- For a given input, check if the number is divisible by 2 or 3 or 4.
- Check if the given year is a leap year.