8-spreadsheetIntro - Department of Computer and Information

advertisement

CSCI N207 Data Analysis Using Spreadsheet

8. Introduction to Spreadsheet

Lingma Acheson linglu@iupui.edu

Department of Computer and Information Science, IUPUI

Spreadsheet Concepts

 Spreadsheet use columns and rows, just like in database tables

1

2

3

4

A

A1

A2

A3

A4

B

B1

B2

B3

B4

C

C1

C2

C3

C4

D

D1

D2

D3

D4

Data can be imported from a database table

Each cell has a unique address – identified by its row and column location as in a matrix.

 A range of cells is any rectangular block of contiguous cells.

 A1:D2 references the first two rows of cells in the above table.

(columns A-D, rows 1-2)

 How many cells are referenced with B3:C4 ?

Spreadsheet Basics

 Similar layout as other Microsoft products, such as Word, PowerPoint

 Can create multiple pages (sheets) and name each sheet

 Exercise: Import a table from a database and format the layout

Formulas

 A cell can store result of a computation

 Results are entered directly in the cell of interest. Displayed in cell and formula bar.

 Must begin with ‘=‘.

 May contain combination of numbers, mathematical operators, functions, and worksheet ranges (named or not).

 May be designed such that they can be copied to other cells and still yield desired result.

 E.g.:

= 5*A2

= $F$2*A2 + $G$2

= A2^2

= 20%

= “Text “ &A2

= A2 < B2

Relative cell reference

Absolute and relative references

Exponents

Percentage

String concatenation

Logical comparison

Mathematical Operators

/

^

-

*

Operator

+

Description

Plus sign performs addition.

Minus sign performs subtraction.

Asterisk performs multiplication.

Forward slash performs division.

Caret sign raises a value to its exponent.

Common Errors

 Divide by zero (#DIV/0!)

 Circular reference (including a reference to the cell containing the formula within the formula.)

 Insufficient column width (#####)

 Using text when Excel expected numbers (#VALUE)

 Using wrong/misspelled named range (#NAME)

Relative Referencing

By default, cell references are relative.

 We can copy one formula to a different cell, cell numbers are changed yet relationship is preserved.

 In the formula in cell C2 , Excel doesn’t see it as A2 * B2 . Excel sees it as the cell two columns to the left on the same row is multiplied times the cell one column to the left on the same row.

Absolute Referencing

 Sometimes you want to always reference the same cell. If this is the case, you need to use absolute referencing.

 To use absolute referencing in Excel, two $ signs are used in the formula.

 E.g. this time, when you copy the formula from cell B3 to cells

B4 through B7 , the reference to cell C1 stays the same.

 Notice also that A3 was still a relative reference, so it changed automatically as the formula was copied from one cell to the next.

Referencing Worksheets

 You can include a reference in formulas to cells in other worksheets.

 References to the worksheet are added to the left of the cell reference.

 For example:

= Sheet2!$A$2 (reference to another worksheet within the same workbook)

Functions

 Excel comes with numerous functions that allow you to simplify your formulas and spreadsheets.

 Most functions need arguments, values that are passed into functions to be used by functions

 Examples: SUM() AVERAGE() MIN() MAX()

 A list of most available functions can be viewed with the function wizard.

 For Example:

=A1+A2+A3+A4+A5+A6+A7+A8+A9+A10 is equivalent to

=SUM(A1 : A10)

In this example , Sum is the name of the function and A1:A10 are called arguments.

=A1+A10 is equivalent to

=SUM(A1 , A10)

Functions

 Most functions require you to pass at least one value (argument).

 Some functions may require values to be passed in a specific order.

 Parentheses are required with all functions and are used to enclose values to be passed.

 Values may be passed as numbers, text, or cell references.

 Functions usually return ONE value.

 Functions can be embedded in any formula.

(e.g. =AVERAGE(A1:A10)+1.2*STDEVP(A1:A10)

 Use function wizard or on-line help for syntax requirements.

Download