You are on page 1of 21

LAB 1-2: BASIC EXCEL OPERATION

Introduction

Microsoft Excel is one of the most popular spreadsheet tools. Spreadsheet is in tabular
format for organizing, analyzing and storing data. It can also be used for plotting various
type of charts and acting as basic database.

Excel is arranged in the following hierarchy:

Cells
Workbook Worksheet
Range (Particular
(Student (Student
(Students' information of
Information ) Personal
Characteristics) a partciular
Contact)
students)

Creating New Workbook


➔ File →New → Blank New Workbook
(Workbook would be named as Book 1, Book 2...) with 1 worksheet (Sheet 1)

Open a Workbook
➔ File →Open → Recent (Recently used workbook)/Browse (Other locations)

Basic Control
Workbook name
Tabs/Ribbons
Quick Access

Active cells (Cell Pointer) Box for formula editing

Worksheet
Views options (Normal view, Page layout, Page break)
Zoom

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 1


LAB 1-2: BASIC EXCEL OPERATION

Column: From A to XFD (16,384 columns). Usually for storing the variables or fields.
Row: From 1 to 1,048,576. Usually for storing records.
Cell: Individual cells in the spread sheet which is the intersection of row and column.
Range: A group of cells for easy reference in the spreadsheet.

Some Major functions of various ribbon


Ribbon Group Descriptions
Home - Clipboard Copy and paste
(Basic Editing) - Font Color, size, style
- Alignment Center, to the right, merge…
- Number Simple and quick adjustment on decimal places, common
unit…
- Styles Basic coloring and formatting with predefined styles
- Cells Adding and deleting
- Editing Basic functions, fill, clear, sorting and filtering, search
Insert - Table Pivot table (important to summarize data!!!!) :O
(Additional objects) - Illustrations Picture, Shape, Smart art
- Charts Pie chart, bar chart……
Page Layout - Page Setup Margin, Orientation, Size, Print Area…
(Usually the setting for - Scale to fit Automatic arrangement that best fit the paper size
printing)
Formulas - Function Showing the BULIT IN function by groups
Library
Data - Sort & Filter Sorting (e.g. from smallest to largest) and filtering (select
some rows according to the defined criteria)
Review (Checking) - Proofing Spell check
View - Workbook Normal, Page Break, Page layout….
Views
- Window Arrange (when you have multiple workbooks being opened),
Freeze Panes (e.g freeze the top rows for easy data entry or

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 2


LAB 1-2: BASIC EXCEL OPERATION

checking)

Entering Data
Editing
Moving the Cell pointer to the desired location, type the data then press enter.
- F2 can be pressed to switch between “edit” and “enter” mode when you want to
replace or change the content of the cells, this is particularly important for entering
formula. (Edit: Typing, Enter: move between cells)

Autofill
Auto Fill can help you to fill the cells with repeated contents, series of values or even
copy the format only.
Auto Fill Handle Auto Fill Option

Auto fill will repeat the content when you drag the auto fill handle unless specific
pattern can be identified or some of the cells are filled with predefined data (for example,
date, time, weekdays…)

What will happen if you drag the fill handle to row 8????

Copying and Pasting Data (Especially the pasting part!)

Icon Function
Cut
Copy (Can be copy as picture)

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 3


LAB 1-2: BASIC EXCEL OPERATION

Copy and paste the format


Paste
Paste
Paste, Paste Formula, Formula with number formatting, Keep sourcing formatting
No border, Keep sourcing column width, Transpose
Paste Values
Values, Values and Number formatting, Values and source formatting
Other Paste Options
Formatting, Paste Link, Paste Picture, Linked Picture

Some short-cut keys that you should know

Short-cut Usage Short-cut Usage Short-cut Usage


keys keys keys
Ctrl + S Save Ctrl + O Open Ctrl + Z Undo
Ctrl + Y Repeat Ctrl + P Print Ctrl + X Cut
Ctrl + C Copy Ctrl + V Paste Ctrl + B Bold
Ctrl + I Italic Ctrl + U Underline Ctrl + A Select All
Ctrl + Shift + Copy Ctrl + Shift + Paste Format Alt + Next row
C format V Enter

