Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

SPREADSHEETS

AS LEVEL IT

Michael Bryan - mbryan.gh@gmail.com


Objective 1
1. create and edit the structure of a spreadsheet
2. manipulate cells and their contents
3. freeze panes and windows

Michael Bryan - mbryan.gh@gmail.com


Spreadsheet Basics I
• Spreadsheets can be used to store and analyze
data
• Spreadsheets present data in a grid of Columns
and Rows
• Columns and Rows intersect to form Cells
• A Cell is named using the Column and Row that
formed it
• E.g. Column C and Row 6 intersect to for Cell C6.
• Each cell can contain 3 types of data:
• Numbers (integer, decimal, date/time)
• Text/label (alphanumeric, hyperlinks, etc.)
• Formular (begins with ‘=‘ sign)

Michael Bryan - mbryan.gh@gmail.com


Spreadsheet Basics II
• Notable file formats:
• Native file format of MS Excel - .xlsx ( e.g. SchoolData.xlsx )
- Stores: Data, format settings and formula
• Generic Comma Separated Value - .csv ( e.g. Shop.csv ) [ Demo ]
- Stores only data and discards format settings and formula
• File, Workbook, worksheet(sheet):
• A Spreadsheet is saved as a file
• Each file consist of a single workbook
• A single workbook may contain a single or several worksheets.

Michael Bryan - mbryan.gh@gmail.com


Open, import, create sheet, save file
• Task 1

[ Open source_files ]

Michael Bryan - mbryan.gh@gmail.com


Activity 1

Michael Bryan - mbryan.gh@gmail.com


Spreadsheet Page Setup
Accessing the Page Setup dialog box:
1. Page Layout(Menu) > select drop down
2. File > Print > Page Setup

• Page Size (pages wide)


• Margins
• Headers/footers (auto data)
• Sheet (grid and headings)

[ Demo ]
Michael Bryan - mbryan.gh@gmail.com
Try: Tasks/Activity
Task 2

2
Activity 2

2
Michael Bryan - mbryan.gh@gmail.com
Edit spreadsheet structures
• Inserting cells, rows and columns
• Deleting cells, rows and columns
• Resizing rows and columns
• Hide and unhide rows and columns
• Merging cells
• Wrapping text
[ Demo ]

Michael Bryan - mbryan.gh@gmail.com


Try1:
Task 3

Michael Bryan - mbryan.gh@gmail.com


Try2:
• Activity 3

Michael Bryan - mbryan.gh@gmail.com Activity 3


Protecting cells and their contents
1. Protecting sheet (prevent editing cell content)
1. Lock/unlock cells ( Home > Alignment dropdown > Protection )
2. Apply Sheet protection with appropriate options (Review > Protect Sheet)
2. Protecting workbook (prevents editing sheets in workbook)
3. Protecting spreadsheet file (prevent opening without password)
File > info > protect workbook > encrypt with password

[ Demo ]

Michael Bryan - mbryan.gh@gmail.com


Try:
Task 4
Task 3.
11223.
Task 4

Activity 4
Activity 1.

Activity 4.

Michael Bryan - mbryan.gh@gmail.com


Split window and freeze panes
Work on a large spreadsheet by being able to see two
different parts of the same sheet on the screen at the same time.
Two methods that can be used for this are:
• split window
• freeze panes

[ Demo ]

Michael Bryan - mbryan.gh@gmail.com


Task 5

Task 5

Task 6

Task 6

Michael Bryan - mbryan.gh@gmail.com


Create formulae and use
functions

Michael Bryan - mbryan.gh@gmail.com


Display formulae
• Formular begins with equal sign
• Formular in selected cell is displayed in the formular bar
• Formular can also be displayed on the spreadsheet for evidence by
Steps: Formulas > Formular group > click on show formulas

[ Demo ]

Michael Bryan - mbryan.gh@gmail.com


Formular Vs Function
• Function: pre defined calculation that has been embedded in the
spreadsheet application. Includes function name and cell references
in parenthesis
e.g. =Sum(A2:B20), =Count(C3:C32)
• Formular: user defined calculation that may include cell references,
mathematical operators and functions
e.g. =A1+A2+A3+A4+A5,
=SUM(A5:A8)/5
=AVERAGE(B3:B19)+25+SUM(1,2,3,5)

Michael Bryan - mbryan.gh@gmail.com


Mathematical operators
• Addition +
• Subtraction -
• Division /
• Multiplication *
• Indices ^ =2^3 (2 raised to the power of 3)

Michael Bryan - mbryan.gh@gmail.com


Try

Michael Bryan - mbryan.gh@gmail.com


Try 2

Michael Bryan - mbryan.gh@gmail.com


