CS&E 1111 ExLogic Microsoft Excel Logical Functions Objectives: Using Boolean Logic in Spreadsheets l Relational operators l Boolean operators –Functions.

Slides:



Advertisements
Similar presentations
Excel IF Functions The IF function is one of Excels most useful and most used functions. What it does, basically, is test to see whether a certain condition.
Advertisements

The IF function Bernard Liengme. Objectives To know how to: Construct a condition using the comparison operators =, >=, >, ; Construct a formula using.
Formulas, Ranges, and Functions. Formulas n Formulas perform operations such as addition, multiplication, and comparison on worksheet values. n Formulas.
Intermediate Formulas & Functions Instructor: Rachel Baltus.
CIS100 Test 2 Review REACH CRC © 2011 REACH CRC. All Rights Reserved.Spring 2011.
REACH CRC © 2011 REACH CRC. All Rights Reserved.Fall 2011.
REACH-CRC © 2013 REACH-CRC. All Rights Reserved.Spring 2013.
Introduction to Excel Formulas, Functions and References.
MONTEGO BAY HIGH SCHOOL INFORMATION TECHNOLOGY THE EXCEL IF FUNCTION.
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.
Week 10 Recap CSE 115 Spring For-each loop When we have a collection and want to do something to all elements of that collection we use the for-each.
Basic Elements of Programming A VB program is built from statements, statements from expressions, expressions from operators and operands, and operands.
true (any other value but zero) false (zero) expression Statement 2
Program Control Dilshad M. Shahid New York
1 Lecture 7:Control Structures I (Selection) Introduction to Computer Science Spring 2006.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
ACOT Intro/Copyright Succeeding in Business with Microsoft Excel 2010: Chapter1.
1 Selection Structures. 2 Making Decisions Sample assignment statements to figure worker pay with possible overtime PayAmount = Hours * Rate PayAmount.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
1 Excel Lesson 5 Using Functions Microsoft Office 2010 Introductory Pasewark & Pasewark.
259 Lecture 4 Spring 2010 Logical Functions and Conditional Formatting in Excel.
Spreadsheets Objective 6.02
2 Explain advanced spreadsheet concepts and functions Advanced Calculations 1 Sabbir Saleh_Lecture_17_Computer Application_BBA.
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.
1. Common Functions 2.
CS&E 200 Exfunctions Using Functions in Excel Objectives: Using Excel functions l Sum, Min, Max, Average, Count l Large, Small, Rank l Round l Countif.
Dr. Yang, QingXiong (with slides borrowed from Dr. Yuen, Joe) LT3: Conditional Statements CS2311 Computer Programming.
Lecture Set 5 Control Structures Part A - Decisions Structures.
Selection Structure If... Then.. Else Case. Selection Structure Use to make a decision or comparison and then, based on the result of that decision or.
1. We’ve learned that our programs are read by the compiler in order, from top to bottom, just as they are written The order of statement execution is.
Making Decisions Chapter 5.  Thus far we have created classes and performed basic mathematical operations  Consider our ComputeArea.java program to.
Lesson 5: Working with Formulas and Functions Logical and 3D Formulas.
Numeric and Functional. A cell is the intersection of a row and column Each cell in the spreadsheet has a name – The column-name followed by the row-name.
Unit 4, Lesson 4 Using Function Formulas. Objectives Understand function formulas. Understand function formulas. Use the Average and Sum functions. Use.
CHAPTER 4: Selection Control Structure. Objectives  Use the relational comparison operators  Learn about AND logic  Learn about OR logic  Make selections.
Conditional Structures UNIVERSITY OF THE PUNJAB (GUJRANWALA CAMPUS) ADNAN BABAR MT14028 CR
1 Compound Assignment C++ has a large set of operators for applying an operation to an object and then storing the result back into the object Examples.
Chapter 51 Decisions Relational and Logical Operators If Blocks Select Case Blocks.
CIS100 Test 1 Review REACH Computer Resource Center.
Relational and Boolean Operators CSIS 1595: Fundamentals of Programming and Problem Solving 1.
1 Excel Lesson 3 Using Functions Microsoft Office 2010 Introductory Pasewark & Pasewark.
CIS300 Test Review REACH - CRC © 2010 REACH All Rights Reserved.Fall 2010.
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 4: Understand and implement Decisions.
OPERATORS Chapter2:part2. Operators Operators are special symbols used for: mathematical functions assignment statements logical comparisons Examples.
Microsoft Excel Prepared by the Academic Faculty Members of IT.
CIS 100 Test #2 Review 1. EXCEL Functions on Test  SUM, COUNT, COUNTA, MAX, MIN, MEDIAN, MODE, AVERAGE, ROUND, and IF  Possibly Others 
Spreadsheet Calculations Formulas & Functions Computer Applications I.
TUTORIAL 4 Visual Basic 6.0 Mr. Crone. Pseudocode Pseudocode is written language that is part-code part- English and helps a programmer to plan the layout.
Random Functions Selection Structure Comparison Operators Logical Operator
CIS300 Test Review REACH-CRC © 2012 REACH-CRC. All Rights Reserved.FALL 2012.
Logical Functions and Conditional Formatting in Excel
Logical Functions Excel Lesson 10.
Numeric and Functional
Excel IF Function.
Boolean Expressions Return or display the Boolean value TRUE or FALSE
REACH CRC Professor Reinhardt
Sequence, Selection, Iteration The IF Statement
CIS300 Test Review REACH - CRC Fall 2010
Making Decisions in a Program
Microsoft Excel – Part I
Microsoft Visual Basic 2005: Reloaded Second Edition
Spreadsheets 2 Explain advanced spreadsheet concepts and functions
REACH CRC Professor Manni
Spreadsheets Objective 6.02
Topic 3 Lesson 1 – Conditional Logic
REACH Computer Resource Center
Spreadsheets Objective 6.02
Presentation transcript:

