UGBS 008 Combined®

You might also like

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

UGBS 008: Data Processing

SESSION 1: Introduction to Data Processing


Instructors: STEPHEN.A.ADINGO Email: saadingo@ug.edu.gh
MICHAEL K.KOLUGU Email: mkkolugu@ug.edu.gh

College of Education
School of Continuing and Distance Education
Outline
• The Definition of Data Processing

• Stages of Data Processing

• Differences between Data and Information

• Data Processing cycle

• Data storage hierarchy

• Importance of data processing


S.A ADINGO Slide 2
1.1 Defining Data Processing
These are raw or unorganized facts which represent an idea, object, a
condition or a situation and can be processed by the computer.

• Types of Data
– Text data: This consists of alphabetic letters, numbers, and special characters.
They are typically entered to produce output such as letters, e-mail messages and
reports.

– Graphics data: This consists of still images, including photographs,


mathematical charts, and drawings such as illustrations.

– Audio data: This refers to sound, such as voice and music

– Video data: This refers to moving pictures and images, such as a


videoconference, film clip or full-length movie

S.A ADINGO Slide 3


Data Representation in Computers

Type of Data Inside computers

Text a, b, c 01100001,01100010,01100011
Number 1.2.3….
00000001,00000010,00000011

Sound
01001100010101000110100…

Image 10001001010100000100111...
Video
0110000001001101011001…
S.A ADINGO Slide 4
Data Vs Information
• Information is a summarized/processed/manipulated
data that is meaningful and useful for decision making.

• Characteristics of information:
– Relevant
– Accurate
– Complete
– Concise
– Timely
– Cost effective
S.A ADINGO Slide 5
1.2 Stages of Data Processing
1. Data Collection

2. Data Preparation

3. Data inputting

4. Data Processing

5. Data Outputting

S.A ADINGO Slide 6


1.3 Differentiate between Data and
Information
Data Information
A collection of A processed data that
unorganized facts in the contains patterns,
form of figures, text, associations, or
images, audio, video, and relationships to enable
symbols. decision-making

S.A ADINGO Slide 7


What is Data Processing ?
• Data processing is a series of actions that convert data
into useful information.

• It involves the collection and transformation of data


items to produce meaningful information.

• For example, by collecting and processing students’


course registration data for classroom allocation; we can
refer to this process as data processing.

S.A ADINGO Slide 8


1.4 Data Processing Cycle
3-main stages

S.A ADINGO Slide 9


Information Processing Cycle (IPC)
• The Information Processing Cycle refers to the order of events that
go into processing information, including input, processing, storage
and output.
• It may includes a fifth stage, which consists of distribution of
information.
• These are:
1. Receiving Stage ( Input Operation):
2. Processing Data (Processing Operations)
3. Display Information (Output Operation)
4. Storing Information (Storage Operation)
5. Distribution of Information:
S.A ADINGO Slide 10
1.5 Data Storage Hierarchy
• Bit: a binary digit (0 or 1) n 2n
8 28=256
n 2n
9 29=512
0 20=1
10 210=1024
1 21=2
2 22=4 11 211=2048
3 23=8
12 212=4096
4 24=16
5 25=32 20 220=1M
6 26=64 30 230=1G
7 27=128 40 240=1T
S.A ADINGO Slide 11
Units of Data Storage
• Bit: a binary digit (0 or 1)
• Byte: 8 bits ;Basic storage unit in computer system

• Kilobyte: 210bytes = 1024 bytes ≈ 103 bytes


– Example: 3 KB ≈ 3 x 10 bytes
3

• Megabyte: A megabyte (MB) is 220 = 1,048,576 1 Million Bytes


Example: 3 MB ≈ 3 x 106 bytes

• Gigabyte: A Gigabyte (GB) is 230 = 1,073,741,824  1 Billion


– Example: 3 GB 3 x 109 bytes
• Terabyte: : 240 bytes ≈ 1012 byte
– Example: 3 TB ≈ 3 x 1012 bytes
S.A ADINGO Slide 12
Units of Data Storage

S.A ADINGO Slide 13


Other Related Bytes
– A nibble is a half-byte (4-bit) - hex representation

– A word is a 2-byte (16-bit) data item

– A doubleword is a 4-byte (32-bit) data item

– A quadword is an 8-byte (64-bit) data item

– A paragraph is a 16-byte (128-bit) area


S.A ADINGO
14
1.6. Importance of Data processing
• Generate information by converting data into meaningful
facts
• Source of evidence of activities for accountability
• Add value to an otherwise facts/figures
• Condense or reduce volume of data
• Identifying patterns that are not easily detected from data
• Making informed decisions because of the insight obtained
from the processed data
• Planning for short, medium and long term
• Projection or forecasting based on the information processed
S.A ADINGO
15
Any

Slide 16
S.A ADINGO
S.A ADINGO 17
UGBS 008: Data Processing

2. Processing Data with Spreadsheet


(MS Excel)
Lecturer: STEPHEN.A.ADINGO
Computer Science Dept./Dept. of Distance Education
Contact Email: saadingo@ug.edu.gh

College of Education
School of Continuing and Distance Education
Slide 1
Outline
•Overview of Microsoft Excel •Working with basic data
formats

•How to start Microsoft Excel •Working with cells and


ranges

•Parts of the Excel window • Interpreting error values

•Entering text, numbers, and


•Creating a workbook dates in a worksheet

2
UGBS 008 : 2021
2.0.Introduction: What is a Spreadsheet?
• An application software that enables users to
record, process, and present data in an
organised and easily updatable manner.

• A program that allows you to use data to


forecast, manage, predict, and present
information.

• It is a software program that can make number


manipulation easy and somewhat painless.
3
UGBS 008 : 2021
2.1 Overview of Ms Excel

• Excel is a spreadsheet, a grid made from


columns and rows.

• The nice thing about using a spreadsheet for


data processing is that you can experiment with
numbers without having to RE-DO all the
calculations.

4
UGBS 008 : 2021
Parts of Ms Excel

5
UGBS 008 : 2021
Parts of Ms Excel

6
UGBS 008 : 2021
Basic Components of Excel
• Spreadsheets are made up of:

– Columns

– Rows

– cells

7
UGBS 008 : 2021
What is a COLUMN ?
• In a spreadsheet the • COLUMN labeled D is
COLUMN is defined as highlighted.
the vertical space that is
going up and down the
window.

• Letters are used to


designate each
COLUMN'S location.

8
UGBS 008 : 2021
What is a row?
• In a spreadsheet • ROW labeled 4 is
highlighted.
the ROW is defined as
the horizontal space
that is going across
the window.

• Numbers are used


to designate each
ROW'S location.

9
UGBS 008 : 2021
What is a CELL ?
• A CELL is the space • In the above diagram
where a row and the CELL labeled C2 is
column intersect. highlighted.

• Each CELL is assigned a


name according to its
COLUMN letter and
ROW number.

10
UGBS 008 : 2021
A1

B3

E7

UGBS 008 : 2021 11


12

2.2 How to Start Excel


There are Several Methods:
Method 1: Method 2

UGBS 008 : 2021


UGBS 008 : 2021

2.3 Creating a Workbook


• Excel’s main screen is • To create a new workbook:
called a “worksheet”. – On the ribbon, click the File
tab to display the Backstage
view
• Each worksheet – Click New in the navigation
comprised of many bar to display the New
boxes, called “cells”. screen
– Click the Blank workbook
• A collection of tile or select an existing
template.
worksheets is called
‘workbook’
13
UGBS 008 : 2021

Creating a Workbook

14
UGBS 008 : 2021

2.4 Working With Basic Data Format


• You can
organize
information by
typing a single
piece of data
into each cell.

15
Data Types

16
UGBS 008 : 2021
17

