02 Lect2
02 Lect2
! Creating a workbook: The first action should always be to give your workbook a name and save it on your computer. Go for this to the menu bar and select by left mouse click (LC): File Save As In the window which then opens enter a file name:
Basic Operations
Save as Microsoft Excel Workbook Excel files have the extension xls on the disk, e.g. the above example will be stored (saved) as Firstworkbook.xls. Organize your Excel files (in fact like all other ones) in folders. While editing save your file once in a while just by LC on save , this way you do not loose data in a crash.
11
! Entering data onto a worksheet: Data can be entered onto the worksheet either by typing into the active cell or by typing into the formula bar. Cell entries may be completed in various ways, e.g. complete C8. a) Enter moves to the next cell in the same column, e.g. C9. b) Shift+Enter moves to previous cell in the column, e.g. C7. c) Cursors , , move to the cell in the direction indicated, e.g. B8, D8, C6, C9. d) Enter button completes but does not move to a new cell. e) Esc does not move and cancels all modification done after the last completion of the type a), b), c) or d). f) Cancel button has the same effect as e).(Edit Undo, 0 Do not finish the entry by clicking with the pointer onto a new cell as this will produce wrong results for formulae. )
12
Andreas Fring
! Modifying entered data: Use delete or backspace () to delete right or left from the insertion point, respectively. LC on a cell (or formula bar) with some old entry and overtype it. Edit Clear All (deletes all informations related to the cell) Contents (deletes only the content of the cell) Use the spelling tool to correct mistakes: Tools Spelling Expl.: Assume a cell has the entry Citi, Tools Spelling
13
! Formatting the cell entries: For presentational reasons one can change the format in which the cell entries are displayed: Format Cells
- One can change the category (type of data) and its associated properties.
14
Andreas Fring
- Alignment allows to change the horizontal or vertical position and the orientation of the text. - Font gives options to change the typeface and the colour of the displayed entry. - Border provides possibilities to change the style of the frame surrounding a cell. - Pattern changes the background of the cell. - Protection allows to protect cells from being changed. ! Formatting the cell size: Position the pointer on the dividing line between the name of the row/column (e.g. 5|6 / E|F) and drag the line to the desired size. Alternatively use the menu bar: Format Row Height or Format Column Width and change the numerical value, e.g.
15
! Merging cells: One can merge a range of cells into one single cell. This is useful for instance for large titles. To do this select the range and then LC on the Merge and Center button in the formatting toolbar
! Adding comments to a cell: Sometimes it is useful to add some additional information to a cell which should not be visible on the WS for some reason. This is done by: Insert Comment a window open into which one can type a comment. A cell which has a comment attached to it is marked in the top right corner by a red triangle. The comment is made visible by pointing on top of the cell. The comment is removed by Edit Clear Comments.
16
Andreas Fring
! The Autofill function: The Autofill function determines automatically the entries of some cells given some starting values. Avoids lots of typing! Expl.: Fill the column C1-C20 with 50-1000 with step 50, i.e. 50 C1, 100 C2, 150 C3, .... 1000 C20 - fill in some starting values: 50 C1, 100 C2 - select the range of the starting values C1:C2 - while on top of the selected area the cursor will be - move the cursor to the lower right corner of the selection, until the cursor changes from to - drag the fill handle down (or to the right) and the new cells will be filled based on the initial selection, e.g. 150 C3,... - verify that Excel really filled in the sequence you wanted!!! Alternatively write just 50 into C1. Use Edit Fill Series with Step value=50, Stop value=1000
17
! Different types of data: text is left adjusted by default, use the format toolbar to change the adjustment, text format, indent or colour (find out yourself) numbers are right adjusted by default, use the format toolbar to change the format as for text - in/decrease decimal in/decreases the number of decimal points displayed, but not the cell value, e.g. 3.141 3.1415/3.14 - comma style changes to a style defined in: Format Style
18
Andreas Fring
changes to a style pre-defined in the currency style (similarly as above). It adds a currency sign such as $, , ,... formulae are expressions which tell Excel to perform operations - All formulae begin with an =-sign followed by some arithmetic expression. - The expression may contain numeric values, cell references and arithmetic operators. It is important to note the difference between the formula inside a cell and the numerical value displayed on the WS. With Ctrl+` you can change the display. - Expl.: In the cell C5 write =A1 +A2+A3. This will add the three cells A1, A2 and A3 and displays the result in C5. When you alter A1-A3 C5 will change accordingly.
19
- In Excel and other major programming languages expressions are evaluated following a specific order of precedence for the arithmetic operators. - The order is: negation: - exponentiation: ^ multiplication and division: *, / addition and subtraction: +, - - The order of precedence can be overwritten by parentheses. Expl.: -4^2 16 -(4^2) -16 3*(5+6) 33 3*5+6 21 3^2+ 7 16 3^(2+7) 19683
20
Andreas Fring
- Formulae can be entered by means of pointing, that means instead of typing the cell reference one can simply LC on the appropriate cell. - Expl.: Enter the formula =1/(D5+G4) into B4 type =1/( into B4 LC on D5 type + LC on G4 type ) complete the entry in case you entered a formula incorrectly Excel offers a corrected version, e.g. you entered =1/(D5+G4
21
! Relative, Absolute and Mixed Cell References There are several default assumptions made by Excel when you enter a cell reference: a) Excel assumes the cell is on the same WS and in the same WB as the cell in which you enter the formula. b) Excel assumes the reference is a relative reference, that means the cell reference changes when you copy the cell. - You copy a cell or a range by selecting the range or the cell Edit Copy select the destination cell(s) Edit Paste A column or a row can be fixed by adding a $-symbol: There are four possibilities: = A1 changeable column and row (relative reference) = A$1 changeable column, fixed row (mixed reference) = $A1 fixed column, changeable row (mixed reference) = $A$1 fixed column and row (absolute reference)
22
Andreas Fring
Examples:
copy cell paste cell relative reference reference difference C5 D6 formula being copied final formula pasted cell =G5 =$F$4
C5 C5 C5
D3 F11 F1
add one column =F4 add one row =$F$4 =$F4 add one column =K7*B$7 subtract 2 rows =A3+$B7 add 3 columns add 6 rows add 3 columns subtract 4 rows f(A1:B5) f(A$3:A7) =A3 =Z5
=$F5
=L5*C$7 =B1+$B5 f(D7:E11) f(D$3:D13) =#REF!
=AC1
- f(...) indicates some function see below =#REF! is an error message cell reference not valid
23
! Naming cells or ranges: You can attach a name of your choice to a cell or a range and then use it as variable in a formula instead of a lengthy references: Menu bar: Insert Name Define -The name will also appear in the reference area. You can also type there directly to give a name to the cell.
Expl.: cell A1 is called b and cell E8 is called a =(A1+E8)^2 =(a+b)^2 the range B2:H8 is called City =f(B2:H8) =f(City)
24