WEEK# 3 Haifa Abulaiha [email protected] August 31, 2015 1.

28
WEEK# 3 Haifa Abulaiha [email protected] August 31, 2015 1

Transcript of WEEK# 3 Haifa Abulaiha [email protected] August 31, 2015 1.

Page 1: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

WEEK# 3

Haifa Abulaiha

[email protected]

August 31, 2015

1

Page 2: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

2

OBJECTIVES COVERED

• Use statistical functions• Use cell references• Write formulas• Apply conditional formatting• Use the IF function• Use AND/OR criteria• Use nested IF functions• Use the RANK function• Use the VLOOKUP function• Use the FV function

Page 3: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

3

WV MINING PROBLEM

Page 4: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

4

DOWNLOAD AND OPEN DATA

• Download data file onto your computer.• Extract the zip data files to convenient

location.• You will have the following file:

– Mining.xslx

• Open Mining.xslx in Microsoft Excel.

Page 5: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

5

USE STATISTICAL FUNCTIONS/ CELL REFERENCES

• References:– Relative.

• Example: B20 (Column and Row change when copied)

– Absolute.• Example: $A$5 (Column and Row do not change when

copied)

– Mixed.• Example: $E20 (Column does not change when copied)

D$7 (Row does not change when copied)

Page 6: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

6

USE STATISTICAL FUNCTIONS/ CELL REFERENCES

• Statistical functions:– SUM– AVERAGE, MEDIAN– MAX, MIN– COUNT.

Page 7: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

7

USE STATISTICAL FUNCTIONS/ CELL REFERENCES

• On Coal Mined sheet:– Enter the minimum value

• C60: =MIN(C4:C58)

– Enter the maximum value• C61: =MAX($C$4:$C$58) • Modify the formula to display the correct maximum value for D61

through I61 (fully absolute references).

– Enter the average value formula. • C62: =AVERAGE(C$4:C$58)

– Enter the median value formula. • C63: =MEDIAN($C4:$C58) • Modify the formula so it displays the correct median value for

D63 through I63. (column-absolute mixed references).

Page 8: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

8

USE STATISTICAL FUNCTIONS/ CELL REFERENCES

• On Employment sheet:– Enter the sum total formula.

• C59: =SUM(C4:C58) • AutoFill the formula from cell C59 through I59.

– Calculate the average employment in each county using the SUM() and COUNT() functions.

• J4: =SUM(C4:I4)/COUNT(C4:I4)

Page 9: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

9

WRITE FORMULAS

• Order of Operations.– Parentheses.– Multiplications / Divisions– Additions / Subtractions.

Page 10: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

10

WRITE FORMULAS

• Structured References:– TableName[ColumnName]– TableName[[#Totals],[ColumnName]]

Page 11: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

11

WRITE FORMULAS

• On the Coal Mined sheet:– In column J, calculate the percentage of coal

mined in each county in 2010:

Page 12: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

12

WRITE FORMULAS

• On the Coal per Employee sheet:– In column C, calculate for each year and county the

tons of coal mined per employee. Reference the values on the Coal Mined and Employment sheets in your formula.

– AutoFill the tons of coal mined per employee formula from column C through I.

– In columns C through I, delete the contents of any cell displaying a divide-by-zero error (#DIV/0).

Page 13: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

13

WRITE FORMULAS

• On the Forecasts sheet:• In column I, calculate the forecasted amount of

coal mined in each region

Page 14: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

14

APPLY CONDITIONAL FORMATTING

• On the Coal per Employee sheet: – in cells C4 through I58.

• If at least 7,000 (≥ 7000) tons of coal were mined per employee, change the cell fill color to green and the text color to white.

• If less than 3,000 (< 3000) tons of coal were mined per employee, change the cell fill color to red and the text color to white

Page 15: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

15

USE THE IF FUNCTION

• The IF Function:– IF(logical_test, value_if_true, [value_if_false])– Example:

• IF( A$2>=600, “Pass”, “Fail”)

• IF(A$2>B$2, C$2=A$2,C$2=B$2)

Test False

True

Page 16: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

16

USE THE IF FUNCTION

• On the Coal Mined sheet:– Use a formula to determine which counties

produced coal during 2010. • K4: =IF(I4>0,"Yes","No")

Page 17: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

17

USE AND/OR CRITERIA

• On the Coal Mined sheet:– Use a formula to determine which counties

produced coal at any time between 1950 and 2010.

• L4: =IF(OR(C4>0,D4>0,E4>0,F4>0,G4>0,H4>0,I4>0),"Yes","No")

Page 18: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

18

USE NESTED IF FUNCTIONS

• IF( condition1, value_if_true1, IF( condition2, value_if_true2,value_if_false2 )

)

Page 19: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

19

USE NESTED IF FUNCTIONS

• On the Coal per Employee sheet:– Use a formula to determine if a county’s mines

were:• Highly efficient (at least 15,000 tons per employee), • Average (5,000-14,999 tons per employee), or • Inefficient (0-4,999 tons per employee). • J4: =IF(I4>=15000,"High",IF(I4>=5000,"Average","Inefficient") )

– We want to modify the formula so no text is displayed if the 2010 value is blank.

• J4: =IF(I4<>"",IF(I4>=15000,"High",IF(I4>=5000,"Average","Ine fficient")),"")

Page 20: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

20

USE THE RANK FUNCTION

• The RANK Function:– RANK (number, ref, Order)

B2 0, non: Des

1: Asc

$B$2:$B$20

• Excel 2010: RANK() == RANK.EQ()

Page 21: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

21

USE THE RANK FUNCTION

• On the Employment sheet: – Rank the counties by average number of

employees:• K4: =RANK(I4,$I$4:$I$58) • HINT: The older RANK() function is equivalent to

the newer RANK.EQ() function. • Cell K59 is to remain empty.

Page 22: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

22

USE THE VLOOKUP FUNCTION

• VLOOKUP( value, table, index_number, [not_exact_match] )– If index_number <1, will return #VALUE!.– If index_number is greater than the number of

columns in table, will return #REF!.– If not_exact_match = FALSE and no exact

match is found, will return #N/A.

Page 23: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

23

USE THE VLOOKUP FUNCTION

• On the: Employment sheet:– Retrieve the matching efficiency information

from the Coal per Employee Sheet. • L4: =VLOOKUP(A4,'Coal per Employee'!$A$4:$J$58,10)

Page 24: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

24

USE THE FV FUNCTION

• FV Function ( Future Value):– Returns the future value of an investment.– FV( interest_rate, number_payments, payment, [PV], [Type] )

Page 25: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

25

USE THE FV FUNCTION

• On the Coal Mined sheet:– Use the FV() function to adjust the $4.86/ton

value of coal in 1950 to 2010 assuming 3.739% inflation for 60 years, then multiply this value by the tons of coal mined to get its 2010 value.

• M4: =C4*FV(0.03739,60,0,-4.86)

Page 26: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

26

USE THE FV FUNCTION

• On the Coal Mined sheet:• No adjustment is necessary for inflation for the 2010

values. – N4: =I4*60.88

Page 27: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.

27

DO NOT FORGET

• MyITLab lesson A is due on Monday September 08 @ 11:59pm

• Homework 1 is due on Friday September 11 @ 11:59pm

• Instructions and Data files are available on:http://cs101.wvu.edu/instructors/abulaiha/assignments/

Page 28: WEEK# 3 Haifa Abulaiha hmabulaiha@mix.wvu.edu August 31, 2015 1.