CS&E 1111 ExLogic Microsoft Excel Logical Functions Objectives: Using Boolean Logic in Spreadsheets l Relational operators l Boolean operators –Functions l None of logical construct l Using Conditional Formatting

CS&E 1111 ExLogic Boolean Logical Values Is 3 greater than 5 ? The answer is either True or False TRUE and FALSE are Boolean Values Mathematically this would be represented by the expression 3>5 How much greater is 5 than 3? This answer requires an arithmetic value Mathematically this would be represented by the expression 5 - 3

CS&E 1111 ExLogic, =, =, <> l The result is always either TRUE or FALSE l Relational Expressions: =38<=6 results is the value FALSE =B2=5+3 results is the value TRUE if B2 equals 8 Excel provides a class of operators known as Relational Operators that can be used to perform a comparison of the left and right sides of an expression

CS&E 1111 ExLogic Blue’s total is higher than Jones’ grade: =E4>E5 Jones’ total is the maximum in the class: =E8=E5 The average total of students is less than 300: =Average(E4:E6)<300 Simple Relational Expressions

CS&E 1111 ExLogic Are these expressions equivalent? Precedence of Relational Operators =B4+B5<=150 =(B4+B5)<=150 Relational operators are always evaluated last…

CS&E 1111 ExLogic How do you determine if all of the students got above 320 points to pass the class or if anyone got below 320 points? Boolean Logic Operators We can use Boolean Operators - each operator has a corresponding Excel Function AND, OR, NOT

CS&E 1111 ExLogic Boolean Logic Operators l AND - All items must be true for the statement to be true l OR - At least one item must be true for the statement to be true l NOT – switches a True to a False and a False to a True

CS&E 1111 ExLogic The AND Function Excel uses a Function to perform the AND operation Syntax: =AND(logical1,logical2,...) Returns TRUE if all its arguments are TRUE; returns FALSE if one or more arguments is FALSE =AND(TRUE, TRUE)  TRUE =AND(F5,F6) where cell F5=TRUE & cell F6= TRUE  TRUE =AND(F5:F10) where cell F10=FALSE  FALSE =AND(3>B7, 2+4=5) equals the value FALSE where cell B7=1 For more details on how it treats text or blanks, look at the function on Excel help.

CS&E 1111 ExLogic The AND Function Is everyone in the class an Honors student? =And(F4:F6) Did everyone pass the course? - the passing score is 320 points = And(E4>=320, E5>=320, E6>=320)

CS&E 1111 ExLogic The OR Function Excel uses a Function to perform the OR operation Syntax: =AND(logical1,logical2,...) Returns TRUE if any of its arguments are TRUE; returns FALSE only if all arguments are FALSE =OR(TRUE, FALSE)  TRUE =OR(F5,F6) where cell F5=FALSE & cell F6= FALSE  FALSE =AND(F5:F10) where cell F10=TRUE  TRUE =AND(3>B7, 2+4=5) equals the value TRUE where cell B7=1 For more details on how it treats text or blanks, look at the function on Excel help.

CS&E 1111 ExLogic The OR Function Is anyone in the class an Honors student? =OR(F4:F6) Did at least one student pass the course - the passing score is 320 points = OR(E4>=320, E5>=320, E6>=320) Can we just write OR(E4:E6>=20)?

CS&E 1111 ExLogic The NOT Function Excel uses a Function to perform the NOT operation Syntax: =NOT(logical) Reverses the value of its argument. Turns a TRUE to a FALSE - and a FALSE to a TRUE. Use NOT when you want to make sure a value is not equal to one particular value. A NOT function takes only ONE argument =NOT(FALSE) equals the value TRUE =NOT(F3) where F3=True equals the value FALSE =NOT(3>5) equals TRUE

CS&E 1111 ExLogic The NOT Function Blue is not an Honors student =NOT(F4) Blue didn’t get a passing grade (320)? =NOT(E4>=320) is the same as E4<320

CS&E 1111 ExLogic How can we determine if none of the students are Honors students? Prove at least one student is an honors student (TRUE) then you know the statement none is FALSE = NOT(OR(F4:F6)) Another way is to prove each one is not an honor’s student = AND(NOT(F4), Not(F5), Not(F6))

CS&E 1111 ExLogic More Practice Blue’s total and Jones’ total are greater than Grey’s: =AND(E4>E6, E5>E6)  FALSE Grey’s total is not the maximum grade: =NOT(E6=MAX(E4:E7))  TRUE None of the students passed the course = NOT(OR(G4:G5))  TRUE

CS&E 1111 ExLogic “Conditional Formatting” allows the user to format a cell or range of cells based on specific criteria. The user has the option to setup criteria based on a value in a cell or based on a formula. Conditional Formatting

CS&E 1111 ExLogic What we’ve learned using Boolean Logical Constructs in Decision Making l A relational expression can be used to compare two values. l To determine if a list of logical arguments are ALL true use the AND function. (every, both) l To determine if at least one value is TRUE from a list of logical arguments use the OR function. (any, some) l Use the NOT function to change a TRUE value to FALSE and visa versa. Combine a NOT(OR() construct to determine if none of the values are TRUE.