Basic Display
Adding Column and Row
- Right click and select Insert
- Home Ribbon → Cell Group → Insert
- Selected column and row will shift to the right and move down
-
Deleting Column and Row
- Right click and select Delete
- Home Ribbon → Cell Group → Delete
- Selected column and row will shift to the left and move up

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 4


LAB 1-2: BASIC EXCEL OPERATION

Changing the cell format


Right click the cells/ranges you want to format,
and then click Format Cells.

There will be 6 options in format cells, which include


1. Numbers: Defining the format of the numbers (currency,
date, percentage, decimal places, negative values…)

2. Alignment*****

- Text alignment: e.g. you want to put the text in the middle of the cells (both
horizontally and vertically.

How can you make this??


(Hint: What is the difference between Wrap to text and Shrink to fit?)

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 5


LAB 1-2: BASIC EXCEL OPERATION

Extra: If you want to adjust the row height and the column width that fit the longest
text of various rows/column, move your cursor above or below the rows (OR to the
right or left of the column). Double click when you see a two-sided arrow appears!!!!
3. Font: Changing the color, styles, effects… of the text.
4. Border: Adding lines around the cells for highlighting and clear display
5. Fill: Changing the colors or patterns of the cells (not the cells)

Exercise 1
Create the following worksheet with appropriate display and formatting techniques.
(Remember to save your file for the next exercise!!! Name your sheet as Dec 2018)

Write down the techniques that you have used in the above exercises:
Merge and Center
Border
Fill
Bold
Italic
Underline
Accounting Number
Increase decimal

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 6


LAB 1-2: BASIC EXCEL OPERATION

Sorting

For better presentation, it may be better to have some patterns for arranging the
expenses. For example, in alphabetical orders.

Data Ribbon → Sort and filter group

If there are few sorting criteria, simply click the sort button above and specific the
sorting order.

Freeze
Consider the following cases, when you zoom the worksheet to this scale or when you
have a worksheet with some many columns that cannot be displayed in a single view.
How can you read the most important labelling column? (For example, what does the
blue cells refer to?)

View Ribbon → Window Groups → Freeze Panes

Which one will you choose????

Ans: Freeze First Column

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 7


LAB 1-2: BASIC EXCEL OPERATION

Formula
The formula can be entered by yourself or by built in functions.

Excel defines the input as formula rather than text if the cell content starts with an
equal sign =

Formula Built in function


=A1+A2+A3 =sum(A1:A3)

There are 3 methods to enter formula in excel

Method 1: Simply click the fx icon next to the box for formula editing

The insert function box will appear and you can select the function you need

This method would guide you by listing all the elements you need to complete this
function with description of the function.

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 8


LAB 1-2: BASIC EXCEL OPERATION

Method 2: Go to the formula ribbon →Function library Group

After you select the specific function, you will go to the same insert function box as
Method 1. This method may be easier than method 1 as the functions are listed in
categories.

Method 3: Self input of formula or built-in functions

Remainder on formula input

Symbols/functions Usage
“ “ e.g. =if(A1=“text”,1,0) Text input
: e.g. =sum(A1:A3) Continuous Range
, e.g. = sum(A1, A3:A5) Multiple cells/ranges
Ctrl + ¬ Display the formula
F4 Change the reference mode (absolute, relative, mixed)

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 9


LAB 1-2: BASIC EXCEL OPERATION

Tips: How to clearly define mixed, relative and absolute referencing?

Reference type Description


Relative reference What the cell pointer refer to and will offset the cells when copy to other
cells/ranges
Absolute When you want to lock a cell/range when copying the formula
Mixed reference When you want to copy formula across rows/columns with some patterns

Consider the following two case. (You can ignore the mixed reference and absolute
reference first)

Case 1:
If you have 2 dices (1 yellow and 1 blue), and you would like to find out the sum of
these two dices when both are thrown once. Write down what should be entered exactly
in cell B2, B4, D5 and F5 in the following excel worksheet.

Case 2:
The commission rate is specified in C1, write down the formula you will use in Cell
C4 to C6.

What is your observation?


Lock Cell C1

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 10


LAB 1-2: BASIC EXCEL OPERATION

Built-In Function
1. Math & Trig

Function: SUM Usage: Returning the total of a series of cells


Syntax: =SUM( number1, [number2], ... )
Return: Number

E.g.
Write down what should be entered exactly in B8 to calculate total sales of the
company.

=SUM(B4:B7)
What will be the result?45000

Function: SUMIF Usage: Returning the total of a series of cells when the specified
criterion(a) is/are matched
Syntax: =SUMIF( range, criteria, [sum_range] )
Return: Number

E.g.
Write down what should be entered exactly in B10 if we want sum the sales record
that is larger than or equals to 14000.

=SUMIF(B4:B6,">=14000")
What will be the result? 32000

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 11


LAB 1-2: BASIC EXCEL OPERATION

Function: Usage: Returning the total of the products of the specified range
SUMPRODUCT
Syntax: =SUMPRODUCT( array1, [array2], [array3], ... )
Return: Number

E.g.
Write down what should be entered exactly in C8 to calculate the total sales by using
the price per product and quantity columns instead of the sales column directly.

=SUMPRODUCT(D4:D6,E4:E6)
What will be the result? 45000

Function: Usage: Returning the number with specific number of decimal


ROUND place(s)
Syntax: =ROUND( number, num_digits )
Return: Number

E.g.
Write down what should be entered exactly in C4 to calculate the total commission
which can be auto-filled to C5 and C6. Round your answer to 1 decimal place.

=Round(B4*$C$1,1)
What will be the result? 819.1

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 12


LAB 1-2: BASIC EXCEL OPERATION

2. Text
Function: Usage: Joining two or more strings together
CONCATENATE
Syntax: =CONCATENATE(text1, [text2], ...)
Return: Text

E.g.
Write down what should be entered exactly in C12 for putting the word “Total Sales
Commission”.

=CONCATENATE("Total" & " " & B3 & " " &C3)

Function: LEFT Usage: Returning specific number of characters from the left of
the text
Syntax: = LEFT( text, [num_chars] )
Return: Text

E.g.
Write down what should be entered exactly in a cell for returning the first 3 characters
of the name of the sales
=LEFT(A4, 3)
What will be the result? Amy: Amy Peter:Pet Zoe: Zoe

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 13


LAB 1-2: BASIC EXCEL OPERATION

Function: RIGHT Usage: Returning specific number of characters from the right
of the text
Syntax: = RIGHT( text, [num_chars] )
Return: Text

E.g.
Write down what should be entered exactly in a cell for returning the last 2 characters
of the name of the sales
=RIGHT(A4, 2)

Function: MID Usage: Returning specific number of characters from the


position being specified.
Syntax: =MID( text, start_num, num_chars )
Return: Text

E.g.
Write down what should be entered exactly in a cell for returning the 4 characters
starting from the 2nd characters of the name of the sales
=MID(A4, 2, 4)

Function: LEN Usage: Returning the length of the text


Syntax: =LEN( text)
Return: Number

E.g.
Write down what should be entered exactly in a cell to count the length of the name
for each sales.
=LEN(A4)

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 14


LAB 1-2: BASIC EXCEL OPERATION

Function: Usage: Returning the position of the characters being searched


SEARCH
Syntax: =SEARCH( search_text, within_text, [start_num] )
Return: Number

E.g.
Write down what should be entered exactly in a cell to search for position of the 2nd
“e” for the Peter
=SEARCH(“e”,A5,3)

Challenge yourself!!!!
Combine what you have learnt in the text function section and write down what should
be entered exactly (built in function only)in order to return the surname of Amy in Cell
F4 that can auto-fill to F5 and F6.

=RIGHT(A4,LEN(A4)-SEARCH(" ",A4,1))

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 15


LAB 1-2: BASIC EXCEL OPERATION

3. Logical
Function: AND Usage: Checking the condition specified in the logical test
Syntax: =AND( logical_test1, [logical_test2], ... )
Return: TRUE/FALSE

E.g.

Write down what should be entered exactly in a cell to test whether the commission
are larger than 300 and smaller than 700.
=AND(C4>300,C4<700)

Function: OR Usage: Checking the condition specified in the logical test


Syntax: =OR( logical_test1, [logical_test2], ... )
Return: TRUE/FALSE

E.g.
Write down what should be entered exactly in a cell to test whether the commission
are larger than 700 or smaller than 800.
=OR(C4>700,C4<800)
What will be the result for each sales person? Amy:True Peter:True Zoe:True

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 16


LAB 1-2: BASIC EXCEL OPERATION

Function: IF Usage: Checking the condition specified in the logical test and
return different results if the condition is true or false
Syntax: = IF( logical_test, value_if_true, value_if_false )
Return: Output designed by the users

E.g.
Write down what should be entered exactly in cell G4 to test whether the commission
is larger than 500. If Yes, return excellent and poor otherwise. The result can be auto-
filled to G5 and G6.
=IF(G4>500, “excellent”, “poor”)
What will be the result for each sales person?
Amy: excellent Peter: excellent Zoe: excellent

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 17


LAB 1-2: BASIC EXCEL OPERATION

Exercise 2

i) Write down what should be entered exactly in cell B4 to display the last name of
the student. The result can be auto-filled to B5 and B10.
=LEFT(A4,SEARCH(" ",A4)-1)
ii) If the participation mark is calculated by using the attendance to multiply by the
effort. Write down what should be entered exactly in cell I4 to find the
participation mark for Chan Siu Man. The result can be auto-filled to I5 and I10.
=L4*M4

