0% found this document useful (0 votes)
6 views

Lect2

The document provides a comprehensive guide on basic operations in Excel, including creating and saving workbooks, entering and modifying data, formatting cells, and using functions like Autofill. It also explains different types of data, formulae, and cell references, as well as how to name cells or ranges for easier reference. The instructions are aimed at helping users effectively utilize Excel's features for data management and analysis.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lect2

The document provides a comprehensive guide on basic operations in Excel, including creating and saving workbooks, entering and modifying data, formatting cells, and using functions like Autofill. It also explains different types of data, formulae, and cell references, as well as how to name cells or ranges for easier reference. The instructions are aimed at helping users effectively utilize Excel's features for data management and analysis.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Andreas Fring

Basic Operations
! 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:

Ø 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

Programming Excel/VBA MA1603 1


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

Programming Excel/VBA MA1603 2


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

Programming Excel/VBA MA1603 3


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

Programming Excel/VBA MA1603 4


Andreas Fring

- percentage style Ø changes to a style pre-defined in the


“percentage“ style (similarly as above)
- currency style Ø 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

Programming Excel/VBA MA1603 5


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“Ø

· in case you select “No “ Excel tells you your mistake

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

Programming Excel/VBA MA1603 6


Andreas Fring

• Examples:
copy cell paste cell relative formula final
reference reference difference being formula
copied pasted cell
C5 D6 add one column =F4 =G5
add one row =$F$4 =$F$4
=$F4 =$F5
C5 D3 add one column =K7*B$7 =L5*C$7
subtract 2 rows =A3+$B7 =B1+$B5
C5 F11 add 3 columns f(A1:B5) f(D7:E11)
add 6 rows f(A$3:A7) f(D$3:D13)
C5 F1 add 3 columns =A3 =#REF!
subtract 4 rows =Z5 =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
previously defined names
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

Programming Excel/VBA MA1603 7

You might also like