1 / 12

Conditionals

Conditionals. Belinda Kerchmar 3.1.11. Operators. What are the operators we discussed last time? This time -- Conditional Operators: IF SUMIF COUNTIF. IF in the real world. IF you get 8 hours of sleep THEN you’ll feel fresh in the morning ELSE you’ll feel tired in the morning

yestin
Download Presentation

Conditionals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Conditionals Belinda Kerchmar 3.1.11

  2. Operators • What are the operators we discussed last time? • This time-- Conditional Operators: • IF • SUMIF • COUNTIF

  3. IF in the real world... IF you get 8 hours of sleep THEN you’ll feel fresh in the morning ELSE you’ll feel tired in the morning IF you’re a Carolina fan on game day THEN you’ll wear Carolina blue ELSE you will wear whatever you feel like

  4. IF in excel… • IF (logical_test, value_if_true, value_if_false) • Logical test: the thing we’re checking for true or false • Value_if_true: what should happen if our test was true? • Value_if_false: what should happen if our test was false?

  5. Simple IF Example… • Is the number in the cell greater than seven?

  6. More complicated IF example Let’s assign letter grades to the students! 90 - 100 – A 80 - 89 – B 70 - 79 – C 60 - 69 – D <60 – F

  7. COUNTIF in the real world • How many brunettes are in class?

  8. COUNTIF in excel… • COUNTIF(range, criteria) • range – a collection of cells that we’re checking against our criteria • range example: I2:I9 • criteria some logical test for our range • Criteria example: “>=60” • criteria needs to be in quotes

  9. COUNTIF example • How many courses is each student passing? • How many courses did at least one student pass?

  10. SUMIF in excel • SUMIF (range, criteria, sum_range) • This function will add things up, depending on the criteria given. • range – a range of cells • ex. I2:I9 • criteria – the criteria we’re checking against • sum_range – the range of cells to add up

  11. SUMIF example • How much would it cost to buy one of every kind of vegetable? • How much would it cost to buy one of every kind of fruit?

  12. On your own (or in groups) • Buy the grocery item if it is a fruit and if it costs less than $2.50. • Label the grocery items as inexpensive (<$1), medium ($1-$2), or expensive (>$2) • Sum up the even numbers from the list. • Hint: use ISEVEN(someNumber) & ISODD(someNumber) • Sum up the odd numbers from the list

More Related