csi 1306 spreadsheets 1. spreadsheets standard requirements for a spreadsheet –divide worksheet...

33
CSI 1306 SPREADSHEETS 1

Upload: lewis-wilson

Post on 17-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

CSI 1306

SPREADSHEETS 1

Spreadsheets

Standard Requirements for a Spreadsheet– divide worksheet into rows & columns (cells)– enter text, numbers & dates into cells– enter formulas which reference contents of other cells– copy formulas from one cell to another & change cell

references automatically– automatically recalculate values in related cells when a

change is made to a cell– change size of cells– format cell contents

Spreadsheets

Standard Requirements for a Spreadsheet– add or delete rows & columns of cells

– sort, summarize & extract information from worksheets for reports

– display or print information from the worksheet in the form of graphs or charts

Compared to word processors– each cell offers computing power through formulas, as

well as text editing & formatting capabilities

Spreadsheets

Worksheets– 256 columns & 65,536 rows

– columns labeled with letters of alphabet• A to Z, AA to AZ, BA to BZ, etc.

– rows labeled with numbers

– maximum size of worksheet depends on memory available

Workbooks– each can contain up to 256 worksheets

Spreadsheets

Desktop– standard menus and bars

– worksheet occupies most of the screen

– formula bar• cell address

• contents of the current cell

– sheet tabs• click to activate different worksheets in a workbook

Spreadsheets

Basic Operations– moving the cell pointer

• click on a cell• select Go To from Edit menu• use cursor keys

– shortcut menus• attached to a particular screen object

– toolbar, document window or worksheet cell– contain only commands that pertain to that object– commands found on several pull -down menus

• click object using secondary mouse button– click command using primary mouse button

Data Entry

select cell & enter data– data appears in the cell & formula bar

– click on Enter box in formula bar

edit data in a cell– double click on the cell, or

– click on data in formula bar

– F2 key

Data Entry

Three Types of Data– text

– values

– formulas

Text– left aligned

– can format • font, size, bold, underline,etc.

Data Entry Values

– Quantities• right aligned in cell• converted to scientific notation if wider than cell• negative numbers as -99 or (99)• can include $ and ,• can enter fractions

– 2 1/4 (note space) or 0 5/16– can enter .12 or 12%

– Dates & Times• can be used in formulas

– 5:46 PM, 17:46 – 5:46:29 PM, 17:46:29– September 21, 1994– 9/21/94, 9-21-94– 21-Sep-94, 9-Sep, Sep-94

Data Entry

Formula– = to start– displayed on formula bar– no spaces– computed result displayed in cell– result changes if changes in cells referenced by formula– contain +,-,*,/ and ^ (raising a number to a power)– calculated from left to right– mathematical order of operations (BEDMAS)– can select cell addresses by pointing & clicking

Data Entry

AutoFill– for entry of a series of sequential dates or numbers

• enter the starting value for the series in the first cell• position mouse pointer on lower RH corner of cell

– mouse pointer becomes a little black cross (fill handle)

• drag horizontally or vertically• adjacent cells are filled with initial value incremented by one

– September, October, November– Tuesday, Wednesday, Thursday– Qtr1, Qtr2, Qtr3, Qtr4– 8:01, 9:01, 10:01

• use 2 values in first two cells for increments > 1– for number series, enter & select values in two cells

Data Entry Referencing Cells

– simple reference • use the cell address

– A1 or B5, or ZZ253

– range of cells• top left:bottom right

– C1:C5 includes C1, C2, C3, C4, C5– A1:B3 includes A1, A2, A3, B1, B2, B3

– cells on different worksheets• worksheetname!cell

• worksheetname!range– Sheet1!A4– January!B5:C7

Functions

a predefined formula that performs a particular type of computation

• you supply the values (arguments) that the function uses• arguments are enclosed in parentheses and separated by commas

many built in functions• statistical, financial, mathematical, logical• can be standalone (preceded by =) or included in a formula

Function Wizard• Choose Insert >> Function• can be used to select a function and specify the arguments• step by step way to fill in functions• useful for learning new functions

Functions

=SUM(range1, range2….)– total all of the numbers in a range

– blank cells treated as zero• =SUM(A1:B2) = A1+A2+B1+B2

=PRODUCT(range1, range2, …)– multiplies all the numbers in a range

– blank cells treated as one• =PRODUCT(C1:C4) = C1*C2*C3*C4

Functions

AutoSum– select cell in which you want the sum

• click on the AutoSum tool on the standard toolbar

• the formula is developed and the sum appears in the cell

Functions

=COUNT(range1, range2,…)– count the cells in a range

– blank cells are not counted

=AVERAGE(range1, range2, …)– find the average of all numbers in a range

– value 0 is counted, blank cells are not• =Average(A1:A3) = SUM(A1:A3)/COUNT(A1:A3)

Functions

=MEDIAN(range1, range2…)– find the middle number in range

– blank cells are omitted• =MEDIAN(3,5,2,4,1) = 3