Data Types
TYPE EXAMPLES
• Numeric
– values: any number
– operators: + - * / ^ %
– sample functions: sum( ), average( ), max( ), min( ) etc.
• Text (aka Character or String)
– values: Any group of letters or numbers or special characters.
Prefix value in cell with an apostrophe ( ' ) to force a text
– operators: & (concatenation)
– sample functions: right( ), left(), mid(), lower(), upper(), len(), etc
• Dates
– values: dates and times
operators: N/A
– sample functions: now( ), today( ), hour(), minute(), etc.
• Logical (aka boolean)
– values: true false
– Operators: < > = <> <= >=
– sample functions: if( ), and( ), or( ), not( ), isblank()
UGBS 008 : 2021
2.5 Working with Columns and Rows

Find out: How many columns in 1998-


2003 excel ?

Find out: How many rows in 2007-2019


excel

18
UGBS 008 : 2021
19

Selecting a Cell
• “Select” a cell by
clicking on it
once (don’t
double click).

• You can move


from cell to cell
with the arrow
keys or by
pressing the
“Enter” key.
UGBS 008 : 2021
20

Entering Information / The Formula Bar


• To enter information in a
cell, just start typing.

• When you are done


either
– Press the Enter Key
– Press an arrow key
– Click on the “check
button” (only visible when
entering data into a cell)

• The information in the


selected cell is also
displayed in the “formula
bar” above the
worksheet.
UGBS 008 : 2021
UGBS 008 : 2021

Double Click to Modify a Cell


• To modify the contents of
a cell double click on the
cell.

• Then use the right, left


arrow keys and the Insert
and Delete keys to Double click to
modify the data. change “hi there” to
“hello there”

• When you are done:


– Press the Enter key
or
– Click on the check box.
21
UGBS 008 : 2021

Data that is “too wide” for a cell


• The word “Name” is in cell
A5
• The words “Hours Worked”
are in cell B5 (NOT in cell
C5). However, since the
information is too wide for “Hours
cell B5, it looks like it extends Worked” is in
cell B5 (look
into cell C5. at formula
• You can determine that the bar)
information is really only IN
cell B5 by selecting cell B5
and looking at the formula “Hours
bar and then selecting cell Worked” is
C5 and looking at the NOT in cell
C5 (formula
formula bar. 22 bar is empty)
23

Data that is “Chopped Off”


• If there is information in the • You can see the complete data
cell to the right, then the by selecting the cell and
original cell still contains all looking in the formula bar.
of the data, but the data
appears to be “chopped off”.

UGBS 008 : 2021


Make a column wider Drag column
separator to the
right
• To make Column B wider,
point the cursor to the
column separator between
columns B and column C.

• The cursor changes to a


“Double headed arrow”.

• Now, click the left mouse


button and without letting
go of the button, drag the
separator to the right to
make the column wider (or Column is now wider
to the left to make the column
narrower). 24
UGBS 008 : 2021

Getting the Exact Width


• To get the “exact” width, Double click here
double click on the
separator instead of
dragging it.

Column is now EXACTLY the correct width

25
UGBS 008 : 2021

Resizing a Row
• Make a row
taller or
shorter by
dragging
the
separator
between
the rows.

Row is now
• Click and taller
drag here
to resize
row 5.
26
UGBS 008 : 2021

Putting an “Enter” inside a cell


• To add a new line Step 1: Originally
“Hours Worked” is
inside a cell on one line.
– Double click inside
the cell where you
want the new line. Step 2: Double click
to edit cell and then
– Press alt-Enter (i.e. press alt-Enter
hold down the alt-
key and press
Enter).
– When you are done
editing, press Enter
(without holding Step 3: Press Enter
down alt) to accept (without atl) to
accept the changes.
the changes.

27
28

2.6 Working With Cells and Ranges


• To select a large range of cells,
– Click on the upper left cell in the range.
– Then hold the shift key and
– Click on the lower right cell in the range.

• You can select different “non-contiguous” areas of


cells by
– holding down the Ctrl key while
– clicking and dragging.
UGBS 008 : 2021
UGBS 008 : 2021

Selecting Non-Contiguous Ranges


• Click and
drag to
select the
first range.

• Ctrl-click
and drag
to select
(This cell is also selected
additional even though it appears
ranges white).

29
30

Select Entire Columns/Rows/Worksheet


To select ENTIRE ROW 2
Tto Select ENTIRE COLUMN B click on “2” row header
click on “B” column header
Click Click

To select COLUMNS B,C,D To select ROWS 2,3 and 5,6,7


click on “B” column header and drag to right
drag – and
Click click on down
drag “2” row header, drag down,
Click – then Ctrl-Click on “5” row header and drag down
then Ctrl-Click
and drag down

To select COLUMNS B,C and F,G,H


– click on “B” column header, drag to right, To select ENTIRE WORKSHEET
– then Ctrl-Click on “F” column header and drag right click on select worksheet button
(in corner between “1” and “A” buttons)
Ctrl-
Click
drag Click drag Click

UGBS 008 : 2021


31

Example - continued
• Step 1: Click
on row
header for
row 5

• Step 2:
Ctrl-click on
row-header
for row 11

• Step 3: Press
Bold button
or type ctrl-b

UGBS 008 : 2021


2.7 Common Excel Data Processing Errors

32
UGBS 008 : 2021
33

Fixing Common Excel Data Processing


Errors

UGBS 008 : 2021


34

Excel Assignment 1:

1. Write at least a page notes on MS Excel [10marks]

UGBS 008 : 2021


Any

Slide 35
UGBS 008 : 2021
UGBS 008 : 2021 36
UGBS 008:
Data Processing
3:Processing Data With Microsoft Excel
Formulas
Lecturer: STEPHEN.A.ADINGO
Computer Science Dept./Dept. of Distance Education
Contact Email: saadingo@ug.edu.gh

College of Education
School of Continuing and Distance Education
Slide 1
2

Outline
• Overview of a Excel formula

• Guidelines for writing effective formulas



• Order of Operator precedence

• Editing an existing formula

• Cell references in formula writing

• Auto filling formulas


UGBS 008: 2021
3

3.1 Overview of Excel Formulas


• You must have an equal sign ( = ) as the first character in
a cell that contains a formula.

• The = sign tells excel that the contents of the cell is a


formula

• Without the = sign, the formula will not calculate


anything.

• It will simply display the text of the formula.


UGBS 008: 2021
4

Example: Fomulas “tells” Excel that a calculation will need to be


performed.

UGBS 008: 2021


5

Operations Used in Excel Formulas


• You can use any of the following operations in a formula:

Operation Symbol Example


Addition: + =A1+3

Subtraction: - =100-B3

Multiplication: * =A1*B1

Division: / =D1/100

Exponentiation ^ =A2^2

Negation (subtraction) - =-A2+3


UGBS 008: 2021
6

3.2 Guidelines for Writing Effective Formulas


• Keep them simple

• Do not hide data values within formulas –

• Break up formulas to show intermediate results

• You can use both explicit values and cell references in a formula

• An explicit value is also called a literal value

– Formula with only cell references: =A1*B1

– Formula with only literal values: =100/27

– Formula with both cell references and literal values: =A1/100


UGBS 008: 2021
7

3.3 Order of Operations in Excel


• When using several operations in one formula, Excel follows the
order of operations for Maths.
– First: all parentheses - innermost first

– Second: exponents (^)

– Third: all multiplication (*) and division (/). Do


these starting with the leftmost * or /
and work to the right.
– Fourth: all addition (+) and subtraction (-). Do
these starting with the leftmost + or -
and work to the right.
UGBS 008: 2021
8

Order of Operations in Excel


• The sentence "Please excuse my dear aunt Sarah" is a
popular mnemonic to remember the order of operations:

Menumonic Meaning
– Please parentheses

– Excuse exponents

– My Dear multiplication and division


(going left to right)

– Aunt Sarah addition and subtraction


UGBS 008: 2021 (going left to right)
9

Complex Formulas
• You can use several operations in one function
• You can group those operations with parentheses
• Examples

=3*2+1

=C1*(A1+B1)

=(100*A2-10)+(200*B3-20)+30

=(3+2*(50/B3+3)/7)*(3+B7)
UGBS 008: 2021
10

3.4 Editing a Formula

UGBS 008: 2021


11

3.5 Cell Referencing


• Cell on another sheet: sheetName!cellReference
Examples sheet2!A1

• Range on another sheet: sheetName!range


Examples sheet2!B4:C8
• Row on another sheet: sheet Name! row: row

Examples '2019 Sales'!2:2


• Column on another sheet: sheetName!column: column
Examples '2002 Forecasts'! B:B

• If a sheet name has a space in it, you must surround the sheet name
with apostrophes (i.e. single quotes)
Examples
=sum('2202 Forecasts'!f:f)

UGBS 008: 2021


12

More examples
• Add up values from 2 different sheets
=sum ( 'great stocks'!b2:c4, 'so so stocks'!b2:c4)
• This next one is a little confusing
=sum (a1,a!a1,b1:b4,b1!b4,c!c:c)
Explanation
a1 this is a cell reference on the current sheet
a!a1 "a" is the name of sheet. "a1" is a cell on the "a" sheet
b1:b4 this is a range on the current sheet
b1!b4 "b1" is the name of a sheet. "b4" is a cell on the "b1"
sheet
c!c:c “c" is the name of a sheet. “c:c" is all of the cells in the c
column on the “c” sheet
UGBS 008: 2021
13

Types of Cell References


• By default, when you copy a formula that contains a cell
reference, excel will automatically adjust the cell reference.

• You can stop Excel from automatically adjusting the cell


reference by using one or more dollar signs ($) in the cell
reference.

• These are called absolute cell references.

• A cell reference without a dollar sign is a relative cell


reference.

UGBS 008: 2021


14

Relative Cell Reference


• d9 This is a "relative cell reference".
– Changing the column: If you copy this cell reference to another
cell:
• the "d" will increment one letter for every cell that is move over
to the right.
• The "d" will decrement one letter for every cell that I move over
to the left
– Changing the row: If you copy this cell reference to another
cell:
• the "9" will increment by one for every cell that I move down.
• The "9" will decrement by one for every cell that I move up

UGBS 008: 2021


15

Relative References

UGBS 008: 2021


16

Absolute cell reference


• $d$9 This is an absolute cell reference.

– If you copy a formula with this cell reference, the cell


reference will NOT change AT ALL.

UGBS 008: 2021


17

Absolute cell reference

UGBS 008: 2021


18

Mixed References

UGBS 008: 2021


19

3.6 Auto Filling Formulas and Data


• AutoFill provides a quick way to enter content and formatting in cells based on
existing entries in adjacent cells.

• After you select a range, a fill handle appears in the lower-right corner of the
selection.

• When you drag the fill handle over an adjacent cell or range, AutoFill copies the
content and formats from the original cell or range into the adjacent cell or range.

• More efficient than the two-step process of copying and pasting.

• By default, AutoFill copies both the content and the formatting of the original
range of the selected range

UGBS 008: 2021


20

Filling a Series
• AutoFill technique can create a series of numbers, dates,
or text based on a pattern.

• The fill series option learns the pattern of data provided


and provides subsequent values.

UGBS 008: 2021


21

Assignment 2:
Enter the information below into and excel and used it to answer the
questions that follow in the same sheet

Compute the following:


a)The Total Expenses in cell B12
b)The Total Income in cell B13
c)The Balance in cell B14
UGBS 008: 2021
UGBS 008: 2021 22
UGBS 008
Data Processing
4
Processing Data With Microsoft Excel Functions

