Excel Spreadsheets If statements

918 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
918
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Excel Spreadsheets If statements

  1. 1. What is an IF statement? <ul><li>IF(Logical_test , value_if_true , value_if_false) </li></ul><ul><li>A statement that checks the contents of a cell against a given expression. If the expression is TRUE the first value is returned. If the expression is FALSE the second value is returned. </li></ul>
  2. 2. Examples of IF Statements
  3. 3. Example 1 <ul><li>=IF(A3=A1+A2, “Correct”, “Wrong”) </li></ul><ul><li>The Logical_test is A3=A1+A2 i.e. does cell A3 equal cell A1 plus cell A2? </li></ul><ul><li>The Value_if_true is “Correct” i.e. if cell A3 equals cell A1 plus cell A2 display “Correct” </li></ul><ul><li>The Value_if_false is “Wrong” i.e. if cell A3 does NOT equal cell A1 plus cell A2 display “Wrong” </li></ul>Go to Pg 2
  4. 4. Example 2 <ul><li>=IF(A1>A2, “A1 is bigger than A2” , “A2 is bigger than A1”) </li></ul><ul><li>The Logical_test is A1>A2 i.e. is cell A1 bigger than cell A2? </li></ul><ul><li>The Value_if_true is “A1 is bigger than A2” </li></ul><ul><li>The Value_if_false is “A2 is bigger than A1” </li></ul>Go to Pg 2
  5. 5. Example 3 <ul><li>=IF( AND( ISBLANK(C1), ISBLANK(C2), ISBLANK(C3) ) , “This column is empty” , “This column is not empty” ) </li></ul><ul><li>The Logical_test is AND( ISBLANK(C1), ISBLANK(C2), ISBLANK(C3) ) i.e. Is cell C1 AND C2 AND C3 empty? </li></ul><ul><li>The Value_if_true is “This column is empty” </li></ul><ul><li>The Value_if_false is “This column is not empty” </li></ul>Go to Pg 2
  6. 6. Example 4 <ul><li>=IF( OR( D1=7, D2=7, D3=7) , “There is a seven in this column” , “There is no seven in this column” ) </li></ul><ul><li>The Logical_test is OR( D1=7, D2=7, D3=7) </li></ul><ul><li>The Value_if_true is “There is a seven in this column” </li></ul><ul><li>The Value_if_false is “There is no seven in this column” </li></ul>Go to Pg 2
  7. 7. Example 5 <ul><li>=IF( AND( E1<=10, E1>=1) , E1 , “This number is too big”) </li></ul><ul><li>The Logical_test is AND( E1<=10, E1>=1) </li></ul><ul><li>The Value_if_true is E1 i.e. It displays the content of cell E1 </li></ul><ul><li>The Value_if_false is “This number is too big” </li></ul>Go to Pg 2
  8. 8. General Comments <ul><li>We are creating a formula, so we must start with an equals, = </li></ul><ul><li>Excel can be very fussy, so we should always double-check that our brackets and commas match up </li></ul><ul><li>Excel only accepts round brackets, ( ) </li></ul><ul><li>If we want to display text we must use speech marks, “ ” </li></ul>Go to Pg 2

×