Absolute and relative cell referencing
Absolute reference
• will not change when the
formula is replicated
• Includes $ signs
Relative reference
• will change when a
formula is replicated
• Does not include $ signs

Michael Bryan - mbryan.gh@gmail.com


Named cells and ranges [ Demo ]

Try

Michael Bryan - mbryan.gh@gmail.com


Use functions Try
• SUM function
• AVERAGE function
• MAX function
• MIN function

Michael Bryan - mbryan.gh@gmail.com


Whole numbers and rounding Try
• INT function
• ROUND function
• ROUNDUP function
• ROUNDDOWN function

Michael Bryan - mbryan.gh@gmail.com


• Round to 2dp
we need to see 2 figures after the decimal point
but if the third figure after the point is 5 or more
then the value 1 is added to the last of the 2 figures.
example: 204.128 (204.13)

• Roundup to 2dp
we need to see 2 figures after the point and the value
1 added to the last of the 2 figure (does not consider
whether the third figure is 5 or more)
example: 204.132 (204.132)

Rounddown to 2dp
we need to see 2 figures after the point without any addition
even if the third figure is 5 or more)
example: 204.135 (204.13)

Michael Bryan - mbryan.gh@gmail.com


Counting
• COUNT function
• COUNTA function

Michael Bryan - mbryan.gh@gmail.com


Nested functions
=ROUND(AVERAGE(B6:B11),1).

Michael Bryan - mbryan.gh@gmail.com


Conditional functions
IF(A6=4,B6*0.04,"No discount offered")

=IF(Condition, “True”, ”False” )

Michael Bryan - mbryan.gh@gmail.com


Ways of using the IF function

Michael Bryan - mbryan.gh@gmail.com


Simple lookup functions
• LOOKUP
• HLOOKUP
• VLOOKUP

Michael Bryan - mbryan.gh@gmail.com


Lookups

Michael Bryan - mbryan.gh@gmail.com


Lookups

Michael Bryan - mbryan.gh@gmail.com


Working with strings
• =B2&" "&C2,
• =CONCATENATE(B2," ",C2)

Michael Bryan - mbryan.gh@gmail.com


Extracting data from strings
• LEFT function
• RIGHT function
• MID function
• LEN function

Michael Bryan - mbryan.gh@gmail.com


Changing case
• UPPER function
• LOWER function

Michael Bryan - mbryan.gh@gmail.com


New functions
• IFS function
• XLOOKUP function

Michael Bryan - mbryan.gh@gmail.com


Error trapping
• ISERROR function: used to detect if an error will occur when a
formula is used, and
• returns True if there is an error or
• Returns False if no error
• Eg. =ISERROR(F5/G5)
• IFERROR function is used to detect an error when formular is
replicated and allows for correction of the error or allow customized
message to be displayed.
• Eg. =IFERROR(F5/G5,"An error has occurred")

Michael Bryan - mbryan.gh@gmail.com


Advanced lookup functions
• Index
• Match

Michael Bryan - mbryan.gh@gmail.com


Index function
The INDEX function returns values from a given location in a table,
where the user specifies the row and column position of the item in the
table.
1. Locate specified row
2. Display data from specified column

=INDEX($A$16:$C$40,2,2)

Michael Bryan - mbryan.gh@gmail.com


Match
The MATCH function searches for a specified item in a range of cells
and returns the relative position of that item in the range.

=MATCH($B$2,$B$10:$B$165,0)

Michael Bryan - mbryan.gh@gmail.com


Index and Match together
When INDEX and MATCH are used together, they allow us to look up a
value in a table using both rows and columns.

=INDEX($A$10:$E$165,MATCH($B$2,$B$10:$B$165,0),1)

=INDEX(B8:M253,MATCH(B3,A8:A253,0),MATCH(B4,B7:M7,0))

=INDEX(B8:M253,4,MATCH(B4,B7:M7,0))

Michael Bryan - mbryan.gh@gmail.com


Searching within a string
1. Find function: returns a numeric value that represents the position
of a character or substring within a string.
• e.g. =FIND(":",B2) Meaning: Find the character colon(:) in cell B2
• case-sensitive searching
• cannot be used with wildcard characters
2. Search function: similar output as the Find function
• is case insensitive
• allows searching with a * (wildcard symbol)
• E.g. =SEARCH("a","Apple") // returns 1
• E.g. =SEARCH("dog","The cat in the hat") //returns #VALUE!

Michael Bryan - mbryan.gh@gmail.com


Analyse the following
• =LEFT(B2,FIND(":",B2)-1)
• =RIGHT(B2,(LEN(B2)-FIND(":",B2)-1))
• =MID(C2,FIND(",",C2)+2,50)

Michael Bryan - mbryan.gh@gmail.com


Task

Michael Bryan - mbryan.gh@gmail.com


