259 Lecture 4 Spring 2010 Logical Functions and Conditional Formatting in Excel.

Slides:



Advertisements
Similar presentations
Cell Referencing Absolute Reference: A reference that does not change when copied. It is specified with a dollar sign in front of both the row and column.
Advertisements

Pradeep Velugoti Lakshman Tallam.  Type in the month name “January” in any cell say A1.  Now drag the fill handle to the right to select the range (Do.
CIS100 Test 2 Review REACH CRC © 2011 REACH CRC. All Rights Reserved.Spring 2011.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 1Advanced Formatting, Formulas, and Data Management Chapter 2Advanced Functions and Formulas.
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.
Calling all Data Geeks! Corey McAfee October 24, 2014 Corey McAfee October 24, 2014.
Tutorial 7: Using Advanced Functions and Conditional Formatting
Pradeep Velugoti Lakshman Tallam.  Type in the month name “January” in any cell say A1.  Now drag the fill handle to the right to select the range (Do.
Excel Web App By: Ms. Fatima Shannag.
MICROSOFT EXCEL – TRAINING FOR QC DIETETIC INTERNS Stephanie Brooks – Fall 2014.
 Create a small exam that calculate the grade it self  Create a small program to do.
Tutorial 8: Working with Advanced Functions
Excel 2007 Part (2) Dr. Susan Al Naqshbandi
Spreadsheets Objective 6.02
2 Explain advanced spreadsheet concepts and functions Advanced Calculations 1 Sabbir Saleh_Lecture_17_Computer Application_BBA.
Chapter 6 Advanced Functions Copyright 2005 Radian Publishing Co.
Excel 2010 Formulas and Functions One of Excel's most useful features is that it allows users to create custom formulas to perform calculations on their.
Lesson 4 Cell Reference Formulas. Working with Cell References continued… Relative Cell Reference A relative cell reference means that the cell value.
CIS300 TEST REVIEW EXAM 1- PROF. ZURADA & PROF. GUAN REACH - CRC © 2010 REACH All Rights Reserved.Fall 2010.
REACH-CRC © 2013 REACH-CRC. All Rights Reserved.Spring 2013.
AGB 260: Agribusiness Information Technology Advanced Functions and Logic.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
LOGO Chapter VI Advanced Functions 1. LOGO Overview  INTRODUCTION  NESTED FUNCTIONS  LOOKUP  VLOOKUP  COUNTIF  SUMIF  IF  ROUND  THE PMT, IPMT.
COMPREHENSIVE Excel Tutorial 7 Using Advanced Functions, Conditional Formatting, and Filtering.
1. Common Functions 2.
Microsoft Office Excel 2013 ® ® Abdul Hameed Using Advanced Functions and Conditional Formatting.
CIS300 TEST REVIEW EXAM 2- PROFS. KENDRA, GOYAL & MCINTOSH REACH - CRC © 2014 REACH All Rights Reserved.
Lesson 5: Working with Formulas and Functions Logical and 3D Formulas.
# 1# 1 Error Messages, VLookup, Practical Tips What use is VLookup? How do you error check in Excel? CS 105 Spring 2010.
Excel Web App By: Ms. Fatima Shannag.
CS&E 1111 Exreference Microsoft Excel Reference Functions Objectives: l Understanding and using Reference Functions l The computer’s algorithm l Syntax.
More Spreadsheets Range Formulas & Empty Cells Logical Functions Lookup Functions.
Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003.
Excel Review By Mr. Griffin Elmira Business Institute.
CIS300 Test Review REACH - CRC © 2010 REACH All Rights Reserved.Fall 2010.
Intermediate Excel 2013 Gareth Johns IT Skills Development Advisor.
REACH-CRC © 2013 REACH-CRC. All Rights Reserved.Spring 2013.
RevisionRevision Function in Spreadsheet DATE Returns the serial number of a particular date. Syntax –DATE(year,month,day) year is a number from 1900.
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 
CIS300 Exam 4 Review Dale McIntosh © 2009 Dale McIntosh. All Rights Reserved.Spring 2009.
Resource Review Excel formula basics Demonstrate how to enter manual formulas Examine some of the available functions and their usage Discuss the.
CIS 100 Test #3 Review REACH Computer Resource Center.
AGB 260: Agribusiness Information Technology Advanced Functions and Logic.
MS-EXCEL PART 3. Use data validation in Excel to make sure that users enter certain values into a cell. Data Validation Example In this example, we restrict.
CIS300 Test Review REACH-CRC © 2012 REACH-CRC. All Rights Reserved.FALL 2012.
AGB 260: Agribusiness Data Literacy
Logical Functions and Conditional Formatting in Excel
Using Advanced Formulas
Using Advanced Functions and Conditional Formatting
REACH Computer Resource Center
TRACKER Contents Intro Excel 101 Math Operations Formulas 101.
Excel IF Function.
2007 MICROSOFT EXCEL INTERMEDIATE
REACH CRC Professor Reinhardt
CIS300 Test Review REACH - CRC Fall 2010
Adding Functionality to your Spreadsheet
How To Use VLOOKUP In Microsoft Excel
Managing Multiple Worksheets and Workbooks
Advanced Microsoft Excel
Working with Formulas and Functions
Operate A Spreadsheet Application Advanced
Spreadsheets 2 Explain advanced spreadsheet concepts and functions
REACH CRC Professor Manni
Spreadsheets Objective 6.02
REACH Computer Resource Center
Spreadsheets Objective 6.02
Working with Formulas and Functions
Presentation transcript:

259 Lecture 4 Spring 2010 Logical Functions and Conditional Formatting in Excel

2 Logical Functions  Excel’s built-in logical functions are useful for introducing conditional statements, i.e. “decision making” functions into a spreadsheet!  The functions are:  TRUE  FALSE  NOT  AND  OR  IF  IFERROR (new in Excel 2007)  Information on each of these functions can be found in the Help File or at Microsoft’s Office Web pages:

3 The TRUE Function  Syntax: TRUE( )  Returns the logical value TRUE.  TRUE can be entered directly into cells and formulas without using this function.

4 The FALSE Function  Syntax: FALSE( )  Returns the logical value FALSE.  FALSE can be entered directly into cells and formulas without using this function.

5 The NOT Function  Syntax: NOT(logical)  logical is a value or expression that can be evaluated to TRUE or FALSE.  Reverses the logical value of its argument.  If logical is FALSE, NOT returns TRUE.  If logical is TRUE, NOT returns FALSE.

6 Example 1  Try NOT on the following: 0, 1, a, FALSE, 1+1=2.

7 Example 1 (cont.)

8 The AND Function  Syntax: AND(logical1,logical2,...)  logical1, logical2,... are 1 to 255 conditions you want to test that can be either TRUE or FALSE.  Returns TRUE if all its arguments are TRUE.  Returns FALSE if one or more argument is FALSE.

9 The AND function (cont.)  The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays (i.e. rectangular blocks of cells) or references that contain logical values.  If an array or reference argument contains text or empty cells, those values are ignored.  If the specified range contains no logical values, AND returns the #VALUE! error value.

10 Example 2  Make an AND truth table in Excel! ANDTRUEFALSE TRUE FALSE

Example 2 (cont.) 11

12 The OR Function  Syntax: OR(logical1,logical2,...)  logical1, logical2,... are 1 to 255 conditions you want to test that can be either TRUE or FALSE.  Returns TRUE if any argument is TRUE.  Returns FALSE if all arguments are FALSE.

13 The OR Function (cont.)  The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values.  If an array or reference argument contains text or empty cells, those values are ignored.  If the specified range contains no logical values, OR returns the #VALUE! error value.

14 Example 3  Make an OR truth table in Excel! ORTRUEFALSE TRUE FALSETRUEFALSE

Example 3 (cont.) 15

16 The IF function  Syntax: IF(logical_test,value_if_true,value_if_false)  logical_test is any value or expression that can be evaluated to TRUE or FALSE.  value_if_true is the value that is returned if logical_test is TRUE.  value_if_false is the value that is returned if logical_test is FALSE.

17 Example 4  Try each of the following IF statements: 1.=IF(1 < 2, “Mickey Mouse”, “Donald Duck”) 2.=IF(1 > 2, “Mickey Mouse”, “Donald Duck”) 3.=IF(1 <= 2,) 4.=IF(1 <> 2, TRUE) 5.=IF(1 < 2, 6*2+5) 6.=IF(1 >= 2,) 7.=IF(1 > 2, TRUE) 8.=IF(“yes” = “no”, 6*2+5, 2-10^3)

18 Example 4 (cont.)

19 The IF function (cont.)  If logical_test is TRUE and value_if_true is blank, this argument returns 0 (zero).  To display the word TRUE, use the logical value TRUE for value_if_true.  value_if_true can be another formula.  If logical_test is FALSE and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value FALSE is returned.  If logical_test is FALSE and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned.  value_if_false can be another formula.

20 Example 5  Use IF to create a piecewise-defined function for the absolute value function.

21 Example 6  Use IF to assign grades automatically in a grade book!  If score ≥ 93, then assign “A”.  If score < 93, then assign “Not A”.

22 Example 7  First class postage rates are given below.  Use a nested IF statement to help calculate postage! First-Class Mail (Retail Letters) - Postage Rates Weight not Over (Ounces)Single-Piece 1 $ $ $ $0.92

23 Example 7 (cont.)  The idea we need to implement in Excel is:  Weight ≤ 1 oz => $0.41  1 oz $0.58  2 oz $0.75  3 oz $0.92  Over 3.5 oz => cannot mail first class!  To do this we can use a nested IF command!  =IF(CELL#<=1,0.41,IF(CELL#<=2,0.58,IF(CELL#<= 3,0.75,IF(CELL#<=3.5,0.92,"cannot mail first class"))))

24 Example 7 (cont.)

25 The IF Function (cont.)  Up to 64 IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests.  When the value_if_true and value_if_false arguments are evaluated, IF returns the value returned by those statements.  If any of the arguments to IF are arrays, every element of the array is evaluated when the IF statement is carried out.  Microsoft Excel provides additional functions that are conditional, including COUNTIF, SUMIF, and others.  Another way to test many conditions is to use the LOOKUP, VLOOKUP, or HLOOKUP functions.

The LOOKUP Function  LOOKUP looks in a one-row or one-column range (known as a vector) for a value and returns a value from the same position in a second one-row or one-column range.  Syntax: LOOKUP(lookup_value,lookup_vector,result_vector)  lookup_value is a value that LOOKUP searches for in the first vector.  lookup_vector is a range that contains only one row or one column.  result_vector is a range that contains only one row or column. It must be the same size as lookup_vector. 26

The LOOKUP Function (cont.)  lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.  The values in lookup_vector can be text, numbers, or logical values.  The values in lookup_vector must be placed in ascending order:...,-2, -1, 0, 1, 2,..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give the correct value.  Uppercase and lowercase text are equivalent.  If LOOKUP can't find the lookup_value, it matches the largest value in lookup_vector that is less than or equal to lookup_value.  If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP gives the #N/A error value. 27

Example 8  The LOOKUP function can be used to calculate postage rates!  Try this command with the weights we used above in Example 7: 0.5, 1, 1.1, 2, 2.1, 3, 3.1, and 4 ounces.  =LOOKUP(weight,{0,1,2,3,3.5},{0.41, 0.58,0.75,0.92,"cannot mail first class"}) 28

Example 8 (cont.)  Does the postage get calculated correctly?  Notice that the postages for 1, 2, and 3 ounces are wrong.  How could we fix our LOOKUP function to get the correct postages?  One possibility – replace 1 with , 2 with , etc. in the look_up vector. 29

30 The IFERROR Function  Syntax: IFERROR(value,value_if_error)  value is the argument that is checked for an error.  value_if_error is the value to return if the formula evaluates to an error.  The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.

The IFERROR Function (cont.)  If value or value_if_error is an empty cell, IFERROR treats it as an empty string value ("").  If value is an array formula, IFERROR returns an array of results for each cell in the range specified in value. 31

Example 9  Use the IFERROR function to create a “Division by Zero Checker”  What happens if any of the cells in columns A or B are blank? 32

Conditional Formatting  The formatting of a cell can be a determined by the cell contents!  In the Styles group of the Home tab, choose the Conditional Formatting drop-down menu.  The following examples are formatted conditionally, i.e. in terms of their contents, by choosing some of the built-in conditional formatting rules (large number available is new in Excel 2007)!  Highlight Cells Rules -> Less Than  Highlight Cells Rules -> Text that Contains  Data Bars  Top/Bottom Rules -> Above Average 33

Conditional Formatting (cont.)  Suppose we wish to use colors to highlight grades in a grade sheet, using colors to differentiate ranges of scores.  In particular, choose yellow, red, and green as the colors determined by scores in the range: score ≥ 92, 90 ≤ score < 92, score < 90, respectively!  One way to try to do this is via a built-in conditional formatting Color Scale, such as Green-Yellow-Red.  The drawback is that the built-in formatting may not match exactly what you want! 34

Conditional Formatting (cont.)  The other way is to create new conditional formatting rules!  To do this, choose Manage Rules from the Conditional Formatting Menu to pull up the Conditional Formatting Rules Manager.  Then choose New Rule, followed by Format Only Cells that Contain to set up the appropriate conditions. 35

36 References  Excel’s Help File and Microsoft’s Office Web pages: us/excel/HP aspx us/excel/HP aspx  About.com Excel IF Tutorial: celfunctions/a/if_funct_hub.htm celfunctions/a/if_funct_hub.htm  Microsoft Excel 2007 Bible by John Walkenbach