Lecturer: STEPHEN.A.ADINGO

Computer Science Dept./Dept. of Distance Education


Contact Email: saadingo@ug.edu.gh

College of Education
School of Continuing and Distance Education
2

Outline
• Overview of Excel functions

• Categories of Excel functions

• How to use Excel functions

• Basic Excel functions

• Logical functions

• Comparison operators
2020/2021
3

4.1 Overview of Functions


• An excel function is a "named operation“

• Pre-written excel operations that augments formulas

• Functions have
– a name
– parentheses
– parameters/arguments
• you can have many parameters for one function separated
with commas (,)

• The number of parameters is one more than the number of


commas.
2020/2021
4

Functions Terminologies
Consider : The name of the function SUM(1,2,3,4,5)
– Function name is "SUM"

– The parameters or arguments to this function are


1,2,3,4 and 5

– The entire thing, i.e. SUM(1,2,3,4,5), is a function call

– The value of this function call is 15. Another way to say


this is that this function call returns 15.
2020/2021
5

4.2 Categories Of Functions In Excel


• There are a total of 333 plus functions in Excel. These functions are separated into
12 categories as follows:

2020/2021
6

4.3 How to work with functions

2020/2021
7

4.4 Basic Excel Function


Statistical/Financial TEXT Logical
SUM, right( ) IF,
AVERAGE, left( ) Nested IF
MIN, mid( ) Lookup.
MAX, concatenate( )
COUNT, lower( )
COUNTBLANK, upper( )
COUNTA len( )

2020/2021
8

The SUM Function


Examples
Function Result
=SUM(1,2,3,4,5) 15

=SUM(a1,b1,c1) a1+b1+c1

=SUM(9,a1,b2,5,c1) 9+a1+b2+5+c1

• Ranges can be specified as a parameters to a function call.

• Both of the following function calls produce the same result as


without a range
=SUM(a1,b1,c1,a2,b2,c2,a3,b3,c3,a4,b4,c4)
with a range
2020/2021
=SUM(a1:c4)
9

Text Functions:
RIGHT ( <text>, <numCharacters>)
Formula View

Values View

2020/2021
10

MID ( <text>, <startPosition> , <numCharacters>)

• This example extracts the second through the fourth


characters from the original text value:
Formula View

Values View

2020/2021
11

Concatenation (&)
• Use & to combine (or concatenate) two different text values

Formula View

Values View

Notice that there is no


space between the two
2020/2021 values
12

Concatenating spaces - Example


• You can concatenate spaces into a formula
Formula View

Values View values


contain
spaces

2020/2021
13

Putting it all together


• In this example we concatenate periods into the initials.
Formula View

Values View

The initials now contain


periods
2020/2021
14

CONCATENATE Function
• You can use the CONCATENATE function instead of the
ampersand (&).
• The following formulas are equivalent:

=A1&B1&C1

=CONCATENATE(A1,B1,C1)

• The CONCATENATE function can take as many


parameters as you like.
2020/2021
15

LOWER ( <textValue> )
UPPER ( <textValue> )
• LOWER converts text to lower case.
• UPPER converts text to upper case.
• Example:
Formula View

Values View

2020/2021
16

LEN ( <textValue> )
• LEN returns a numeric value equal to the number of
character in a text value (i.e. the “length” of the text
value).
• Spaces ARE included in the length.
• Example

Formula View

2020/2021 Values View


4.5 Logical (aka Boolean) Functions
• The following statements are • The following statements
TRUE: are FALSE:
Fish live in water.
Deer live on land. Fish live on land.
Deer live in water.
3 is greater than 2
2 is less than 3
2 is greater than 3
2 is less than or equal to 3
3 is less than 2
2 is less than or equal to 2
3 is greater than or equal to 2
3 is less than or equal to 2
3 is greater than or equal to 3 2 is greater than or equal to 3
2 is equal to 2 2 is equal to 3
2 is not equal to 3 2 is not equal to 2

2020/2021 Slide 17
18

Using the IF function


Syntax:
=IF (logical_test, [value_if_true,], [value_if_false])

Example:
To determine if a student has passed or failed in an
exams, the formula is expressed as:

=IF (A2>=50, “PASS”, “FAIL”)


2020/2021
19

IF with a numerical result


Formula View Values View

2020/2021
Using Nested IFs
The nested IF Function is simply an IF comprised of another
IF functions

The syntax of the IF function is:


=IF (logical_test, [value_if_true,], IF (logical_test),
[value_if_true],...., [value_if_true])
Example:
If the grading system in University of Ghana states that a
student’s mark between 100 and 80 is grade A, 79 to 60 is B,
59 to 50 is C, and 49 is F.
IF (A2>=80, “A”, IF (A2>=60, “B”, IF (A2>=50, “C”, “F”)))
20
2020/2021
Creating Nested IFs

21
2020/2021
22

Using the AND Logical Operator


• The following is TRUE
Fish live in water AND deer live on land.
• The following are all FALSE
Fish live in water AND deer live in water.
Fish live on land AND deer live on land.
Fish live on land AND deer live in water.
• Takes any number of parameters
• Returns TRUE if ALL of the parameters evaluate to TRUE
otherwise returns FALSE.
• Syntax:

2020/2021
23

AND
Formula View Values View

2020/2021
24

IF with AND - nested function calls


• You can use an AND inside of an IF.
• This is called a NESTED FUNCTION CALL
• Example

=IF( AND (A2>A3,B2<>B3) , 500, 1000)

AND is "nested" inside of the IF

These parentheses "belong to" the if


2020/2021
25

IF with AND - spreadsheet views


Formula View Values View

2020/2021
26

Using the OR and NOT Functions


OR Function
• Takes any number of parameters
• Returns TRUE if ANY of the parameters evaluate to TRUE
otherwise returns FALSE
• Syntax:

NOT Function:
• Takes ONLY ONE parameter
• Returns the "opposite" of the value of the parameter
– returns FALSE if the parameter value is TRUE
– returns TRUE if the parameter value is FALSE

2020/2021
27

Complex Nested Function Calls

• Examples:

• =IF(AND(A2>A3, OR(B2=B3,C2<C3)), 500, 1000)

• =IF(NOT(AND(A2>A3, OR(B2=B3,C2<C3))), 500, 1000)

• =IF(AND(A2>A3, NOT(OR(B2=B3,C2<C3))), 500, 1000)

