1 CS 106 Computing Fundamentals II Chapter 34 “Conditionals In Excel” Herbert G. Mayer, PSU CS Status 7/17/2013 Initial content copied verbatim from CS.

Slides:



Advertisements
Similar presentations
The essentials managers need to know about Excel
Advertisements

Pivot Tables. What are Pivot Tables? A pivot table gives you a way to group, summarize and compare data from a spreadsheet You can do some of the same.
MS EXCEL is a spreadsheet application Excel covers: Calculation Graphic tools Pivot tables Macro programming language called VBA EXCEL is a part of MS.
Lesson 3 Working with Formulas.
CS&E 1111 Exfunctions Using Functions in Excel Objectives: Using Excel functions l SUM, MIN, MAX, AVERAGE, COUNT, COUNTA l ROUND l COUNTIF, SUMIF, AVERAGEIF.
Review Ch. 15 – Spreadsheet and Worksheet Basics © 2010, 2006 South-Western, Cengage Learning.
EXCEL.
MS-Excel XP Lesson 2. Handling Worksheets 1.Bottom of the every workbook you can get worksheets. 2.No of sheets for a book is three. But you can add,
© Keith Vander Linden, How did you ever do without it? - from the first VisiCalc ad, 1979.
Introduction to Excel Chapter 2 Excel Fundamentals Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Pivot Tables ABDUL HAMEED
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.
1 Excel Lesson 3 Using Formulas and Functions Microsoft Office 2010 Fundamentals Story / Walls.
Tutorial 8: Working with Advanced Functions
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Exploring Formulas.
XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions.
Chapter 06: Lecture Notes (CSIT 104) 1 Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Copyright © 2008 Prentice-Hall. All rights reserved.
Theme 3: Data Dynamics Topic 18: Analyse data using Excel Chapter 3.3. Page 185 – 199 Analysing spreadsheet data.
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.
1 CS 106 Computing Fundamentals II Chapter 16 “Naming In Excel” Herbert G. Mayer, PSU CS Status 7/6/2013 Initial content copied verbatim from CS 106 material.
Computer Literacy BASICS
Chapter 10: Working with Large Data Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
1 CS 106 Computing Fundamentals II Chapter 17 “Introduction To VBA” Herbert G. Mayer, PSU CS status 6/30/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 25 “Variables, Assignment Statement” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
1 CS 106 Computing Fundamentals II Chapter 29 “Creating A User Form” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 7 “Showing Developer Tab” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from CS.
1 CS 106 Computing Fundamentals II Chapter 4 “Excel Basics for Mac” Herbert G. Mayer, PSU CS status 6/27/2013 Initial content copied verbatim from CS 106.
Excel Spreadsheet basics. Excel Sheets and Books  Spreadsheet: tool to analyze, chart and manage data for personal, business and financial use Worksheet:
Microsoft Office Excel 2013 ® ® Abdul Hameed Using Advanced Functions and Conditional Formatting.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Chapter 6 Data Tables and Amortization Tables Exploring Microsoft Office Excel 2007.
Chapter 12 Creating a Worksheet.
1 CS 106 Computing Fundamentals II Chapter 84 “Array Formulae” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
Chapter 6 Creating, Sorting, and Querying a Table
1 CS 106 Computing Fundamentals II Chapter 67 “Working With Files” Herbert G. Mayer, PSU CS status 6/24/2013 Initial content copied verbatim from CS 106.
A spreadsheet is a programme which stores data in a grid. Many people use spread sheets as an online calculator instead of working lots of calculations.
1 CS 106 Computing Fundamentals II Chapter 23 “Controls And Events” Herbert G. Mayer, PSU CS Status 7/5/2013 Initial content copied verbatim from CS 106.
Spreadsheets: Part I Creating a Worksheet in MS Excel
PERFORMING CALCULATIONS Microsoft Excel. Excel Formulas A formula is a set of mathematical instructions that can be used in Excel to perform calculations.
 Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.
