spreadsheet software (advanced topics) microsoft excel

45
Spreadsheet Software Spreadsheet Software (Advanced Topics) (Advanced Topics) www.csd.uwo.ca/faculty/cling/cs www.csd.uwo.ca/faculty/cling/cs 031 031 Microsoft Excel

Upload: celine-wade

Post on 14-Dec-2015

224 views

Category:

Documents


1 download

TRANSCRIPT

Spreadsheet SoftwareSpreadsheet Software(Advanced Topics)(Advanced Topics)

www.csd.uwo.ca/faculty/cling/cs031www.csd.uwo.ca/faculty/cling/cs031

Spreadsheet SoftwareSpreadsheet Software(Advanced Topics)(Advanced Topics)

www.csd.uwo.ca/faculty/cling/cs031www.csd.uwo.ca/faculty/cling/cs031

Microsoft Excel

My office hour this week (only)

Thursday: 12-1 pm, 4-5 pm (not 1-3 pm)

MC 366

Midterm…

86 questions (all multiple choice; no deduction on incorrect answers)

100 total marks 60% on lecture notes and textbook

(Chapter 1 to 7) 10% on quiz-like questions (XP, Excel,

Word) 30% on advanced Excel (this file)

Some sample questions from textbook…

First-generation computers were characterized by the ________.

a      microprocessor

b     stored program

c     integrated circuit

d     vacuum tube

e     transistor

Answer: d

An inherent characteristic of RAM is that it is ________.

a)      write only

b)      read only

c)      volatile

d)      nonvolatile

e)      both b) and d) are correct

Answer: c

1. The DOS operating system was developed at ________.

a)      Sun Microsystems

b)      Microsoft

c)      UCLA

d)      United States Department of Defense

e)      none of the above

Answer: b

Relative and Absolute Addressing

A feature of spreadsheet software is the automatic update of formula during replication commands

The automatic update of formula during replication allows the user to enter the formula once and then replicate variations of the formula in other cells

Relative Addresses This is the default address mode Assume that the formula

=B23*D9-K12 is in cell A5

If the formula =B23*D9-K12 where copied from cell A5 into cell B6 then the updated formula would be:

Answer: C24*E10-L13

Absolute Addresses

Absolute addresses are used when a cell reference must NOT change during replication

If a row and/or column designator must not change during replication it is prefixed with the “$” character

If you copied the formula = $B7 + C$9 + D10 + $D$4 from cell E5 to cell G8, what would the new formula be?

Answer:

= $B10 + E$9 + F13 + $D$4

Predefined Functions

Excel has an extensive library of predefined functions

The library contains functions used in the following areas Financial Statistical Lookup and Reference Logical Mathematical and Trigonometric

SUM Function

Used to sum the values in selected cells

The formula =A3+A4+B3+B4+D9 can be replaced by a call to the SUM function

The SUM function must be supplied with the values to be summed

=SUM(A3:B4,D9)

COUNT Function

Count the number of cells that contain “numbers” in a range of cells

Values that are numbers, dates, or string representations of numbers are counted

=COUNT(A1:B5)

MIN Function

Finds the smallest value in a set of values

=MIN(A3:B5,D9,16,SUM(H6:H8))

MAX Function

Finds the largest value in a set of values

=MAX(A3:B5,D9,16,SUM(H6:H8))

AVERAGE Function

Find the average of the values provided as the arguments

=AVERAGE(A3:B5,D9,7,SUM(H6:H8))

IF Function

The predefined IF function selects between one of two actions

For example, a student who earns a mark greater than or equal to 50 in CS031 will be given a numeric grade for the course. If the student earns a mark less than 50 they will be given an “F” for the course.

Assume that the computed mark for a student is stored in cell H68

The formula =IF(H68>=50,H68,”F”) can be used to decide if the student should receive a numeric grade or an “F”

The IF function has three parameters (or arguments)

=IF(<expression>,<true>,<false>) The <expression> is a Boolean

expression The <true> part is performed if the

Boolean expression is true The <false> part is preformed if the

Boolean expression is false

Boolean Expressions

People use Boolean expressions everyday

Boolean expressions are used as part of our decision making process

We use Boolean variables, Relational operators and Boolean operators to express the decision

Example Decision

“If my bank balance is greater than or equal to $20.00 and I have my ATM card then I can withdraw $20.00”

“I have my ATM card” is a Boolean variable

“is greater than or equal to” is a Relational operator

“and” is a Boolean operator

Relational Operators

Relational operators yield Boolean results (“true” or “false”)

There are six relational operators Equal to = Not equal to <> Less than < Less than of equal to <= Greater than > Greater than or equal to >=

Boolean Operators

There are three commonly used Boolean operators

NOT, AND and OR NOT – complements the result of a

Boolean expression AND – combines two Boolean

expressions OR – combines two Boolean

expressions

Booleans Operators in Excel

The Boolean operators (AND, OR and NOT) are predefined functions in Excel

The expression “age is NOT greater than or equal to 19” could be entered as =NOT(Age>=19) on an Excel spreadsheet

The expression “balance is greater than or equal to $20.00 and I have my ATM card” could be entered as =AND(Balance>=20,ATM=true)

The expression “work in the R&D department or they make more than $50,000 a year” could be entered as =OR(Dept=“R&D”,Salary>50000)

1. What will the following formula return? =IF(AND(NOT(D4<25), B1=30), D2, B3)

2. What will the following formula return? =IF(NOT(B1=30),IF(C1>B4,D2,C2),IF(C1=C4,A3,B3))

Answer: Laura Jim

If cell A6 contains a formulaIf(A1<35, If(A4>=60, A1, A2), if(not(A3=“Wilma”), A3, A4))

What value would be displayed in A6?

If the formula in A6 is copied to B6, what value would be displayed in B6?

(similarly for C6 and D6)

Answer:1. Homer2. 303. 454. Chris

If cell A7 contains a formulaIf(and(A1<35, A2=“Homer”), A2, If(or(A4<40, A4>60), A3, A4))

What value would be displayed in A7?

If the formula in A7 is copied to B7, what value would be displayed in B7?

(similarly for C7 and D7)

Answer:1. Homer2. Laura3. 454. Chris

Develop a formula to calculate a sales commission as follows

5% of the total sales if the total sales is greater than or equal to $0 and less than or equal to $1,000

10% of the total sales if the total sales is greater than $1,000 and less than or equal to $5,000

15% of the total sales if the total sales is greater than $5,000

You can use nested IF… but deeply nested

(Assuming A2 stores the total sale)=IF(A2<=1000, 0.05*A2, IF(A2<=5000,

0.1*A2, 0.15*A2) )

Much better if we use vlookup:(Assuming A2:A7 store the total sale)Formula in E2 is =VLOOKUP(A2, $D$11:$E$13,2) * A2

Vlookup explained…

VLOOKUP (lookup_value, table_array, col_index_num, range_lookup)

Move this textbook away to see the answer

If the table of the room assignment for the midterm is at E1:G9, and A1 contains a student’s last name. Write a formula in B1 for the room that this student should go for the midterm:

Answer:=vlookup(A1, E2:G9, 3, true)

Following the last question, and assuming that A1:A100 contain students’ last names. Can you copy the formula in B1 directly to B2:B100 to obtain rooms for students to go to write the midterm?

Answer: No