2020/2021
Using Lookup Functions & Lookup Tables
• Lookup functions
– Allow you to use tables of data to “look up” values
and insert them in another worksheet location
• Lookup tables
– Store data and organize it into categories (compare
values)
– Can be constructed as either exact match or
approximate match lookups
• Lookup values (value you are trying to find)
– Need to match one of the compare values
– Can be used as part of a formula
28
2020/2021
Using Lookup Functions & Lookup Tables
• For Example:
=LOOKUP (A2, {0, 50, 60, 80}, {"F","C","B","A"})

• Where A2 is the cell containing the mark of the student,


{0,50,60,80} is the lookup vector or the values to check for
and
• {"F","C","B","A"} is the lookup result or the corresponding
results to assign to the respective lookup vector.

29
2020/2021
Kinds of Lookups:
VLookup Function: Find an Exact Match
• Searches a lookup table and, based on what you entered,
retrieves the appropriate value from that table

• Searches vertically down the first column of the lookup


table
• Syntax:

30
2020/2021
HLOOKUP Function
• Searches horizontally across top row of lookup table and
retrieves the value in the column you specify

• Syntax:

31
2020/2021
32

4.6 Logical operators


• In Excel the following "operators" are used
Operator Meaning
> greater than
< less than
>= greater than or equal to
<= less than or equal to
= equal to
<> not equal to
• Examples
3>2 true
2020/2021
3<2 false
33

4.6 Logical operators

2020/2021
34

Assignment 3.
1. What is a function in excel? Identify the main parts of an excel function.

2.Write down two examples each of the following types of functions:


– Text functions
– Logical functions
– Statistical functions

3. Explain the following functions as they are evaluated to mean.


– AND
– OR
– NOT

(Continue question4- from next page)

2020/2021
35

Assignment 3 cont’’.
4. Translate the content in the following spreadsheet into an excel sheet(version:2010-and above).

i. Fill in to add up the expenses for each month (dark blue area). Fill in the sum for each expense as well
(yellow area).
ii. Fill (right/down) to add up the income for each month as well as the total from each income source
(green and light blue areas). If you used a straight formula for the last step, try using a function this
time. And, if you used a function last time, then try using a straight formula this time.
iii. Calculate and subtract the expenses from the income for each month, that is, the purple cell minus the
red cell. This calculation should be located in your cell B26 (grey cell).
2020/2021 (Inset an appropriate tittle in 2-lines for your sheet using row 1 and 2)
2020/2021 36
UGBS 008
Data Processing
5
Processing Financial Data with Microsoft Excel

Lecturer: STEPHEN.A.ADINGO
Computer Science Dept./Dept. of Distance Education
Contact Email: saadingo@ug.edu.gh

College of Education
School of Continuing and Distance Education
2

Outline
• Payment function

• Present and Future value functions

• Interest and Principal payment Functions

• Loan Amortization process

2020/2021
5.1 Overview of Financial Functions
• Functions that can be used to calculate values based on interest:

– Taking a loan

– Investing in a savings account


• Cost of a loan to the borrower is largely based on three factors:

– Principal: amount of money being loaned

– Interest: amount added to the principal by the lender


• Calculated as simple interest or as compound interest

– Time required to pay back the loan

2020/2021 3
Understanding time value of money
• Money will increase in value over time if the money is invested and
can make more money.

• If you have GH¢1,000 today, it will be worth more tomorrow if you


invest that GH¢1,000 and it earns additional money (interest or
some other return on that investment).

• If you have GH¢1,000 today, it will NOT be worth more tomorrow if


you put it in an envelope and hide it in a drawer or put under your
pillo.

• Then the time value of money does not apply as an increase. It


will most likely decrease in value because of inflation.

4
Introduction to Interest Calculations
• When you borrow money you pay interest

• When you loan money, you receive interest

• When you make a payment


– part of the payment is applied to interest
– Part of the payment is applied to principal

Types of Interest:
• Simple interest
– Interest is paid only on the principal
– Many certificates of deposit work this way

• Compound interest
– Interest is added to the principal each period
– Interest is calculated on the principal plus any accrued interest
– Compounding can occur on different periods
• Annually, quarterly, monthly, daily Slide 5
Simple Interest vs. Compound Interest
• Simple interest always calculates interest based on the original
amount.
• For example: Interest on GH¢1,000 at 4% per year for 2
years.
– Year 1: GH¢1000 * 4% → GH¢40 in interest for the 1st year.

– Year 2: GH¢ 1000 * 4% → GH¢ 40 in interest for the 2nd year.

After 2 years you would have:


GH¢1,000 * 4% = GH¢80 interest
For a total of GHGH¢¢1,080

2020/2021 6
Simple Interest vs. Compound Interest

• Compound interest always calculates interest based on the


“latest amount”.
So GH¢1,000 at 4% per year for 2 years compounded Yearly
• Year 1: GH¢1,000 * 4% → GH¢40 in interest for the 1st year.
• Year 2: GH¢1,040 * 4% → GH¢ 41.60 in interest for the 2nd year.
Simple Vs. Compound Interest
After 2 years you would have: GH¢1,000 after 2 Years at 4%
GH¢1,000 * 4% = GH¢81.60 $82.00

interest $81.00

$80.00
For a total of GH¢1,081.60 $79.00

Simple Interest
Compound Interest

2020/2021 7
Simple vs. compound interest
comparison
Year Simple Interest Compound Interest
0 $1,000 $1,000
1 $1,050 $1,050
2 $1,100 $1,102.50
3 $1,150 $1,157.62
4 $1,200 $1,215.61
5 $1,250 $1,276.28
10 $1,500 $1,628.89
20 $2,000 $2,653.30
30 $2,500 $4,321.94
$1,000 Invested at 5% return 8
Compounding Periods
• Compounded Yearly

• Compounded Quarterly

• Compounded Semi-Annually

• Compounded Monthly
• The total amount of your financial transaction will be
different based on when the interest is compounded.
2020/2021 9
Basic Financial Functions
• Present Value (PV)
– What you get/pay at the beginning of the financial transaction

• Future Value (FV)


– What you are going to get OR what you will have to pay at the end of the
financial transaction

• Payment (PMT)
– Payment made each period. It remains constant over life of annuity
• RATE
– Interest rate per period
• NPER
– Number of payment periods
2020/2021 10
Financial Functions-Syntax
=PV(rate, nper, pmt, [fv], [type])

=FV(rate, nper, pmt, [pv], [type])

=PMT(rate, nper, pv, [fv], [type])

=RATE(nper, pmt, pv, [fv], [type], [guess])*Compounding Periods

=NPER(rate, pmt, pv, [fv], [type]) / Compounding Periods

2020/2021 11
Understanding the Arguments in
Financial Functions
Argument Description Argument Rules
rate Interest rate per Always divide the rate by the number of compounding
compounding period periods
Rate/ # of compounding periods
nper Number of Always multiply the number of years by the
compounding periods compounding period
# of compounding periods * # of years
pmt Periodic payments to Payment amount cannot vary
the initial sum
pv Original value of
financial transaction
fv Value at the end of the
financial transaction

type Designates when 0: Payments are made at the end of the period
payments are made 1: Payments are made at the beginning of the period
(0 is the default and is implied)
2020/2021 12
Note: When Using Financial Functions
Arguments
• Use consistent signs
– Outgoing cash ( - )
– Incoming cash ( + )
• For arguments that are zero, at least a comma must be put in the
function to maintain the argument order, unless no other non-zero
arguments follow.
=PV(.03, 2, 0, 5000, 0)
same as
=PV(.03, 2, , 5000)

2020/2021 13
5.2 Payment function
PMT(rate, nper, pv, [fv], [type])
Argument Description
rate Interest rate per compounding period
nper Number of compounding periods
pv Present value
fv Future value, residual left over after the loan is
completed. Could be a balloon payment. Can be
omitted if = 0.

type Designates when payments are made


Type 0 – end of period. Default.
Type 1 – beginning of period
14
Car loan calculator using PMT Function
PMT(rate, nper, pv, [fv], [type])

15
5.3 The RATE Function
• Determines the interest rate PER PERIOD based on
– The number of periods

– The payment

– The present value

– The future value

– The type
Slide 16
Calculating interest rate using RATE
function

Slide 17
5.4 The NPER Function
• Determines the number of periods based on
– The interest rate

– The payment

– The present value

– The future value

– The type
Slide 18
Calculating loan duration using NPER
function

Slide 19
5.5 Present Value Function
PV(rate, nper, pmt, [fv], [type])
Argument Description
rate Interest rate per compounding period
Nper Number of compounding periods
pmt Payment made each period
fv Future value of the amount received today
type Designates when payments are made
Type 0 – end of period. Default.
Type 1 – beginning of period

