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.

Slides:



Advertisements
Similar presentations
Naming in Excel. Excel Objects and Names Every Excel object is contained in a workbook A workbook is divided into worksheets (individual spreadsheets);
Advertisements

Homework Discussion Homework 2 (Glade Manual Chapter 2) Using multiple worksheets in a model.
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.
Functions S S T : S P R E A D S H E E T S SST 5 Spreadsheet 5 Function.
Formulae S S T : S P R E A D S H E E T S SST 4 Spreadsheet 4 Formula.
Microsoft Excel 2010 Test.
Basics Of Spreadsheets Chapter Spreadsheet spreadsheet: grid of cells, each of which can contain text data or numeric data.
1 CA202 Spreadsheet Application Combining Data from Multiple Sources Lecture # 6.
Microsoft Excel Computers Week 4.
Q UIZ Direction: Choose the correct answer from the given choices. Begin.
Spreadsheet Models for Managers: Session 2 2/1 Copyright © Richard Brenner Spreadsheet Models for Managers Session 2 Analysis and Synthesis Array.
Exploring Microsoft Excel 2002 Chapter 7 Chapter 7 List and Data Management: Converting Data to Information By Robert T. Grauer Maryann Barber Exploring.
Tutorial 7: Using Advanced Functions and Conditional Formatting
Chapter 7 Data Management. Agenda Database concept Import data Input and edit data Sort data Function Filter data Create range name Calculate subtotal.
CS1100: Computer Science and Its Applications Creating Graphs and Charts in Excel.
Intro to Matrices Don’t be scared….
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1CP102_module 3: spreadsheet2 More features in Excel Selection: a cell, a range, multiple ranges Name a range: to give name to a selected range or multiple.
Chapter 6 Advanced Functions Copyright 2005 Radian Publishing Co.
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.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
Spreadsheets and Microsoft Excel. Introduction n A spreadsheet (called a worksheet in Excel) is a two-dimensional array of cells containing data to be.
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.
CHAPTER 13 Creating a Workbook Part 1. Learning Objectives Understand spreadsheets and Excel Enter data in cells Edit cell content Work with columns and.
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.
Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
CS105 Fall CS105 Lab 3 – Excel: The IF Function Announcements MP 1 will be released on Monday 9/14, due Monday 9/28 by 9pm Midterm 1 on Tuesday 9/29.
1 CS 106 Computing Fundamentals II Chapter 61 “Loops” Herbert G. Mayer, PSU CS Status 7/29/2013 Initial content copied verbatim from CS 106 material developed.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
Microsoft Excel By Tom Osti. What is Excel? Microsoft Excel (full name Microsoft Office Excel) is a spreadsheet-application written and distributed by.
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.
1 CS 106 Computing Fundamentals II Chapter 75 “Arrays” Herbert G. Mayer, PSU CS Status 7/31/2013 Initial content copied verbatim from CS 106 material developed.
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 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS.
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.
Glade Manual – Chapter 6 1 “COUNTIF” function: - “COUNTIF” function counts the number of cells within a range that meet the given condition - In Excel:
1 CS 106 Computing Fundamentals II Chapter 211 “Coding And Debugging” Herbert G. Mayer, PSU CS status 6/29/2013 Initial content copied verbatim from CS.
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.
Chapter 2: Excel Basics and Formatting Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Excel Project 1 Creating a Worksheet and an Embedded Chart.
1 CS 106 Computing Fundamentals II Chapter 6 “How To Zip & Unzip Files” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from.
CS 161 Introduction to Programming and Problem Solving Chapter 17 Nested Loops Herbert G. Mayer, PSU Status 9/8/2014 Initial content copied verbatim from.
1 CS 106 Computing Fundamentals II Chapter 28 “Scope” Herbert G. Mayer, PSU CS Status 7/14/2013 Initial content copied verbatim from CS 106 material developed.
COMPUTER LITERACY NOTES MS-EXCEL. SPREADSHEETS A spreadsheet is a computer equivalent of a paper ledger sheet. Excel allows you to create spreadsheets.
BUSINESS MATHEMATICS & STATISTICS. LECTURE 4 Review Lecture 3 Calculating simple or weighted averages Using Microsoft Excel.
1 CS 106 Computing Fundamentals II Chapter 42 “Sub Procedures And Functions” Herbert G. Mayer, PSU CS Status 8/5/2013 Initial content copied verbatim from.
A rectangular array of numeric or algebraic quantities subject to mathematical operations. The regular formation of elements into columns and rows.
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
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.
International Computer Driving Licence Syllabus version 5.0
5.2 Microsoft Excel.
CS 106 Computing Fundamentals II Chapter 5 “Excel Basics for Windows”
CGN 2420 Matrix Operations in Excel
Computer Applications for Business
CS 106 Computing Fundamentals II Chapter 35 “Controls For Choices”
CS 106 Computing Fundamentals II Chapter 33 “Conditional Statements”
5.2 Microsoft Excel.
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”
Herbert G. Mayer, PSU CS Status 8/2/2013
CS 106 Computing Fundamentals II Chapter 64 “For Loop Variations”
ECE 103 Engineering Programming Chapter 19 Nested Loops
CS 106 Computing Fundamentals II Chapter 69 “Event Loop”
Presentation transcript:

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 developed by CS professors: Cynthia Brown & Robert Martin

