9 Chapter 9

This week we will be discussing the IF formula.

The IF formula is quite complex, so you’ll get lots of practice with it. Let’s break down what the IF formula is and what it looks like:

=IF(COMPARISON,TRUE,FALSE)

Like all formulas you’ll start with =IF and a starting bracket.

Then you’ll put in a comparison. For example, lets we are looking to see if cell B2 is bigger than cell B3. We’d want to put in B3>C3. There are some important operators you’ll need to understand for this comparison:

‘>’ means Bigger than – ie., cell 1 (B3) is bigger than cell 2 (C3)
‘<‘ means Less than – ie., cell 1 (B3) is smaller than cell 2 (C3)
‘=’ means Equal to – ie., cell 1 (B3) is equal to cell 2 (C3)
‘<>’ means Not Equal ie., cell 1 (B3) is not equal to cell 2 (C3)
There are other operators, but we won’t discuss those in a beginners course.

After the comparison you’ll want to put in what to do if the comparison is true. In the example above we are looking to see if cell B3 is bigger than cell C3. So if it is, we might type something like “Yes, Cell B3 is bigger than Cell C3”. The Cell will then display the quote we put in IF cell B3 is bigger than cell C3.

After the True part, you’ll want to put in what to do if the comparison is False. In the example above we are looking to see if cell B3 is bigger than cell C3. So if it isn’t, we might type something like “No, Cell B3 is not bigger than Cell C3”.

Let’s put this into practice.

  • Start by typing in the days of the week from Monday to Sunday in cells B1 through H1
  • Then type in the hours you worked each day in cells B2 through H2 (4,4,3,7,8,3,6)
  • We want to know if we worked more hours on Monday or Sunday
  • In cell J1 type ‘Did I work more hours Mon or Sun’
  • In cell J2 type =IF(B2>H2,”More Hours”,”Less Hours”)
  • Let’s break that formula down
    1. =IF( – this is the start of the if statement
    2. B2>H2 – this is looking to see if cell B2 is greater than cell H2
    3. “More Hours” – this will make the cell say ‘More Hours’ only if B2 is greater than H2
    4. “Less Hours” – this will make the cell say ‘Less Hours’ only if B2 is NOT greater than H2
  • In hour case it will say ‘Less Hours’ because (if you’ve put in the same hours as above) cell B2 says 4, and cell H2 says 6.
  • Try doing some of the following:
    1. Compare cell B2 to C2 using the = operator, if it’s true write “Equal”, if false write “Not Equal”
    2. Compare cell B2 to C2 using the > operator if it’s true write “Bigger”, if false write “Smaller”
      ** Note: this is a trick question of sorts. The two cells are equal, but because cell B2 is technically not bigger you’ll end up with “Smaller” written in the cell, despite the fact that the two are equal
    3. Compare cell E2 to F2 using the < operator and change the True / False text accordingly
  • Save the file as Hours.xlsx

 

License

Icon for the Creative Commons Attribution-NonCommercial 4.0 International License

Medical Office Software Copyright © by William Osbourne-Sorrell is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where otherwise noted.

Share This Book