iii) The teacher would like to find out the total participation of all the students. Write
down what should be entered exactly in cell I12 to find the total participation mark.
=SUMPRODUCT(L4:L10,M4:M10)/=SUM(I4:I10)

iv) E2 to I2 are the weighting for different assessment components. Write down what
should be entered exactly in cell J4 to calculate the overall mark of the student.
The result can be auto-filled to J5 to J10.
=SUMPRODUCT($E$2:$I$2,E4:I4)

v) If the student obtain lower marks in mid-term than group project and performs
poorly in in-class assignment than individual assignment, he or she will be named
as “Pressure” student. Write down what should be entered exactly in Cell K4 so
that a Yes will be displayed in column K if he or she meets the above condition
and No otherwise. The result can be auto-filled to K5 to K10.
=IF(AND(H4<E4,G4<F4),"Yes","No")

vi) B14 displays the total effort paid by the students who are majoring in IT. Write
down what should be entered exactly in the cell.
=SUMIF(D4:D10,"IT",M4:M10)

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 18


LAB 1-2: BASIC EXCEL OPERATION

4. Look up and Reference


Function: Usage: Finding (looking-up) the value in the range/table/array
VLOOKUP and returns the corresponding values in the other column of the
range/table/array.

!!!The look up values should be put to the leftmost column of