20
Calculating present value using the PV
function

21
5.6 The IPMT and PPMT Functions
• Use IPMT to calculate the interest applicable to a
particular period
– Use the initial balance for the present value no matter the
period

• Use PPMT to calculate the principal applicable to a


particular period

• The arguments to both functions are the same

Slide 22
Interest and principal payment
calculation using IPMT and PPMT

Slide 23
5. 7 Future value of money
• Simple interest is always calculated on the initial
GH¢1,000.

( Example:5% interest on GH¢1,000 is GH¢50. Always GH¢50.)

• When interest is paid on not only the principal amount


invested, but also on any previous interest earned, this is
called compound interest.

24
Investment calculation using FV
Function

25
5.8 Loan Amortization
• If you borrow money, the lender wants to earn
“compound” money on his/her/its investment.

• If you borrow GHS 1000 at 10%, then you won’t pay back
just GHS1,100 (unless you pay it back at once during the
initial time period).

• You will pay it back “compounded”. Interest will be


calculated each period on your remaining balance.

26
Amortization table $1,000 loan, pay $100 year, 5% year interest

Year Amount Owed Amount Plus Interest Payment

1 $1,000.00 $1,050.00 $100.00


2 $950.00 $997.50 $100.00
3 $897.50 $942.38 $100.00
4 $842.38 $884.49 $100.00
5 $784.49 $823.72 $100.00
6 $723.72 $759.90 $100.00
7 $659.90 $692.90 $100.00
8 $592.90 $622.54 $100.00
9 $522.54 $548.67 $100.00
10 $448.67 $471.11 $100.00
11 $371.11 $389.66 $100.00
12 $289.66 $304.14 $100.00
13 $204.14 $214.35 $100.00
14 $114.35 $120.07 $100.00
15 $20.07 $21.07 $21.07
Total Paid 27 $1,421.07
The amortization table (also called a
schedule) will look different if the interest
was compounded AFTER you paid, rather
than BEFORE you paid?
(this is a type 1 on Excel financial functions)

28
Amortization table $1,000 loan, pay $100 year, 5% year interest

Year Amount Owed Payment Amount Plus Interest

1 $1,000.00 $100.00 $945.00


2 $945.00 $100.00 $887.25
3 $887.25 $100.00 $826.61
4 $826.61 $100.00 $762.94
5 $762.94 $100.00 $696.09
6 $696.09 $100.00 $625.89
7 $625.89 $100.00 $552.19
8 $552.19 $100.00 $474.80
9 $474.80 $100.00 $393.54
10 $393.54 $100.00 $308.22
11 $308.22 $100.00 $218.63
12 $218.63 $100.00 $124.55
13 $124.55 $100.00 $25.78
14 $25.78 $25.78 $0.00

Total Paid $1,325.78


29
ASSIGMENT 3:
1. Use an excel sheet to create the table below. Write an excel formula in cell D2 to calculate
the payment for a loan amount of $15,000 at 9% interest rate for a period of 5 years. Assume
the loan is compounded monthly.

Take:
=PMT(rate, nper, pv, [fv], [type]) ----Returns periodic payment

=PMT(.09/12,5*12,15000,0,0) OR =PMT(.09/12,5*12,15000)

2020/2021 30
2. Use an excel sheet to create the table below. Write an excel formula in cell B2 to
determine how many years it will take to save $12,000 if you put $10,000 into a
savings account paying 4% annual interest compounded quarterly.

=NPER(rate, pmt, pv, [fv], [type]) ----Returns # of Payment periods

=NPER(.04/4,0,-10000,12000,0) /4 OR =NPER(.04/4,,-10000,12000)/4

Note: Divide the function by the number of compounding periods to calculate


the number of years for the annuity

2020/2021 31
3. Use an excel sheet to create the table below. Write an excel formula in cell A2 to calculate
the annual interest rate of a new Chevy Cruz. The cost of the car is $18,999, and you will put
down $2,000. You will pay $350 per month for five years. The annual interest rate is
compounded monthly.

=RATE(nper, pmt, pv, [fv], [type]) ----Returns the rate per period

=RATE(5*12,-350,16999,0,0)*12 OR =RATE(5*12,-350,16999)*12

Note: Multiply the function by the number of compounding


periods to calculate the annual interest rate

2020/2021 32
4. Use an excel sheet to create the table below .Write an excel formula in cell E2 to
determine how much money you would have to put into a CD now to have a
$5,000 down payment on a car when you graduate in 2 years. The CD pays 3%
annual interest rate compounded yearly.
=PV(rate, nper, pmt, [fv], [type]) - Returns the present value of an investment

=PV(.03,2,0,5000,0) OR =PV(.03,2,,5000)

2020/2021 33
5. Use an excel sheet to create the table below .Write an excel formula in cell F2 to determine
the value of a CD in 2 years. You plan on an initial investment of $5,000 and you will add an
additional $50 per month. The CD pays an annual interest rate of 3% compounded monthly.

=FV(rate, nper, pmt, [pv], [type]) - Returns the future value of an investment

=FV(.03/12,2*12,-50,-5000,0) OR =FV(.03/12,2*12,-50,-5000)

2020/2021 34
6. Use an excel sheet to create the table below .Write an Excel formula in cell G2 to calculate the monthly
mortgage payment for a $100,000 home with a balloon payment of $10,000. The annual interest rate is
4% compounded monthly with a loan duration of 30 years. Note: A balloon payment is an amount due at
the end of the loan and is indicated in the fv argument as a negative value .

2020/2021 35
2020/2021 36
UGBS 008
DATA PROCESSING

An Overview of Microsoft Access

Lecturer: Mr. Michael K. Kolugu, Dept of Computer Sc. & Distance Education
Contact Information: mkkolugu@ug.edu.gh, mkkolugu@gmail.com

College of Education
School of Continuing and Distance Education
Department of Distance Education.
Michael K. Kolugu 1
Slide Outline

• Overview of Databases

• Importance of a Database

• Basic Database Terminologies

• Introduction to Microsoft Access

• How to create an Access Database

Michael K. Kolugu 2
Overview of Databases
• Database is a self-describing collection of related records.
• A database contains the definition of its structure referred as to a
metadata.
• The purpose of a database is to help keep track of things.
• The most commonly used type of database is the relational database.
• A relational databases store data in tables.
• A database usually has multiple related tables that contain data about
different things.
• For instance, University of Ghana’s Database will have tables on Students,
Lecturers, Programs, Departments, Colleges, etc

Michael K. Kolugu 3
Importance of a Database
• To keep track of events
• Stores complex data relationships
• Minimizes data redundancy
• Ensures proper data security
• Addresses data modification issues
• Data can be shared and edited by several users simultaneously
• Data entry is faster and easier
• Data can be viewed and sorted in many ways

Michael K. Kolugu 4
Basic Database Terminologies – (1)

• Entity
– An entity is something of importance to a user that needs
to be represented in a database. An entity represents one
theme or topic.

– Example of entities in University of Ghana’s database will


include Students, Grades, Courses, Departments, Staff,
Halls, etc.

Michael K. Kolugu 5
Basic Database Terminologies – (2)

• Relation
– A relation is a two-dimensional table that has specific
characteristics. The table dimensions, like a matrix,
consist of rows and columns.

Michael K. Kolugu 6
Basic Database Terminologies – (3)

• Relation

Michael K. Kolugu 7
Basic Database Terminologies – (4)

• Attribute
– An attribute is a characteristic of an entity. Thus,
attributes describe an entity.

– Attributes are represented by columns or fields in a


relation. For instance:
• the attributes of a student entity will include, student ID,
first name, last name, date of birth etc.,.

Michael K. Kolugu 8
Basic Database Terminologies – (5)
• Record
–A record is an instance of an entity. It also shows
the occurrence of an entity. Records are
represented by rows in a relation. Example of a
record for a student entity is:

instances

Michael K. Kolugu 9
Basic Database Terminologies – (6)
• Key
–A key is one (or more) column(s) of a relation that is
(are) used to identify a row.

–There are different types of keys in database


management, such as:
• primary, foreign, candidate, composite, surrogate.

Michael K. Kolugu 10
Basic Database Terminologies – (7)

• Primary key:
– key is a unique attribute chosen distinctively identify
records in a relation or table. If you know the value of the
primary key, you will be able to identify a single row. For
instance, StudentID is a unique attribute to identify every
student.

Michael K. Kolugu 11
Basic Database Terminologies – (8)

• Foreign key:
– is a primary key from one table placed into another table
in order to establish a relationship between the two
tables. The key is called a foreign key in the table that
received the key.