Testing cell contents
• There are functions that can be used to test whether a cell contains
text, numbers or non-text items.
• The function will return ‘True’ or ‘False’
• can be used in string manipulation
• ISTEXT function checks to see if a cell contains text (including special
characters) and return true if cell content is text E.g =ISTEXT(A5)
• ISNUMBER function checks to see if a cell contains numeric data e.g
=ISNUMBER(A5)
• ISNONTEXT function checks to see if a cell is blank (has no contents)
e.g. =ISNONTEXT(A5),

Michael Bryan - mbryan.gh@gmail.com


Comparing strings
• The EXACT function compares two strings to check that they are
exactly the same (including case)
• E.g. =IF(EXACT(B2,B3),"Y","N")

Michael Bryan - mbryan.gh@gmail.com


Convert strings to ASCII values
• The =CODE() function returns the ASCII (numeric) code for a given
character. If more than one character is present in a string, this
function returns the code of the first character.
• The =CHAR() function returns the ASCII character for a given numeric
code.

Michael Bryan - mbryan.gh@gmail.com


Working with number bases
• The DEC2BIN function converts a decimal (base 10) number into its
binary (base 2) equivalent.
• The DEC2HEX function converts a decimal (base 10) number into its
hexadecimal (base 16) equivalent.
• BIN2DEC function
• BIN2HEX function
• HEX2BIN function
• HEX2DEC function

Michael Bryan - mbryan.gh@gmail.com


Date and time functions
• Date and time values are actually stored as a number in in Excel
• The integer part of the number stores the date and the decimal part
of the number stores the time.
• Times are stored as parts of the day
Examples
• number 1 = 1 January 1990
• 0.5 = 12 noon
• 2.5 = 12 noon on 2 January 1900.
• 44 562.25 = 1 January 2022 at 6 a.m.

Michael Bryan - mbryan.gh@gmail.com


Date and time functions
• WEEKDAY is used to return a number between 1 and 7 from a given
date. If the day is a Sunday, 1 is returned, Monday is 2, and so on.
• DAY is a function that is used to return the day part of a given date, as
a number between 1 and 31.
• MONTH is a function that is used to return the month part of a given
date, as a number between 1 and 12.
• YEAR is a function that is used to return the year part of a given date.

Michael Bryan - mbryan.gh@gmail.com


Calculate the number of days between two
dates
• Subtract the first date from the second (e.g. =B2-B1)
• Returns the result of the calculation in date format (e.g 05/07/1901)
• Format the cell to display the number of days
Note:
• use ABS function to avoid negative results
E.g. =ABS(B1-B2)

Michael Bryan - mbryan.gh@gmail.com


Calculate the number of years between two
dates
• Number of days divided by 365.25 (approximate number of days per
year).
• E.g. =INT((B2-B1)/365.25)

Michael Bryan - mbryan.gh@gmail.com


Tasks and activities
• 191 – 195 Textbook

Michael Bryan - mbryan.gh@gmail.com


Time functions
• HOUR function is used to return a number between 0 and 23 from a
given time.
• MINUTE function is used to return a number between 0 and 59 from
a given time.
• SECOND function is used to return a number between 0 and 59 from
a given time.
• The format of the resulting answer can be specified using the TEXT
function e.g.
=TEXT(ABS($B$2-$B$1),"h")
=TEXT(ABS($B$2-$B$1),"hh:mm:ss")

Michael Bryan - mbryan.gh@gmail.com


Validation rules
• Adding validation rules to your spreadsheet helps to reduce data
entry errors.
To set validation rule in excel
1. From Data tab > Select data validation to display dialog
2. Set Validation Criteria
3. Set Input Message (text that guides user to enter acceptable data)
4. Set Error Alert (text to be displayed when rule is broken)

Michael Bryan - mbryan.gh@gmail.com


Adding comments
• Right-click on the cell with the
right mouse button and
• Selecting New Comment from
the drop-down menu.
• Type your comment or note in
the box

Michael Bryan - mbryan.gh@gmail.com


Self study
• Read and Complete all tasks and Activities on pages 198 – 217

Michael Bryan - mbryan.gh@gmail.com


Pivot tables
• A pivot table can be used to summarize data into a two-dimensional
table.
• Allows us to see patterns and trends in data when analyzing data.

Michael Bryan - mbryan.gh@gmail.com


Classwork

Michael Bryan - mbryan.gh@gmail.com


Homework

Michael Bryan - mbryan.gh@gmail.com


Automate operations with a spreadsheet
Homework 2
• Read Page 221 – 222
• And complete the following task

Michael Bryan - mbryan.gh@gmail.com


Graphs and Charts

Michael Bryan - mbryan.gh@gmail.com

You might also like