Week 1 Lab2 Dina A. Said [email protected]. What to be covered today? Wiki Custom calculations If...
-
Upload
ariel-trumper -
Category
Documents
-
view
213 -
download
0
Transcript of Week 1 Lab2 Dina A. Said [email protected]. What to be covered today? Wiki Custom calculations If...
Week 1 Lab2Dina A. Said
What to be covered today?
WikiCustom calculationsIf statementPivot tablesLookup table
1/21/2009 CPSC203- Week1- Lab2 2
Wikihttp://wiki.ucalgary.caComputer science 203 /CPSC_203_Template
/CPSC 203 Lab Manual for Winter 2009 \Wiki tutorialMisconductAssignmentsLab material
1/21/2009 CPSC203- Week1- Lab2 3
Custom CalculationsCreate your own Functions using “=“
1/21/2009 4CPSC203- Week1- Lab2
1/21/2009 CPSC203- Week1- Lab2 5
1/21/2009 CPSC203- Week1- Lab2 6
1/21/2009 CPSC203- Week1- Lab2 7
1/21/2009 CPSC203- Week1- Lab2 8
1/21/2009 CPSC203- Week1- Lab2 9
1/21/2009 CPSC203- Week1- Lab2 10
1/21/2009 CPSC203- Week1- Lab2 11
Now, calculate the average of each subject :
* Using AVERGAE implied
function* Using custom
calculations (sum/count)
1/21/2009 CPSC203- Week1- Lab2 12
1/21/2009 CPSC203- Week1- Lab2 13
Order of CalculationsMultiplication, DivisionAddition, Subtraction
Example:2+3*5 = 2+ (3*5) 2/3+5= (2/3)+5
Use brackets if you are confused
1/21/2009 CPSC203- Week1- Lab2 14
If-Then Statement3 parts:
Logical testTrue statementFalse statement (optional)
Example:*If Mary’s Mark in subject1 > 60* Then, She passed* Else, She failed
1/21/2009 CPSC203- Week1- Lab2 15
Formula=IF(<logical statement>, <true statement>, <false
statement>)Example:
=IF(B4>60,"pass","fail")
Note: If your result is string or you are testing string, you should use “”
1/21/2009 CPSC203- Week1- Lab2 16
1/21/2009 CPSC203- Week1- Lab2 17
1/21/2009 CPSC203- Week1- Lab2 18
Think how to make if statement for subject 2 using Insert Function
1/21/2009 CPSC203- Week1- Lab2 19
What is the best way to apply the function for subject 3 as well?
What if we want the test to be
Greater than or equal
1/21/2009 CPSC203- Week1- Lab2 20
Nested If StatementIf subject1 >= 90
Then, AElse If subject2 >=70
Then, B Else C
=IF(B4>=90,"A", IF(B4>=70,"B", “C"))
1/21/2009 CPSC203- Week1- Lab2 21
1/21/2009 CPSC203- Week1- Lab2 22
Pivot tablesTo summarize data in understanding manner
1/21/2009 CPSC203- Week1- Lab2 23
Pivot tables (cont.)Choose tab insert pivot table Choose the rangChoose where to put the tableSelect data of interestDrag which to be in rows and which to be in columnsSelect the calculation to be performed; Max, Average,
etc..
1/21/2009 CPSC203- Week1- Lab2 24
Lookup tablesSometimes, we have a code that we want it to be replaced
with a value
1/21/2009 CPSC203- Week1- Lab2 25
=LOOKUP(B4,F3:G7)
VLookupSearching for a certain text, e.g. student ID
1/21/2009 CPSC203- Week1- Lab2 26
We want to lookup student with Id 3000=VLOOKUP(3000,A5:B9,2)
Formula: VLOOKUP(Value, table, column Index)