|
|
Welcome
to Excelling with Excel 2007
Working Smarter
IF statements
this page may load slowly, there are lots and lots of diagrams
there are assignment with this -
email me for the assignments
What are IF statements and where are they used?
IF statements are logical statements. They are often used when certain
conditions must be met. An example could be: a bonus is given to salespeople
selling more than $1000 worth of products. IF statements
compare the sales of each person and enters the bonus earned.
IF statements are written this way: =if(A1>=1000,4%,"")
- =if(
begins the IF statement
- then
comes the condition - say $1000 is the amount of sales needed to earn
a bonus, the IF statement would
now look like this =if(A1>=1000
- here
you are saying IF the number in A1 is greater than or equal to 1000
- BIG
TIP - do not use commas in numbers - commas tell the IF statement
that you are ready to move on
- now,
you want the IF statement to give a bonus of 4% if the sales are $1000
or more, SO the IF statement
would read =if(A1>=1000,4%
- note
the comma, the comma reads then. The statement reads this way so far:
if A1 is greater than or equal to $1000 THEN the person will receive
a 4% bonus
- to finish
the IF statement you have to let Excel know what happens if the number
is less than $1000
- SO, you
put a comma after 4%, this tells Excel then =if(A1>=1000,4%,
- And lastly
you can either do one of the following "" means leave the
cell blank, 0 would tell Excel to put a zero in the cell
- the formula
now looks like this: =if(A1>=1000,4%,""
- You finish
the IF statement with an ending parenthesis )
- The finished
IF statement looks like this: =if(A1>=1000,4%,''")
- You have
keyed in an IF statement
Diagram1:
Diagram 2:
Diagram 3:
Email me for more examples of how to do IF statements - I would do
this.
You can also use the paste function icon to do IF statements.
Let's do
the same example where we want Excel to tell us whether the number in
a cell is "four". And, if it is not a four Excel will say "not
a four"
The steps:
- click
on the cell where the answer will be displayed
- either
select the fx icon or go to the FORMULAS tab and select Insert Function
- a box
appears - look to the left and select logical
- then
look to the right and select IF
- click
OK
- another
box appears
- in the
first blank - the logical test - click on the cell that has the data
and then KEY IN what you want to have happen
- example:
A1=4 (here you clicked on cell A1 and keyed in =4)
- in the
next blank, key in what you want to have Excel do if this is true
- example:
we want Excel to say four, SO we key in "four"
- in the
next blank, key in what you want to have Excel do if it is not true
- example:
we want Excel to say not a four, SO we key in "not a four"
- click
OK and the formula is done
Diagram:

Now you can email me for
the assignments. And, for fun, you are now ready for charts.
|