UNIT 7: Using Excel in the Law Office. This Week’s Assignment Seminar Test 2 discussion questions.
Spreadsheets What is Excel?. Objectives 1. Identify the parts of the Excel Screen 2. Identify the functions of a spreadsheet 3. Identify how spreadsheets.
Spreadsheets COE 201- Computer Proficiency. Basic Interface Excel Book = Word Document Every book can contain up to 255 different sheets.
1 CS 106 Computing Fundamentals II Chapter 210 “Adding Controls to User Forms” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
Intermediate Excel 2013 Gareth Johns IT Skills Development Advisor.
Chapter 10: Working with Large Data Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Pages Appendix B: Review of ExcelChapter 3 Market Trends & Analysis IBM 320 CAL POLY POMONA IBM320 Market Trends and Analysis Maha Ghosn.
Resource Review Excel formula basics Demonstrate how to enter manual formulas Examine some of the available functions and their usage Discuss the.
CONDITIONAL FORMATTING AND CUSTOM NUMBER FORMATS LEC 5 1.
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.
Excel for Everyone STORMY STARK ITC TRAINING SERVICES.
Microsoft Excel 2007 Noris Bt. Ismail Faculty of Information and Communication Technology Tel : (Ext 8408) BCOMP0101.
1 CS 106 Computing Fundamentals II Chapter 85 “Excel Tables” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
CSE111 Introduction to Computer Applications
GO! with Microsoft Office 2016
International Computer Driving Licence Syllabus version 5.0
Using Advanced Functions and Conditional Formatting
CS 106 Computing Fundamentals II Chapter 5 “Excel Basics for Windows”
Excel IF Function.
2007 MICROSOFT EXCEL INTERMEDIATE
CS 106 Computing Fundamentals II Chapter 33 “Conditional Statements”
CS 106 Computing Fundamentals II Chapter 71 “Indexing”
CS 106 Computing Fundamentals II Chapter 73 “Ranges”
CS 106 Computing Fundamentals II Chapter 66 “Working With Strings”
Microsoft Excel 101.
Herbert G. Mayer, PSU CS Status 8/2/2013
CS 106 Computing Fundamentals II Chapter 69 “Event Loop”
REACH Computer Resource Center
Mathematical operators
Let’s Get Wordy Formulas Functions Excel It! Who Knows?
Presentation transcript:

1 CS 106 Computing Fundamentals II Chapter 34 “Conditionals In Excel” Herbert G. Mayer, PSU CS Status 7/17/2013 Initial content copied verbatim from CS 106 material developed by CS professors: Cynthia Brown & Robert Martin

2 Syllabus Conditionals in Formulas Conditionals in Formulas Sample Workbook Sample Workbook Basic Excel Functions Basic Excel Functions Using SUMIF Using SUMIF Using COUNTIF Using COUNTIF Conditional Formatting Conditional Formatting Using Formulas Using Formulas

3 Conditionals in Formulas There are convenient ways to use conditionals in Excel formulas without actually programmingThere are convenient ways to use conditionals in Excel formulas without actually programming For complex conditionals, a program is much easier to understandFor complex conditionals, a program is much easier to understand For simple conditionals, though, the Excel functions offer convenient ways to create spreadsheetsFor simple conditionals, though, the Excel functions offer convenient ways to create spreadsheets 3

4 Sample Workbook The Excel Workbook called Conditionals Example contains all the examples discussed in these slidesThe Excel Workbook called Conditionals Example contains all the examples discussed in these slides It shows an imaginary Real Estate company’s spreadsheet, with sales prices for houses in various neighborhoods, and which agent sold themIt shows an imaginary Real Estate company’s spreadsheet, with sales prices for houses in various neighborhoods, and which agent sold them It has a number of added conditional features which we’ll discuss one by oneIt has a number of added conditional features which we’ll discuss one by one

5 Basic Excel Functions The spreadsheet cells C18 and C19 show the average price of properties in the sheet, done in two different ways – take a look at the formulas (by clicking on the cell and looking at the formula window)The spreadsheet cells C18 and C19 show the average price of properties in the sheet, done in two different ways – take a look at the formulas (by clicking on the cell and looking at the formula window) But what if we want to know the average price for one salesperson?But what if we want to know the average price for one salesperson?

6 Using SUMIF To find John M.’s total sales, we use the following formula for cell C20:To find John M.’s total sales, we use the following formula for cell C20: =SUMIF(A7:A16, "John M.", C7:C16) This says to sum the elements of C7:C16 where the corresponding element of A7:A16 equals “John M.”This says to sum the elements of C7:C16 where the corresponding element of A7:A16 equals “John M.”

