Lec01 Intro Basics
Lec01 Intro Basics
Lecture 1
Can Akkan
Topics
Excel basics SUMPRODUCT formula Conditional Counting and Summing
IF, COUNTIF and SUMIF formulas
MS Excel
It is one of the most important tools you will use in your education and work.
Data analysis
Average, minimum, maximum spending by customers?
MS Excel
Simple database functionality
Find the customers whose income is above $40,000, who are married and have at least one child.
Example 1
We enter a formula by first typing =
Revenue = Price x quantity sold
Example1
You can copy and paste a formula
Goto cell D5 Press Ctrl + C (shortcut for copy) Go to cell D6 Press Ctrl + V (shortcut for paste) Select D7:D11 Press Ctrl + V to paste
Example 1
There are formulas to do certain common tasks, e.g. summation
Example 1
Now copy the SUM formula and paste it to cell D12. You should get the following:
Example 2
Type the following:
Cell B4: Price Cell C4: Quantity Cell D4: Revenue Cell B5: 3 Cell C5: 5
10
11
12
13
14
15
16
Example 3
Using SUMPRODUCT
Go to sumproduct worksheet Calculate total revenue
First, using multiplication and summation Then, using SUMPRODUCT
17
Example 3
In a cell if you press the function key F2 you
Get the display shown below
Color coded cell references
18
Example 4
A retailers data on its customers and their purchases.
Note the comments entered for each column header.
Right-click the mouse select Insert Comment
19
MS Excel Shortcuts
Knowing certain shortcuts can speed up the work you do in Excel dramatically. Select any cell in the table Press CTRL down arrow, then CTRL right arrow, then CTRL up arrow, etc.
20
Example 4
Task 1:
Insert a new column to the left of the table and title it "Customer ID".
There are at least 2 slightly different ways of doing this.
Fill handle
MS Excel Shortcuts
When the range in a formula is long do not use the mouse the select it.
Use CTRL-SHIFT-arrow
typically down-arrow or right-arrow SHIFT lets you select multiple cells.
Example 4
Task 2:
In cell B2 enter "Average" and then calculate the averages of columns C through I in cell C2 through I2.
In cell C2 the formula should be =AVERAGE(C3:C1003) Then copy the formula (can use drag handle) to the other cells.
23
Example 4
Task 3:
Calculate total and average amount spent by male customers.
Use SUM formula to calculate the number of males Use SUMPRODUCT formula to calculate total amount spent by males: =SUMPRODUCT(I4:I1003, C4:C1003) Calculate average AmtSpent for males
24
Example 4
Task 4:
Copy and paste (in one step) the "Gender", "Married" and "Children" columns to columns P, Q and R.
CTRL lets you select multiple disjoint cells/ranges.
Use CTRL-Shift-down arrow to select Gender column Holding down CTRL key, left-click the mouse on top of Married column Press CTRL-Shift-down arrow to select Married column Do the same for Children column
Press CTRL C to copy the three columns Select cell P3 and then press CTRL V
25
Example 6
Video availbale in Media Gallery Data on some households Objective: categorize utility expenses as normal or high
More than $250 -> high, otherwise normal
27
Example 6 Simple IF
Excels IF function IF(logical condition, returned value if condition is true, returned value if condition is false) In cell F3 type =IF(C3>$F$1, "high", "normal") " " symbols are used to denote that a text (called string in computer science) is being returned
28
Example 6 Simple IF
Value parts could also have
Empty Text: =IF(C3>$F$1,"high","") Number: =IF(C3>$F$1, 1, 0) Formula: = IF(C3>$F$1, D3*C3, (1-D3)*B3)
29
Example 6 Nested IF
Now we want to determine someone both with a high utility expense and owns her home. If BOTH conditions are TRUE then want 1 If AT LEAST ONE condition is FALSE then want 0 We will use two IF functions one within the other
30
Example 6 Nested IF
In cell G3 write =IF(F3="high",IF(D3=1,1,0),0)
One can write different nested IF functions that do the same job Think of alternative ways of doing this
31
33
Example 7
No video in Media Gallery. Two useful functions with IF functionality COUNTIF(range, criteria) SUMIF(range, criteria, [sum range])
Note: parameter in square brackets is optional
34
Example 7
35
Be adaptable to changes Must be efficient for the user to locate and observe critical portions of it
36
38
40
41