&& how we might use it in spreadsheets

Slides:



Advertisements
Similar presentations
EXCEL.
Advertisements

情報基礎 B Lecture 5 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Computer Science & Engineering 2111 IF and Boolean Functions 1 CSE 2111 Lecture-IF and Boolean Functions.
CS&E 1111 ExIFs IFs and Nested IFs in Excel Objectives: Using the If function in spreadsheets Nesting If functions.
Conditionals Belinda Kerchmar Operators  What are the operators we discussed last time?  This time -- Conditional Operators:  IF  SUMIF 
Chapter 4 MATLAB Programming Logical Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Programming with MATLAB. Relational Operators The arithmetic operators has precedence over relational operators.
259 Lecture 4 Spring 2010 Logical Functions and Conditional Formatting in Excel.
Data Types. Every program must deal with data The data is usually described as a certain type This type determines what you can do with the data and how.
Tutorial 8: Working with Advanced Functions
SUMIF() Lesson: BASIC. =SUMIF() When Do You Use It: – To add numbers based on a single criterion/condition Example: If you have a column of data with.
Chapter 6 Advanced Functions Copyright 2005 Radian Publishing Co.
Lesson 4 Cell Reference Formulas. Working with Cell References continued… Relative Cell Reference A relative cell reference means that the cell value.
1 Spreadsheets SELECTION. 2 Aims  Understand the principles of selection in Excel  Examine the basic IF statement format  Look into Nested IF statements.
REACH-CRC © 2013 REACH-CRC. All Rights Reserved.Spring 2013.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
1. Common Functions 2.
It’s not that I’m so smart, it’s just that I stay with problems longer. - Albert Einstein.
MS Excel Management Information Systems 1. Contents 2  Functions  IF Function and nested IF  Sorting Data.  Filtering Data.  Data Form.  Data Validation.
Lesson 5: Working with Formulas and Functions Logical and 3D Formulas.
CS&E 1111 ExLogic Microsoft Excel Logical Functions Objectives: Using Boolean Logic in Spreadsheets l Relational operators l Boolean operators –Functions.
PROBLEM SOLVING & ALGORITHMS CHAPTER 5: CONTROL STRUCTURES - SELECTION.
If…else statements. Boolean Expressions Boolean expression - An expression whose value is either true or false true = 1 false = 0 Datatype: boolean.
CSC 107 – Programming For Science. George Boole  Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching.
ACIS Introduction to Data Analytics & Business Intelligence Business Intelligence Logical Functions.
Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1.
Decision Structures and Boolean Variables. Sequence Structures Thus far, we’ve been programming “sequence structures” Thus far, we’ve been programming.
CONDITIONALS. Boolean values Boolean value is either true or false It is name after the British mathemetician, George Boole who first formulated Boolean.
Logical Operators, Boolean Variables, Random Numbers This template was just too good to let go in one day!
CIS300 Test Review REACH - CRC © 2010 REACH All Rights Reserved.Fall 2010.
DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.
Intermediate Excel 2013 Gareth Johns IT Skills Development Advisor.
What are Operators? Some useful operators to get you started.
Prime and Composite Numbers Factors What is a prime number? Is this number prime?
Advanced Functions SET 153L. Logical Function An IF function can place different values in a cell based on some condition. =IF (test, value if true, value.
Chapter 2 Excel Fundamentals Logical IF (Decision) Statements Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Unit 8 – Spreadsheets Part 2 Spreadsheets Skills Lesson Part 2.
Today’s Activity Solving Multi-Step Equations. Instructions You should have a baggie of colored strips. Using the strips provided, have each person of.
CIS 100 Test #2 Review 1. EXCEL Functions on Test  SUM, COUNT, COUNTA, MAX, MIN, MEDIAN, MODE, AVERAGE, ROUND, and IF  Possibly Others 
Hoi Le. COUNTIF Countif(, ) Return number of elements that meet the criteria Always put criteria in quotation marks Example 1: count number of employees.
FUNCTIONS The parts of a function In order to work correctly, a function must be written a specific way, which is called the syntax. The basic syntax for.
ACIS Introduction to Data Analytics & Business Intelligence Business Intelligence Logical Functions Part 1.
Day # 5 Haifa Abulaiha February 01,
EXCEL. PARTICIPATION PROJECT STEPS a, 4b
CIS300 Test Review REACH-CRC © 2012 REACH-CRC. All Rights Reserved.FALL 2012.
Logical Functions and Conditional Formatting in Excel
Contents Introduction Text functions Logical functions
Computer Science & Engineering 2111
Computer Information Technology Section 6-17
REACH Computer Resource Center
TRACKER Contents Intro Excel 101 Math Operations Formulas 101.
Excel IF Function.
Computer Science 210 Computer Organization
Spreadsheets Skills Lesson Part 2
REACH CRC Professor Reinhardt
Chapter 4 MATLAB Programming
CIS300 Test Review REACH - CRC Fall 2010
JavaScript conditional
Introduction To Robot Decision Making
JavaScript conditional
Introduction to Computer Programming
Microsoft Excel – Part I
Introduction To Robot Decision Making
Conditional Logic Presentation Name Course Name
JavaScript conditional
REACH CRC Professor Manni
Topic 3 Lesson 1 – Conditional Logic
REACH Computer Resource Center
in Excel Instructor: Zhe He Department of Computer Science
Conditionals.
Presentation transcript:

&& how we might use it in spreadsheets Conditional Logic && how we might use it in spreadsheets 10.12.10

Boolean Logic Invented by George Boole Boolean logic is the basis for modern computer logic. George Boole was an english mathematician and philosopher. Born 1815, died 1864.

Boolean Logic Boolean logic Basics: AND OR NOT Which color represents Circles & Diagrams: green Circles Or Diagrams: yellow, blue, green Not Circles -- blue & white Not Diagrams -- yellow & white

AND In excel: AND (some list of arguments) If everything in list of arguments is true, then AND returns true. Otherwise, AND returns false. Did all students pass the course? easy example: =AND(2 + 2 = 4), =AND(2+3 = 4), AND(2 + 2 = 4, 1 + 2 = 4) harder example: Did both students pass the course? =AND(H2>=60, I2 >=60, J2 >=60) p q p and q T F

OR In excel: OR(some list of arguments) If at least one of the list of arguments is true, then OR returns true. Did at least one student pass? Note: Or does not mean that you have to have either one or the other. It simply means that you have at least one from the list. easy example: OR(2+2=4, 2+5=4) easy example: OR(2+2=3, 2+4=3) Did at least one student pass? =OR(H2>=60, I2 >=60, J2 >=60) p q p or q T F

NOT NOT(one argument) If p is true, then NOT p is false. If p is false, then NOT p is true. p not p T F

NOT NOT (circles) blue & white NOT(diagrams) yellow & white NOT(circles OR diagrams) white NOT(circles AND diagrams) yellow, blue, white Did neither student pass the course? simple example: not(2+2=4) = FALSE not(2+3=5) = TRUE more complicated example -- neither student passes: =NOT(AND(H2>=60, I2 >=60, J2 >=60)) notice: NOT(AND(H2 >= 60, I2 >=60, J2>-60) == AND(H2 < 60, I2 < 60, J2<60)

Some Other Operators IF SUMIF COUNTIF

IF IF In the real world... IF, THEN, ELSE excel: IF(logical_test, valueIfTrue, valueIfFalse) We use if-then-else statements in the real world all the time! If you go to bed, you’ll feel fresh in the morning, else (if you don’t go to bed) you’ll feel tired. If you’re a carolina fan on game day, then you wear blue, otherwise you don’t.

IF examples... Let’s assign letter grades to the students! 90-100 -A 80-89 - B 70-79 - C 60-69 - D <60 - F easy if: =IF(A1 > 7, "Greater than Seven","Less than Seven") note: make sure to use >= or <= because what if you type in 7? you need to cover all cases! Nested If: =IF(H2>=90, “A”, If(H2 >=80, “B”, “C or Below”)) Longer Nested if: =IF(H2>=90, "A", IF(H2>=80, "B", IF(H2>=70, "C", IF(H2 >=60, "D", "Fail"))))

COUNTIF in excel COUNTIF(range, criteria) range example: I2: I9 criteria example: “>= 60” criteria needs to be in quotes. How many courses is each student passing? How many courses did at least one student pass? example: number of courses passing: =COUNTIF(H2:H9, ">=60") & =COUNTIF(I2:I9, ">=60") & =COUNTIF(J2:J9, “>=60”) example: number of courses in which at least one student passed: =COUNTIF(L2:L9, TRUE)

SUMIF in excel: SUMIF(range, criteria, sum_range) this function will add things up, depending on the criteria given. If we bought one of each fruit, how much would it cost? If we bought one of each vegetable, how much would it cost? =SUMIF(C45:C50,"Fruit",B45:B50) =SUMIF(C45:C50,"Vegetable",B45:B50)

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), Expensive (>$2) Sum up the even numbers from the list. Hint: ISEVEN(someNumber) ISODD(someNumber) Sum up the odd numbers from the list.

On Your Own (or in groups)... Calculate the perimeter of the rectangle Calculate the area of the rectangle Calculate the ratio of the area to the rectangle (round this to the hundredths place)