the range/table/array!!!
Syntax: = VLOOKUP( lookup_value, table_array, col_index_num, [range_lookup] )
Return: Output designed by the users

E.g.
Write down what should be entered exactly in H4 so as to find out which team Amy
belongs to. The result can be auto-filled to H5 to H6.
=VLOOKUP(LEFT(A4,1),$A$15:$B$17,2)
What will be the result for each sales person? Amy:1 Peter:2 Zoe: 3

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 19


LAB 1-2: BASIC EXCEL OPERATION

Function: HLOOKUP Usage: Finding (looking-up) the value in the


range/table/array and returns the corresponding values
in the other row of the range/table/array.

!!!The look up values should be put to the uppermost


row of the range/table/array!!!
Syntax: = HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup] )
Return:
E.g.

Write down what should be entered exactly in I4 so as to find out how much award
amount Amy will get. The result can be auto-filled to I5 to I6 if all team will receive
sliver award this year.
=HLOOKUP(H4,$E$14:$G$17,3)
What will be the result for each sales person? Amy:900 Peter:1100 Zoe: 800

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 20


LAB 1-2: BASIC EXCEL OPERATION

Challenge yourself!!!!
If students are to be assigned into difference batch for random result checking. The
assignment is as follow.
The sum of the 3rd and 4th digit of the Student ID Batch Number
0-2 1
3-5 2
6-8 3
9-11 4
12-14 5
15-18 6

i) Determine the Range for Column O

ii) Write down what should be entered exactly in N4. The result can be auto-filled to
N5 to N10
=VLOOKUP(MID(C4,3,1)+MID(C4,4,1),$O$3:$P$9,2)

SEHH1071 COMPUTATIONAL TOOLS FOR STATISTICS BY CRYSTAL LEE 21

You might also like