If-Then-Else-Nested If commands in MS Excel

If-Then-Else-Nested If commands

You can produce different set of results based on slabs, conditions, stages etc. It requires logical understating not any programming skills.

What is the IF Function

Excel’s IF function is one of simplest and most useful spreadsheet functions. It can fill cell fields for you based on evaluating a condition.

Syntax

IF(logical_test, value_if_false, value_if_true)

The thing to note here is the three items between the round brackets of the word IF. These are the arguments that the IF function needs. Here’s what they mean:

logical_test

The first argument is what you want to test for. Is the number in the cell greater than 80, for example?

value_if_true

This is what you want to do if the answer to the first argument is YES. (Award an A grade, for example)

value_if_false

This is what you want to do if the answer to the first argument is NO. (Award a FAIL grade.)

If that’s not terribly clear, an example may clear things up. Open a new spreadsheet, and do the following:

  • Widen the B column a bit, as we’ll be putting a message in cell B1
  • Now click in cell A1 and type the number 6
  • Type the following in the formula bar (The right angle bracket after A1 means “Greater Than”.)

 

If within if conditions are called nested if condition