7 Using COUNTIF To get the average sale for John M., we need to divide by his number of sales. We can do this using COUNTIF in the formula for cell C21:To get the average sale for John M., we need to divide by his number of sales. We can do this using COUNTIF in the formula for cell C21: =C20/COUNTIF(A7:A16, "John M.") COUNTIF(A7:A16, “John M.”) returns the number of entries in the given range that equal John M.COUNTIF(A7:A16, “John M.”) returns the number of entries in the given range that equal John M. Note they must be exactly the same!Note they must be exactly the same! Blanks do count, hence can make a differenceBlanks do count, hence can make a difference Also, lower-case is different from upper-caseAlso, lower-case is different from upper-case

8 Sales per Neighborhood We can use the same idea to get average and total sales per neighborhood. This is done in C22 and C23 for Laurelhurst using the following formulas:We can use the same idea to get average and total sales per neighborhood. This is done in C22 and C23 for Laurelhurst using the following formulas: For C22: = SUMIF(B7:B16,"Laurelhurst",C7:C16)For C22: = SUMIF(B7:B16,"Laurelhurst",C7:C16) For C23: = C22/COUNTIF(B7:B16,"Laurelhurst")For C23: = C22/COUNTIF(B7:B16,"Laurelhurst")

9 A More Complex Condition Typical complex conditions may have the AND of two or more conditionsTypical complex conditions may have the AND of two or more conditions Excel has a built-in way to handle this using COUNTIFS and SUMIFSExcel has a built-in way to handle this using COUNTIFS and SUMIFS Let’s look at how to figure out John M.’s total and average sales in LaurelhurstLet’s look at how to figure out John M.’s total and average sales in Laurelhurst That is, we want to count sales that are by John M. provided it is in LaurelhurstThat is, we want to count sales that are by John M. provided it is in Laurelhurst

10 Using COUNTIFS and SUMIFS John M.’s Laurelhurst Total (C24): =SUMIFS(C7:C16, A7:A16, "John M.", B7:B16, "Laurelhurst") Note the column to be summed comes first, followed by the other columns and their conditions The equality test = is implied And the Boolean AND condition for both being true is implied John M.’s Laurelhurst Average (C25): =C24/COUNTIFS(A7:A16,"John M.", B7:B16, "Laurelhurst")

11 An OR Condition Suppose we want a condition that is an OR instead of an AND, or uses a comparison other than =Suppose we want a condition that is an OR instead of an AND, or uses a comparison other than = One way to do it is to make a column for the condition and then use the column values in a SUMIF or COUNTIFOne way to do it is to make a column for the condition and then use the column values in a SUMIF or COUNTIF For example, let’s say we want the total sales for houses in Irvington as well as in AlamedaFor example, let’s say we want the total sales for houses in Irvington as well as in Alameda Logically, this means the Neighborhood field is Irvington OR it is AlamedaLogically, this means the Neighborhood field is Irvington OR it is Alameda

12 A New Column for the Condition Column E on the spreadsheet is the result of testing whether the neighborhood equals Irvington OR Alameda The formula looks like this: =IF(OR(B7="Alameda",B7="Irvington"),"yes","no") Note the format for the IF: IF(condition, true branch, false branch) These IF’s can be nested. But you can see that too much nesting would be hard to read

13 Using the Condition C26 has the total sales for properties in Irvington and Alameda Here is the formula, using Column E: =SUMIF(E7:E16,"yes",C7:C16)

14 Conditional Formatting Along with conditionals in formulas, Excel also lets you specify formatting using conditionsAlong with conditionals in formulas, Excel also lets you specify formatting using conditions There is a conditional formatting button in the main ribbon, shown on the next slideThere is a conditional formatting button in the main ribbon, shown on the next slide (We did this on the windows version but it is very similar on the Mac)(We did this on the windows version but it is very similar on the Mac)

15

16 Data Bars Column C shows an example of Data Bars formatting The colored bar in each cell is determined by the cell value, with the smallest cell having only a small colored area and the largest one almost filled

17 Using Formulas Column A shows an example of using a formula in conditional formatting The formula must have a Boolean value In this case I colored the cell if the sale was in Laurelhurst and above the average price for Laurelhurst Here is the formula: =AND(C7>$C$23, B7="Laurelhurst")

18 If you make a lot of formatting rules… 18 The Manage Rules item lets you edit and examine your rules

19 Try it Yourself! Knowing how to use conditionals makes Excel even more powerful You should play around with the example spreadsheet or one that you make yourself to understand the concepts