2 Syllabus Writing Excel User Functions Writing Excel User Functions Mac vs. Windows Mac vs. Windows C C C C c

3 An array formula is… An array formula is a formula that can perform multiple calculations on one or more elements of an array; it can return multiple cells instead of just one cell The multiple cells are in a rectangular shape group which could be in one row or column or in multiple rows and columns. We will call this group of cells an “array” in this context. It is not the same as a VBA array, but it is a similar concept.

4 Example: Transpose We’ll illustrate the idea by creating an array formula that transposes an array There is a copy option that does the same thing, but it creates a copy that is not linked to the original, so a change in the original does not create a change in the copy This example is from “Excel, the Missing Manual” by Matthew McDonald

5 Example Data This data has 15 rows and 5 columns; the values repeat down each column and increase from row to row.

6 Create the Array Formula The formula is going in cells A18:E15. I typed =TRANPOSE( and selected the array of cells A1:E15. To save it as an array formula I now must type ) and then Control-Shift-Enter rather than just Enter. (Use Command-Return on a Mac)

7 The Result You can see that the rows and columns have been transposed.

8 I added a regular copy with transpose option These two transposed copies look the same, but they’re not

9 I changed the original “array”… The copy created with the array formula changed to match the new data; the simple transposed copy did not

10 Curly brackets signify an array formula Excel adds the curly brackets when you type Control-Shift-Enter (Command-Return on a Mac); they show the cell value was created using an array formula

11 Changing the Formula If you want to change the formula, you need to select ALL the cells in the source array, change the formula, and then type Control-Shift-Enter (Command-Return on a Mac) to create the new formula Besides TRANSPOSE, some other functions that require array formulas are FREQUENCY and TREND

12 Another Example This is taken from the article at support.microsoft.com on when to use an array formula to do a SUM with multiple IF criteria We discussed IF for worksheets early in the term; see Week 3 for details This formula also uses + as a Boolean operator: it is the same as OR

13 The Data We have a company with 3 types of departments, A,B, and C Our spreadsheet has rows with department type and number of employees We want to sum the number of employees in departments of type A or B (You could also use SUMIFS, as we did in our example in Week 3)

14 First Example Here we entered the following array formula in Cell D1: (curly braces added by Excel) =SUM(IF((A2:A9="A")+(A2:A9="B"),B2:B9,0)) This says that if the entry in column A is “A” or “B”, add the corresponding number in column B to the sum, else add 0. The sum of numbers with departments A or B is 16

15 Second Example Note the curly braces inside this second formula! You type these explicitly; the outer ones come from using the special return combination. The formula gives the same result as the first one: =SUM(IF(A2:A9={“A”,”B”},B2:B9,0)) So in this case Excel matches any element in the inner array {“A”, “B”}

16 Bottom Line There are cases where it makes sense to use these kinds of formulas Often, though, you can write a VBA program to do the same job and the program will be easier to understand and modify, and less error-prone, than the formula If you like these there is more information at