=MAX(range1, range2, …)– find the largest number in the range

• =MAX(3,5,2,4,1) = 5

=MIN(range1, range2, …)– find the smallest number in the range

• =MIN(3,5,2,4,1) = 1

Functions

=ROUND(number, num_digits)– round the given number, to the desired number of digits

• =ROUND(3.14159, 1) = 3.1

• =ROUND(3.14159, 3) = 3.142

• =ROUND(3.14159, 0)= 3

IF(logical_test,value_if_true,value_if_false)– IF(b2>=1000,b2*10%,b2*5%)

– If b2 is greater than or equal to 1000• (TRUE) then insert 10% of b2 in the formula cell

• (FALSE) otherwise, insert 5% of b2 in the formula cell

Functions

=NOW()

– returns the current date and time• =NOW() = 99/09/16 14:00

=TODAY()– returns just the current date

• =TODAY() = 99/09/16

Note that Dates/Times are stored as numbers– each day after “reference day” Jan 01, 1900

Functions

=PV(rate,nper,pmt,fv,type)– present value; current worth of a series of future

payments

=PMT(rate, nper, pv, fv, type)– calculate amount of loan payments

• rate is interest rate per period• nper is total number of payment periods• pmt is payment made each period• fv is cash balance you want after last payment• type is when you make the payment in the period

– 0 for end (default), 1 for beginning

• pv is amount of loan

Editing a Worksheet Moving a cell selection

– position mouse pointer at one of edges of selection• pointer changes to an arrowhead

– drag to new position– cell references, if any, will not change

Copying a cell selection– as in move, except hold down Ctrl key

• pointer changes to an arrowhead with a plus sign

– drag to new position– cell references, if any, will change– or select cell and copy and paste

Editing a Worksheet Anchoring (absolute cell references)

– To keep references from changing when copying• the ‘$’ symbol is used to anchor a reference

• A1 - both row and column change• A$1 - column changes, row remains as 1• $A1 - row changes, column remains as A• $A$1 – neither row nor column changes

– Copying the formula =A1+B$2+$C3+$D$4 from E5 to F6puts the following formula in F6=B2+C$2+$C4+$D$4

Formatting

Selecting a cell range• position mouse pointer on 1st cell

– hold down mouse button & drag– release mouse button at the last cell

• click on 1st cell– position mouse pointer in last cell– hold down Shift key as you click again

• to select more than one range at a time– select the 1st range– hold down Ctrl key as you select non-adjacent ranges

• to select entire columns or rows– click on column letter or row number– select ranges by dragging or holding down Ctrl key

Formatting

Formatting a cell• Number

– how the number is displayed

• Alignment– left, right, centre & centre across cells

• Font– type, size

• Border– lines around cell

• Patterns– colour/background in cell

• Protection– keep cell contents from being changed

Formatting

Numeric Formats– determined by how you enter data

• if $10.50 then Currency number format• if 49% then Percentage number format• if 09/26/95 then Date number format

– usually assign format after data entry• select cells to be formatted• choose tool or Cells from Format menu

– currency format $xxx,xxx.xx– comma format xxx,xxx.xx– percent format xx.xx%

» number of decimal places may be changed

Formatting

Displayed Value vs. Stored Value– all calculations are done to 15 decimal points of accuracy– this value, the actual value is stored in computer memory– Displayed Value is what shows on the spreadsheet

• 14.95 vs. 14.94876…..

– to adjust stored to displayed value• select Options from Tools menu• click on Calculation tab• choose Precision as Displayed• click OK• cannot return to previous state

Formatting

I changed my numeric format and got ############

I see only half my words

Column is not wide enough to show the number as you have displayed it

Use AutoFit to automatically change the column widths to fit your work

Formatting

Adjust row heightText wrap

– expands row height

Hide rows and columns– for printing

– hide “scratch work”

Orientation– vertical vs. horizontal cells

Formatting

Cell borders– by default, gridlines displayed on the worksheet do not

print

– can make them

– borders allow special selections of gridlines to print

Spell check– as in a word processor

– checks only text values

Formatting

Working with large spreadsheets– What if

• I want to look at two sections at the same time– insert a Split, to make two panes

» vertical or horizontal

• I want to always see the row and column titles– Freeze Panes

Homework

Student Marks Draw the layout (title, row and column headings, sample

data, etc.) for a student marks spreadsheet Enter some formulae (i.e. for sums and examination mark

calculations) Show the effects of copying the formulae to other cells

(i.e. the automatic changing of cell references) Use the IF function in a formula, for example to assign a

pass or failure based on course numeric grade

Pizza ParlorFigure out the price of each pizza on the following Medium is 25% larger than a Small Large is 20 % larger than a Medium Extra Large is 10% larger than a Large Each additional topping will be $0.75, $1.00, $1.25,

$1.50 for a Small, Medium Large and Extra Large pizza respectively

The price of a Extra Cheese Pepperoni Pizza (two extra toppings) is exactly $9.25