Michael K. Kolugu 12
Basic Database Terminologies – (9)

• Foreign key:

Michael K. Kolugu 13
Basic Database Terminologies – (10)

• Candidate key:

–A candidate key is potential primary key, but has


not been selected yet.

• Composite key:
–Is a key that contains two or more attributes use to
uniquely identify a record in a table.

Michael K. Kolugu 14
Basic Database Terminologies – (11)

• Surrogate Key:
–is a unique, numeric value that is added to a table
to serve as temporal identify for records in a table.
–Surrogate key values have no meaning to users and
are usually hidden on forms, queries, and reports.
–A surrogate key is often used in place of a
composite key.
Michael K. Kolugu 15
Basic Database Terminologies – (12)

• Relationships:

–Relationship refers to an association between two


entities in a database.

–Since entities translate into tables, relationships are


enforced at the between tables using primary keys
and foreign key.

Michael K. Kolugu 16
Basic Database Terminologies – (13)

• Referential integrity:
–Refers to a set of rules that a database enforces to
maintain consistency between related tables when
you update data in a database.
–Referential integrity states that every value of a
foreign key must match a value of an existing
primary key.
Michael K. Kolugu 17
Basic Database Terminologies – (14)
Student Table

• Table/Entity Name:
– Student
• Columns/Attributes/Fields:
– StudentID, Fname, Sname, DoB, Contact.
• Key
– StudentID (a primary key)

Michael K. Kolugu 18
Basic Database Terminologies – (15)
• Table/Entity Name:
– Registration
• Columns/Attributes/Fields:
– StudentID, CourseCode, Date_of_reg.
• Key
– StudentID (foreign key), CourseCode (Primary key)

Course Table

Michael K. Kolugu 19
Basic Database Terminologies – (16)
• Table/Entity Name:
– course
• Columns/Attributes/Fields:
– CourseCode, CourseTitle, Credit, Department.
• Key
– StudentID (foreign key), CourseCode (foreign key)

Registration Table

Michael K. Kolugu 20
Basic Database Terminologies – (17)
Student Table

Course Table

Registration Table

Michael K. Kolugu 21
Introduction to Microsoft Access
• Microsoft Access:
– is a database management system (DBMS) use to create,
process, and administers databases.

– is comprised of 7 components for data processing, namely


Tables, Relationships, Queries, Forms, Reports, Macros, Modules.

– it stores database files with the .mdb extension.

– it accepts data from other sources such as Excel, SQL etc. for
manipulation.

Michael K. Kolugu 22
Introduction to Microsoft Access – (1)

Michael K. Kolugu 23
How to create an Access Database

• There are several ways to start Access application. Two


methods are presented here:
– Method I:
• Press the Windows key from the keyboard or click on the
Windows icon from the task bar to bring up the start-up.
• Go to All programs
• Select Microsoft Office folder and click on Microsoft Access
from the list.

Michael K. Kolugu 24
How to create an Access Database – (1)

– Method II:
• Press Windows key and R together from the keyboard.
Alternatively, type RUN in start-up menu search box

• Type MSACCESS in the RUN dialog box

• Press OK or enter from the keyboard

Michael K. Kolugu 25
How to create an Access Database – (2)

• Thereafter, the Access start-up window appears.

• Then, Access database must be created first before


other manipulation can occur.

Michael K. Kolugu 26
UGBS 008
DATA PROCESSING

Working With Microsoft Access Table

Lecturer: Mr. Michael K. Kolugu, Dept of Computer Sc. & Distance Education
Contact Information: mkkolugu@ug.edu.gh, mkkolugu@gmail.com

College of Education
School of Continuing and Distance Education
Department of Distance Education.
Michael K. Kolugu 1
Slide Outline

• Overview of Access Table

• Defining a Table

• Creating a Table in Datasheet View

• Creating a Table in Design View

• Adding Records to a Table

• Table Relationships

Michael K. Kolugu 2
Overview of Access Tables

• Tables are a major component of databases.

• They are the object that forms the structure and hold
data on entities in databases.

• Tables are made up of attributes, data types,


identifiers, and records.

Michael K. Kolugu 3
1 of 6
Defining a Table

• Before creating a table, identify the attributes and their


corresponding data types, relationships, as well as the
identifiers.

• Define the table fields and their purpose in a table


form.

Michael K. Kolugu 4
2 of 6
Defining a Table

– For instance, let’s consider a Visitor Table in a hospital


database:

Michael K. Kolugu 5
3 of 6
Defining a Table

• Access guidelines for naming an identifier:


