Excel function IF

The IF function returns different data depending on whether the conditions specified are true or false.

Here is an example:

Under "Price", we want to display $21 for children (less than 16 years old) and $32 for everybody else.


To make this a little simpler, we're going to start out by renaming cells B9 and B10.

To do this, click on B9 (see image below), type in "adult" and press Enter.

renaming cells if
rename cell if

Do the same with cell B10 and type in "child".

rename cell2 if

Select cell C2, click on "Insert Function".

And now select the IF function.

insert function if

In the logical test field we want to ask whether a person's age is less than 16.

If this is true, the function should display the children's price. Otherwise, it should show the adult price.

if2 if

Here's what that should look like:

function if

Click OK.

The result will be displayed.

All we need to do is a single AutoFill command ...

if autofill

You can see the results here:

if3 if

Continue to the Nested IF page...