HKTA Tang Hin Memorial Secondary School S. 2 Computer Literacylwc1/files/files/s2_cl/... · Formula...
Transcript of HKTA Tang Hin Memorial Secondary School S. 2 Computer Literacylwc1/files/files/s2_cl/... · Formula...
HKTA Tang Hin Memorial Secondary School
S. 2 Computer Literacy
Name: ________________________
Class: _________________ ( )
P.1
Chapter 1 Spreadsheet
Spreadsheet: tool for organizing and calculating numerical information
2 types of spreadsheet: manual and electronic
2 advantages of electronic spreadsheet over manual spreadsheet:
a) Automatic information update:
If formulae are used to add the data in a spreadsheet, the total sum will be updated
(re-calculated) automatically when changes are made to the data.
b) Automatic insertion of chart
1.1 Basic knowledge of spreadsheet:
Component Description
Column heading Columns are lettered from A to Z, then from AA to ZZ, and then from
AAA to XFD. There are a total of 16384 columns.*
Row heading Rows are numbered from 1 to 1048576.*
Cell
A cell is the intersection of a row and a column. Each cell can store a
single data item. A cell address is formed by the column letter followed
by the row number.
Name box The name box displays the cell address of the selected cell.
Formula bar The formula bar displays the content or the formula of the selected cell.
Worksheet One of the pages in a workbook (Excel file).
* Excel 2007 and 2010 has 16384 columns and 1048576 rows only for .xlsx files.
Excel 2003 and before, or .xls files, only have 256 columns (A to IF) and 65536 rows.
Title bar
Ribbon
Tabs(Ribbon)
Worksheet
Formula bar
Column heading
Row heading
Worksheet tabs
Active worksheet
Worksheet navigation buttons
Name box
Cell
P.2
1.2 Formatting features:
a) Merge and Center tool:
Cell A1 now spans across columns A to G, and its content is centred.
b) Set text alignment:choose data and click center
c) Set font face: Arial
d) Set font style: bold
e) Set font size: 20
f) Set font color:
g) Set fill color:
P.3
h) Format numbers:
Cell content Format style Formatted cell content
123 Currency style $123.00
123 Percentage style 12300%
34000 Comma style 34,000.00
For decimal numbers, the value displayed in a cell depends on the column width.
‘Increase decimal’ button
‘Decrease decimal’ button
i) AutoFill Position the cursor on the fill handle and it will change to a cross. Drag it downwards to fill
the cells below.
j) Formatting Rows, Columns and Cells
Changing Column Width For numbers that are too long to fit in a column, the symbol ‘#’ will be displayed as follows:
P.4
The simplest way is to drag the boundary between adjacent column headings. Point to the
boundary, so that the cursor changes to . Dragging the boundary towards the right can
increase the column width.
Double-click the boundary and this can adjust the column to be wide enough to fit the stored
content.
Alternatively, select ‘Format’ > ‘Column’ > ‘Width…’ in Menu bar can also change the
column width.
Changing Row Height Similarly, the height of a row can be changed by dragging or double-clicking the boundary
between two adjacent row headings.
To change the height of more than one row, select the rows by clicking the row headings.
Select ‘Format’ > ‘Row’ > ‘Height’ and enter a new value for row height.
P.5
Task A: Create a time-table for your schedule of daily life.
[Hint: Make use of the ‘fill-handle’ at the bottom-right-hand corner to auto-fill the cells.]
Fig. 1
Change the border style including the colour and width, the cell colour, by right-clicking the
cells > Format cells . A menu of 6 tabs (Fig.2) is available for you to modify
the appearance of the cell content. [Hint: At the ‘Alignment’ tab, you can reset the ‘merge and
centre’ function put in a series of cells, they can be split into separate cells if needed.]
Fig.2 Fig.3
Exercise 1: Modify your school time-table. See if you can change it to the one shown on Fig.3.
P.6
1.3 Using Formulae in Calculation
- Advantage: perform calculation automatically.
- Every formula begins with an equal sign (=).
Operator Meaning Formula in cell Displayed result
+ Addition =2+3 5
- Subtraction =5-2 3
* Multiplication =12*4 48
/ Division =10/2 5
^ Exponentiation =4^2 16
( ) Brackets =(2+3)*4 20
& String Concatenation =">" & 30 >30
a) Using Cell Address in Formulae
- Cell addresses (rather than actual
number) can be used in formulae so that
the values stored in cells are calculated.
- In the spreadsheet below, cell C1 stores
the formula ‘=A1+B1’ which adds up the
values stored in cells A1 and B1.
b) Using SUM Function
- The ‘SUM’ function adds up the values
stored in one or more cells.
c) Copying Formula
- To copy a formula to adjacent columns or rows, drag the fill handle of the cell which stores
the formula.
P.7
d) Using AVERAGE Function
The ‘AVERAGE’ function calculates the
average value for a group of cells.
e) Using MAX and MIN Functions
- The ‘MAX’ and ‘MIN’ functions can be used to find the largest and smallest value of a
group of cells respectively.
f) Using COUNT Function
- The ‘COUNT’ function counts the number of cells in a selected range that contains
numbers.
P.8
Task B: Study the ‘calculation’ worksheet in the ‘students.xls’ [Obtain the file at this link
http://www.tanghin.edu.hk/~cl/s2/excel/]. Edit the worksheet and find out the sub-totals and
total of the products. Here is the reference of the format and result.
Fig
.4
[Hint: You can imagine the spreadsheets in Excel to be a very powerful calculator, you can carry
out a lot of calculations by clicking ‘=’ at any cell and input the calculation within the cell or the
formulae bar. If you want to have cross-reference of the values of the cells, simply click the cells,
e.g. “=B1+J5” and you can trace and update the calculation easily.]
Exercise 2: Consider the shopping list of a family as follow:
Item Unit Price Quantity
Battery 12.7 2
Avocado 8.7 4
Bread 8.9 2
Oat meal 15.6 1
Tomato 4.3 1.5
Modify the list. Add currency to the values of cash and change them to two decimal places.
g) Using functions
=SUM(J2:L2) Returns the sum of the values in a range
=AVERAGE(J2:L2) Finds the mean of the values in the range
=MAX(J2:L2) Displays the largest value in the range
=MIN(J2:L2) Displays the smallest value in the range
=COUNT(J2:L2) The number of cells containing values in the range
=COUNTIF(A1:J10,"<=40") Counts the number of cells within a range that meet the
given criteria (<=40)
=COUNTIF(A1:J10, L2) Counts the number of cells within a range that meet the
given criteria (=value of cell L2)
Hint: Replace L2 by "<="&L2, etc. to represent a range.
P.9
Task C: Study the worksheet ‘Function and Chart’ in the ‘students.xls’. The data contains one
hundred marks from cells A1 to J10. Find out the average, the highest mark, and the lowest mark
by the functions: AVERAGE, MAX and MIN. Remember to click ‘=’ before you call out the
functions.
Fig.5
[Hint: If you cannot find the function needed at the list on the left of the formula bar, you can
scroll down the menu to ‘More functions…’ and call out the ‘Paste Functions’ menu. Choose the
Function category if you know it or simple choose ‘All’ and find from the ‘Function name’.]
Task D: With the same worksheet, carry out the following tasks:
1. Find out the cumulative frequency of the 100 data by ten limits: from ‘>10’ to ‘>100’.
Consider the use of the COUNTIF function in this task. The COUNTIF calculates
how often values occur within a range of values, and then returns a vertical array of
numbers. COUNTIF counts the number of cells within a range that meet the given
criteria, e.g. ‘=COUNTIF(A1:J10, "<=40")’.
2. Plot the cumulative polygon as shown in Fig.6, by using the ‘Line Chart’ in Chart
Wizard . You may need to modify the option ‘Category (X) axis labels’ in source
data by right-clicking the curve (Fig.7).
Fig.6 Fig.7
P.10
3. Find out the distribution of class mark defined in the worksheet. Plot the histogram
(‘Column Chart’ in Chart Wizard) as show in Fig.8.
Fig.8
1.4 Charts
Bar chart
comparing values
Pie chart
• presenting data that is a percentage of a whole
• only include one data series
P.11
Line chart (broken-line graph)
• presenting the differences of data over a period of time
• e.g. monthly average temperature of a city.
• It can include more than one data series.
a) Adding Chart Title, Legend and Data Labels
P.12
b) Resizing the Chart
c) Changing Colours and Background of a Chart
P.13
1.5 Solving simultaneous equations using Excel
Motivation:
Equation 1 : 2x-y=4
Equation 2 : x+3y=9
Q1 Do you know how to solve these 2 equations mathematically?
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
Q2 There is another method to find the point of intersection of these 2 lines. Do you know
the software used for this graphical method?
______________________________________________________________________
Task : plotting graph for 2 equations
1. Input the following data on sheet 1:
2x-y=4
x 0 1 2 3 4
y
x+3y=9
x 0 1 2 3 4
y
2. Express y in terms of x:
2x-y=4 _______________________ y=_____________
x+3y=9 _______________________ y=_____________
3. Enter the formula for cell B4.
4. Enter the formula for cell B9.
5. Copy the formula for cell B4 to cells C4, D4, E4 and F4.
6. Copy the formula for cell B9 to cells C9, D9, E9 and F9.
You should get the following results:
2x-y=4
x 0 1 2 3 4
y -4 -2 0 2 4
x+3y=9
x 0 1 2 3 4
y 3 2.666667 2.333333 2 1.666667
P.14
7. Choose cells from B3 to F4.
8. Press Ctrl key and choose cells from B9 to F9.
9. Click menu Insert and choose straight line xy-scattered chart.
10. Move the chart to the right of data.
11. Click choose information and edit number list 1.
12. Click cell A1 for the title of number list 1 and click OK.
13 Edit number list 2.
P.15
14. Click cell A6 for the title of number list 2 and click OK.
15. Choose layout 1.
-5
-4
-3
-2
-1
0
1
2
3
4
5
0 1 2 3 4 5
2x-y=4
x+3y=9
-5
-4
-3
-2
-1
0
1
2
3
4
5
0 1 2 3 4 5Axi
s Ti
tle
Axis Title
Chart Title
2x-y=4
x+3y=9
P.16
16. Set the title of chart to “2 equations”.
17. Set the label of x-axis to “x”.
18. Set the label of y-axis to “y”.
19. Set the size of “x” and “y” to 14.
20. Click menu layout , drawing region and then other options.
21. Choose gradient fill and then default color to “paper”.
22. Choose external shadow.
Q3 What is the point of intersection? ____________________________
Q4 Do you like using spreadsheet (Excel) to solve 2 equations? Why?
______________________________________________________________________
______________________________________________________________________
-5
-4
-3
-2
-1
0
1
2
3
4
5
0 1 2 3 4 5
y
x
2 equations
2x-y=4
x+3y=9
-5
-4
-3
-2
-1
0
1
2
3
4
5
0 1 2 3 4 5
y
x
2 equations
2x-y=4
x+3y=9
P.17
Conclusion:
When 2 equations are simple to be solved, e.g. 2x-y=4 and x+3y=9,
Use ________________ method.
When 2 equations are difficult to be solved, e.g. y=x2+11x-7 and y=5x-13,
Use ________________ method.
Further exercise:
Finding the solutions of a straight line and
a curve:
You are given the following equations:
y = x2+11x-7
y = 5x-13
Try to complete two tables of y-values and
plot the curve and lines for them. Here is a
reference of the results:
P.18
1.6 Cell Reference
You may insert the one or more $ sign before cell references. (e.g. A1 to $A1, A$1 or $A$1).
The $ sign affects the behaviour when the formula are copied to other cells. See below:
a) Relative cell reference
b) Absolute cell reference
c) Mixed cell reference
Appendix: learning points
Basic Excel operations
1. Font settings (Font face/colour/size) and alignments
2. Merge-and-center tool
3. Cell formatting
(Fill colour, border; General/Text/Numbers/Currency/Date/Time/Percentage)
4. Problem solving
When cell content becomes ### (numbers)
When only part of text could shown (Text)
Adjust the column width / row height; Best fitting
How to show more than a line of data in a cell
P.19
Statistical Application using Excel
1. Use of Fill handle to copy text, to extend a series, to copy formula
2. Use of relative reference (without $) and absolute reference (with $)
3. Use of common functions:
a. =Max(Range)
b. =Min
c. =Average
d. =Sum
e. =Countif
4. Use of formula
a. =A2
b. =(A2+A3)/2
c. =$A3-A$2
5. Use of formula and functions together
e.g. =sum(A2:A8) - max(A2:A8) - min(A2:A8)
6. Should be able to identify the best way to accomplish a task.
7. Create charts automatically
Histogram & Cumulative frequency polygon/curve
Selecting separated ranges
Customizing values in X-axis
Customizing the range of values and steps in Y-axis
Putting labels on both axes
Putting legend aside
Customizing major grid lines and minor grid lines
Customizing bar color
Put the chart title
Solving simultaneous equations using Excel
1. Proper use of Fill handle to create X values as a series
2. Translate correct formula (setting Y as the subject of the formula) in Excel
3. Selecting correct ranges (separated!) for charting
4. Use of XY-scattered chart
Name of the series
X values of the series
Y values of the series
5. Customizing the chart to look like a graph paper (major grid lines and minor grid lines,
colours)