– A field name can consist of up to 64 characters, including
letters, numbers, spaces, and special characters, except for
the period (.), exclamation mark (!), grave accent (`), and
square brackets ([ ]).

– A field name cannot begin with a space

Michael K. Kolugu 6
4 of 6
Defining a Table

• Access guidelines for naming an identifier:


– Capitalize the first letter of each word in a field name that
combines multiple words, for example VisitDate.

– Use concise field names that are easy to remember and


reference, and that won’t take up a lot of space in the table
datasheet.

Michael K. Kolugu 7
5 of 6
Defining a Table

• Access guidelines for naming identifiers/field names:


– Use standard abbreviations, such as
• Num for Number
• Amt for Amount
• Qty for Quantity
–and use them consistently throughout the database.
–For example, if you use Num for Number in one field name, do
not use the number sign (#) for Number in another
Michael K. Kolugu 8
6 of 6
Defining a Table

• Access guidelines for naming an identifier:

– Give fields descriptive names so that you can easily identify

them when you view or edit records. For instance:

• For a student identification number , you can use StudID.

• For a staff identification number, you can use StaffID etc.

Michael K. Kolugu 9
Creating a Table in Datasheet View

• Datasheet view shows a table’s contents in rows


(records) and columns (fields).
• Each column is headed by a field name inside a field
selector.
• Each row has a record selector to its left.
• Clicking a field selector or a record selector selects that
entire column or row (respectively).
Michael K. Kolugu 10
Creating a Table in Datasheet View

• A field selector is also called a column selector

• A record selector is also called a row selector.

Michael K. Kolugu 11
Creating a Table in Datasheet View

• To create a table in Datasheet View:


– Click the Create tab on the Ribbon

– In the Tables group, click the Table button

– Accept the default ID primary key field with the AutoNumber


data type, or rename the field and change its data type, if
necessary

Michael K. Kolugu 12
Creating a Table in Datasheet View

– In the Add & Delete group on the Fields tab, click the button
for the type of field you want to add to the table (for
example, click the Text button), and then type the field
name. Repeat this step to add all the necessary fields to the
table.

Michael K. Kolugu 13
Creating a Table in Datasheet View

– In the table datasheet, click the Click to Add column heading,


click the type of field you want to add from the list that
opens, type the field name, and then press the Tab or Enter
key to move to the next column in the datasheet. Repeat this
step to add all the necessary fields to the table.

Michael K. Kolugu 14
Creating a Table in Datasheet View

– In the first row below the field names, enter the value for
each field in the first record, pressing the Tab or Enter key to
move to the next field.

Michael K. Kolugu 15
Creating a Table in Datasheet View

– After entering the value for the last field in the first record,
press the Tab or Enter key to move to the next row, and then
enter the values for the next record. Continue this process
until you have entered all the records in the table.

– Click the Save button on the Quick Access Toolbar, enter a


name for the table, and then click the OK button.

Michael K. Kolugu 16
Creating a Table in Datasheet View

– Creating Table in Design view


Michael K. Kolugu 17
Creating a Table in Datasheet View

• Renaming the Default Primary Key Field


– Right-click the ID column heading to open the shortcut
menu, and then click Rename Field. The column heading ID is
selected, so that whatever text you type next will replace it.

– TABLE TOOLS tab is a contextual tab, which appears and


provides options for working with objects selected.

Michael K. Kolugu 18
Creating a Table in Datasheet View

• Changing the default primary key in Datasheet View.

Michael K. Kolugu 19
Creating a Table in Datasheet View

• Changing the Data Type of the Default Primary Key


Field.
– Each field in an Access table must be assigned a data type.

– The data type determines what field values you can enter in the
field.

– The AutoNumber data type automatically inserts a unique key


for every record, beginning with 1.

Michael K. Kolugu 20
Creating a Table in Datasheet View

• Changing the Data Type of the Default Primary Key


Field.

Michael K. Kolugu 21
Creating a Table in Datasheet View

• Adding New Fields.


– In Datasheet view, you can use the options in the Add & Delete
group on the FIELDS tab to add fields to your table.

– You can also use the Click to Add column in the table datasheet
to add new fields.

Michael K. Kolugu 22
Creating a Table in Datasheet View
• Adding new columns in Datasheet View.

Michael K. Kolugu 23
Creating a Table in Design View

• Creating a table in Design view involves


– entering the field names

– defining the properties for the fields

– assigning appropriate data type

– specifying a primary key for the table,

– then saving the table structure

Michael K. Kolugu 24
Creating a Table in Design View

• Creating a table in Design steps:


– Click the Create tab on the Ribbon
– In the Tables group on the Create tab, click the Table Design button. A
new table named Table1 opens in Design view
– Type the field name, select appropriate data types, and provide a
description of the field. Note that the description field is optional
– Press the Tab key to advance to the next field until all the fields are
provided.
– Finally, set the property for the fields

Michael K. Kolugu 25
Creating a Table in Design View

• Defining Fields:
– Enter values for the Field Name, Data Type, and Description
field properties, and

– then select values for all other field properties in the Field
Properties pane.

Michael K. Kolugu 26
Creating a Table in Design View
• Defining Fields:
– Identify all the fields needed to produce the required
information. Organize each piece of data into its smallest useful
part

– Group related fields into tables

– Determine each table’s primary key.

– Include a common field in related tables to create relationships

– Avoid data redundancy


Michael K. Kolugu 27
Creating a Table in Design View
• Creating a Table in a Design view

Michael K. Kolugu 28
Creating a Table in Design View
• Naming Fields and Objects
– To name fields and objects, the following steps are recommended.
– Provide a name for each field, table, and other object in an Access database
– Assigning Field Data Types
– Each field must have a data type
– Data types are assigned automatically by Access or specifically by the table
designer
– The data type determines what field values you can enter in the field and what
other properties the field will have

Michael K. Kolugu 29
Creating a Table in Design View

• Guidelines for Setting Field Properties


– Naming Fields and Objects
– You must name each field, table, and other object in an Access
database
– Assigning Field Data Types
– Each field must have a data type
– Data types are assigned automatically by Access or specifically by
the table designer.

Michael K. Kolugu 30
Adding Records To a Table

• After a table is created, the next task is to enter the data


into the table for further processing

• To add data first opened in the Datasheet View

• Then, start entering the data from the first data item in the
first record, then the second item and so on.

• Move the next record and do same until all records are
entered.
Michael K. Kolugu 31
Adding Records To a Table

• Records entered are immediately save by Access.

• However the table’s design characteristics are not saved


automatically. You would have to manually save it.

• When saving a table for the first time you would be


required to give it a name.

Michael K. Kolugu 32
Table Relationship

• One of the most powerful features of a relational database


management system is its ability to define relationships
between tables.

• The process of relating tables is often called performing a


join.

• When you join tables that have a common field, you can
extract data from them as if they were one larger table.

Michael K. Kolugu 33
Table Relationship

• After joining tables, a query, form, or report can be


used to extract selected data from each table, even
though the data is contained in two separate tables.
• There are three main Table relationships in Access:
– One-to-One
– One-to-Many
– Many-to-Many

Michael K. Kolugu 34
Table Relationship

• One-to-One relationship exists when one instance of a


table has only one relationship with one instance of
another table.
– This means that at any point in time, the records in one table can
have only a single unique relationship with another record in a
different Table.

Michael K. Kolugu 35
Table Relationship

• A one-to-many relationship exists between two tables


when one record in the first table matches zero, one, or
many records in the second table, and when one record
in the second table matches at most one record in the
first table.
– For instance, one customer can make one or more purchases, but
the purchases can only be attributed to a single customer..

Michael K. Kolugu 36
Table Relationship

• In this relationship, one or more instances of one table


have a relationship with one or more instance of
another table.
– For instance, In a Student Table and a Course Registration Table,
each student can register one or more courses and each unique
course can be related to several other students.

Michael K. Kolugu 37
NEXT LECTURE:

WORKIGN WITH MICROSOFT ACCESS FORMS

Michael K. Kolugu 38
UGBS 008
DATA PROCESSING

Working With Microsoft Access Form

Lecturer: Mr. Michael K. Kolugu, Dept of Computer Sc. & Distance Education
Contact Information: mkkolugu@ug.edu.gh, mkkolugu@gmail.com

College of Education
School of Continuing and Distance Education
Department of Distance Education.
Michael K. Kolugu 1
Slide Outline

• Overview of Access Forms

• Creating forms
– Using Form View

– Using Form Design View

– Using Form Wizard

• Modifying Access Forms

Michael K. Kolugu 2
Overview of Access Forms
• As a reminder: Access is comprised of 7 components for data
processing, namely:
– Tables
– Relationships
– Forms
– Queries
– Reports
– Micros
– Modules

Michael K. Kolugu 3
Overview of Access Forms

• Form is an Access object that enables data entry into


tables.
– It allows you to arrange the fields in a record in any layout so
you can enter, edit and delete records.
– It makes way for data to be entered into two or more tables at
the same time.
– It presents a more convenient way of entering data than when
the Table Datasheet View is used.

Michael K. Kolugu 4
Creating forms

• There three main ways to create Access Forms:


– From View

– Form Design view

– Using Form Wizard

Michael K. Kolugu 5
Creating forms – Using Form View

• To create a form using Form View:


– Select the Table for which the Form is to be created in the
object pane

– Click on the Create Tab in the ribbon

– Go to the Form category and click on Form

Michael K. Kolugu 6
Creating forms – Using Form Design View
• To create a form using Form Design View:
– Click the Create Tab.
– Go to the Forms Group and click the Form Design button to open
the:
• Form Design window.
• Form Design Tools: Namely
– Design, Arrange, Format.
– Click on the Design tool if it is currently not active and then click on
Add Existing Fields button in the Tools Group to display the Field List
Task Pane.
Michael K. Kolugu 7
Creating forms – Using Form Design View
• To create a form using Form Design View: - (continues)
– Click on the “Show All Tables” in the Field List Task Pane to display the list of
tables in the database.
– Click the plus (+) sign next to the Table you wish to use on the Form to show
the Field Names in the table.

– Drag a Field from the Table to the Design Window and label it
using the field that will appear to the left.
– Repeatedly drag all the needed fields to the Design window. Hold
the shift key to drag multiple select and drag multiple fields.

Michael K. Kolugu 8
Creating forms - Using Form Wizard

• To create a Form using the Form wizard:


– Click the Create Tab on the ribbon

– Go to the Form group and select the “Form Wizard” to


displays the available Tables/Queries to be selected.
• When a Table/query is selected, the Fields within them
appear in the Available Fields column.

Michael K. Kolugu 9
Creating forms - Using Form Wizard

• To create a Form using the Form wizard: - (continues)


– Select the Fields to be included in the form and click the
button with the single angle bracket.
– Click the Next button and choose the appropriate Layout from
the templates provided.
– Choose Next to give a title to the form item and/or modify to
the Form design
– or Choose Finish to complete the Form Wizard

Michael K. Kolugu 10
Modifying Access Forms

• To modify a form after it has been created:


– Open the form in either the Form Layout or Design View by clicking
the View button on the ribbon
– In the Tools Group, click the Property Sheet button
– In the Property Sheet window, select Form from the Selection type
list.
– Select the Format tab, if necessary.
– Modify the Form by either removing or adding new Fields, changing
Field sizes, fonts, style etc

Michael K. Kolugu 11
NEXT LECTURE:

WORKIGN WITH MICROSOFT ACCESS QUERIES

Michael K. Kolugu 12
UGBS 008
DATA PROCESSING

Working With Microsoft Access Queries

Lecturer: Mr. Michael K. Kolugu, Dept of Computer Sc. & Distance Education
Contact Information: mkkolugu@ug.edu.gh, mkkolugu@gmail.com

College of Education
School of Continuing and Distance Education
Department of Distance Education.
Michael K. Kolugu 13
Slide Outline

• Overview of Access Queries

• Creating Queries

• Overview of Microsoft Access Report

• Creating Reports

Michael K. Kolugu 14
Overview of Access Queries
• Query is an Access object for reviewing, adding, changing, or
deleting data from Tables in a database.
– A query allows specific questions to be asked about data that would be
difficult to answer just by looking at the data.
– Queries also allows Data:
– Filtration
– Calculation
– Summarization.
– Queries can be used to automate setting data management tasks to be
reviewed and committed to the database.

Michael K. Kolugu 15
Overview of Access Queries

– The result of a query is referred to as a recordset because


the query produces a set of records that answers and a
specific questions.
– Access provides several tools to create a new query, some of
which are the Simple Query Wizard., and Query Design.

Michael K. Kolugu 16
Creating Queries

• To create a query using the query Wizard:


– Select “Create” from the create tab
– Select Simple Query Wizard, and then select OK.
– Select the table or query that contains the field, and then add the
field to the Selected Fields list. Add as many fields as you want from
as many tables as you want.
– When you are finished, click Next and thereafter click Finish to run
– A recordset should be created with the result of the query

Michael K. Kolugu 17
Creating Queries

• To create a query using the Query Design:


– Click on the “Create” Tab in the ribbon

– Go to the Query group and select Query Design

– Select the Tables/Queries you want to use from the show table dialog window

– Double click on the fields from the Table that you required from the
Table/Query selected in the previous step. Repeat this step until all desire fields
are selected.

– Click on the Run button under the design Tab in the ribbon.

– Add other query options such as sort, criteria, show and OR for specific results.

Michael K. Kolugu 18
Sorting Data in a query

• Sorting is the process of rearranging records in a


specific order or sequence:
– To sort records, you must select the sort field, which is the
field used to determine the order of records in the
datasheet.

Michael K. Kolugu 19
Sorting Data in a query

• The various possible sorting orders for each data type

Michael K. Kolugu 20
Filtering Data in a query

• A filter is a set of restrictions you place on the records


to temporarily isolate a subset of the records.
– Filtrating allows you to view different subsets of displayed records
so that you can focus on only the data you need.

– An applied filter is not available the next time you run the query
or open the form (unless it has been saved)

– You can use Filter by Selection or Filter by Form to filter records.

Michael K. Kolugu 21
Filtering Data in a query

• Filter by Selection allows you to select all or part of a field


value in a datasheet or form.

• Filter by Form changes your datasheet to display blank


fields.

Michael K. Kolugu 22
Defining Queries Record Selection Criteria

• To tell Access which records you want to select, you must


specify a condition as part of the query.
– A condition usually includes one of the comparison operators.

Michael K. Kolugu 23
Overview of Microsoft Access Report

• A report is a formatted printout (or screen display) of the


contents of one or more tables or queries.
– Reports offer a more visually appealing format for the data
with a:
• Column headings in a different colour,
• Borders around each field value
• Graphic of a report at the top left,
• Current day, date and time at the top right.

Michael K. Kolugu 24
Creating Reports

• To creating a report using the Report Command:


– First, select the table or query on which the report will be
based.

– Click on Create Tab and go to the Report group

– Click on the Report button and a Report should be


created based on the

– Table/Query selected initially.

Michael K. Kolugu 25
Creating Reports

• To creating a report using the Report Wizard:


– Click on the Create Tab in the ribbon and in the Report
group, click on the Report wizard for the Report Wizard
window to display the Tables/Queries on which the
Report will be created to be selected.

– Select the needed Table/Query for the Fields within it to


appear in the Available Fields column.

Michael K. Kolugu 26
Creating Reports

• To creating a report using the Report Wizard: - (continues)


– Select the appropriate Fields to be included in the Report and
click the button with the single angle bracket, repeat until all
appropriate fields are selected, then click Next.

– Select an appropriate Layout from the templates

– Click Next to choose the Report item sort order or Finish to


complete the Form Wizard. The Report should now be created
and populated by the data in the Tables / Queries used.
Michael K. Kolugu 27
Modifying Reports

• To modify a report:
– Open the Report in either the Report Layout or Design View by clicking
the View button on the ribbon.
– In the Tools Group, click the Property Sheet button
– In the Property Sheet window, select Report from the Selection type list.
– Select the Format tab, if necessary.
– Modify the Report by either removing or adding new Fields, changing
Field sizes, fonts, style etc.

Michael K. Kolugu 28
NEXT LECTURE:

MS Access Forms

Michael K. Kolugu 29
Question & Answers

?
Michael K. Kolugu 30
UGBS 008
DATA PROCESSING

Working With Microsoft Access Queries &


Reports

Lecturer: Mr. Michael K. Kolugu, Dept of Computer Sc. & Distance Education
Contact Information: mkkolugu@ug.edu.gh, mkkolugu@gmail.com

College of Education
School of Continuing and Distance Education
Department of Distance Education.
Michael K. Kolugu 1
Slide Outline

• Overview of Access Queries

• Creating Queries

• Overview of Microsoft Access Report

• Creating Reports

Michael K. Kolugu 2
Overview of Access Queries
• Query is an Access object for reviewing, adding, changing, or
deleting data from Tables in a database.
– A query allows specific questions to be asked about data that would be
difficult to answer just by looking at the data.
– Queries also allows Data:
– Filtration
– Calculation
– Summarization.
– Queries can be used to automate setting data management tasks to be
reviewed and committed to the database.

Michael K. Kolugu 3
Overview of Access Queries

– The result of a query is referred to as a recordset because


the query produces a set of records that answers and a
specific questions.
– Access provides several tools to create a new query, some of
which are the Simple Query Wizard., and Query Design.

Michael K. Kolugu 4
Creating Queries

• To create a query using the query Wizard:


– Select “Create” from the create tab
– Select Simple Query Wizard, and then select OK.
– Select the table or query that contains the field, and then add the
field to the Selected Fields list. Add as many fields as you want from
as many tables as you want.
– When you are finished, click Next and thereafter click Finish to run
– A recordset should be created with the result of the query

Michael K. Kolugu 5
Creating Queries

• To create a query using the Query Design:


– Click on the “Create” Tab in the ribbon

– Go to the Query group and select Query Design

– Select the Tables/Queries you want to use from the show table dialog window

– Double click on the fields from the Table that you required from the
Table/Query selected in the previous step. Repeat this step until all desire fields
are selected.

– Click on the Run button under the design Tab in the ribbon.

– Add other query options such as sort, criteria, show and OR for specific results.

Michael K. Kolugu 6
Sorting Data in a query

• Sorting is the process of rearranging records in a


specific order or sequence:
– To sort records, you must select the sort field, which is the
field used to determine the order of records in the
datasheet.

Michael K. Kolugu 7
Sorting Data in a query

• The various possible sorting orders for each data type

Michael K. Kolugu 8
Filtering Data in a query

• A filter is a set of restrictions you place on the records


to temporarily isolate a subset of the records.
– Filtrating allows you to view different subsets of displayed records
so that you can focus on only the data you need.

– An applied filter is not available the next time you run the query
or open the form (unless it has been saved)

– You can use Filter by Selection or Filter by Form to filter records.

Michael K. Kolugu 9
Filtering Data in a query

• Filter by Selection allows you to select all or part of a field


value in a datasheet or form.

• Filter by Form changes your datasheet to display blank


fields.

Michael K. Kolugu 10
Defining Queries Record Selection Criteria

• To tell Access which records you want to select, you must


specify a condition as part of the query.
– A condition usually includes one of the comparison operators.

Michael K. Kolugu 11
Overview of Microsoft Access Report

• A report is a formatted printout (or screen display) of the


contents of one or more tables or queries.
– Reports offer a more visually appealing format for the data
with a:
• Column headings in a different colour,
• Borders around each field value
• Graphic of a report at the top left,
• Current day, date and time at the top right.

Michael K. Kolugu 12
Creating Reports

• To creating a report using the Report Command:


– First, select the table or query on which the report will be
based.

– Click on Create Tab and go to the Report group

– Click on the Report button and a Report should be


created based on the

– Table/Query selected initially.

Michael K. Kolugu 13
Creating Reports

• To creating a report using the Report Wizard:


– Click on the Create Tab in the ribbon and in the Report
group, click on the Report wizard for the Report Wizard
window to display the Tables/Queries on which the
Report will be created to be selected.

– Select the needed Table/Query for the Fields within it to


appear in the Available Fields column.

Michael K. Kolugu 14
Creating Reports

• To creating a report using the Report Wizard: - (continues)


– Select the appropriate Fields to be included in the Report and
click the button with the single angle bracket, repeat until all
appropriate fields are selected, then click Next.

– Select an appropriate Layout from the templates

– Click Next to choose the Report item sort order or Finish to


complete the Form Wizard. The Report should now be created
and populated by the data in the Tables / Queries used.
Michael K. Kolugu 15
Modifying Reports

• To modify a report:
– Open the Report in either the Report Layout or Design View by clicking
the View button on the ribbon.
– In the Tools Group, click the Property Sheet button
– In the Property Sheet window, select Report from the Selection type list.
– Select the Format tab, if necessary.
– Modify the Report by either removing or adding new Fields, changing
Field sizes, fonts, style etc.

Michael K. Kolugu 16
Questions & Answers

Michael K. Kolugu 17

You might also like