Excel Formulas: Copying, Pasting, and Using Functions - Prof. Johan Dorp, Study notes of Systems Engineering

Instructions on copying and pasting formulas in excel using both keyboard shortcuts and toolbar buttons. It also explains how to copy formulas and paste values, and discusses the use of absolute and relative addresses. Additionally, the document covers basic excel elements such as rows, columns, values, labels, and formulas. It also introduces various functions like sum, count, average, max, min, and if, as well as lookup functions like vlookup.

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-ufb
koofers-user-ufb 🇺🇸

8 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Excel Tutorial to Improve Your Efficiency
Introduction
Our purpose with this Excel tutorial is to illustrate some Excel tips that will dramatically
improve your efficiency. We make no attempt to be as encyclopedic as some of the 800-page
Excel manuals available. We concentrate on common tasks, not every last thing that can be done
in Excel. Also, we presume that you have some Excel knowledge. We assume you know about
rows and columns, values, labels, and formulas, relative and absolute addresses, and other basic
Excel elements. If you know virtually nothing about Excel, you probably ought to work through
an “Excel for Dummies” book and then work through this tutorial.
The style of this tutorial should be easy to follow. Main topics appear in bold black type.
Specific direction headings are in bright yellow, and these are followed by detailed directions in
bright red. Additional comments about the directions appear in blue. A key feature of this
tutorial is that we have embedded numerous sample Excel spreadsheets so that you can try out
the directions right away—without switching into Excel. When you double-click on one of these
spreadsheets, you launch Excel, and the spreadsheet “comes alive.” The menus and toolbars
even change to those for Excel. By clicking outside one of these spreadsheets, you’re back in
Word.
A few of the topics are best carried out on your own PC (as opposed to your school’s networked
PCs), and we haven’t included sample spreadsheets for these. The reason is that they change the
way a specific copy of Excel is set up. If you do one of these exercises on your school’s
networked PCs, the chances are that they won’t take effect, at least not permanently, because of
the way Excel is set up on the network. These topics are preceded by asterisks. Try them on
your own home PC, where you have complete control.
The easiest way to maneuver around this tutorial is to take advantage of built-in bookmarks.
Each main section is bookmarked. To go to any section, use Word’s Edit/Go To menu item,
select Bookmark under Go To What, and choose from the drop-down list of bookmarks. You
can do this at any time to find a topic you want to explore. In fact, try it right now to get a quick
feel for the topics covered in this tutorial.
Finally, we suggest that you save this file–RIGHT NOW–as MyXLTutorial.doc (or some such
name) and work with the copy. That way, if you mess anything up as you try the exercises, you
can always go back and retrieve the original file (ExcelTutorial.doc).
Have fun!
Moving to the top of the sheet
Often you want to reorient yourself by going back to the “home” position on the worksheet.
To go to the top left of the sheet (cell A1):
Press Ctrl-Home (both keys at once).
Try it!
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Excel Formulas: Copying, Pasting, and Using Functions - Prof. Johan Dorp and more Study notes Systems Engineering in PDF only on Docsity!

Excel Tutorial to Improve Your Efficiency

Introduction

Our purpose with this Excel tutorial is to illustrate some Excel tips that will dramatically

improve your efficiency. We make no attempt to be as encyclopedic as some of the 800-page

Excel manuals available. We concentrate on common tasks, not every last thing that can be done

in Excel. Also, we presume that you have some Excel knowledge. We assume you know about

rows and columns, values, labels, and formulas, relative and absolute addresses, and other basic

Excel elements. If you know virtually nothing about Excel, you probably ought to work through

an “Excel for Dummies” book and then work through this tutorial.

The style of this tutorial should be easy to follow. Main topics appear in bold black type.

Specific direction headings are in bright yellow, and these are followed by detailed directions in

bright red. Additional comments about the directions appear in blue. A key feature of this

tutorial is that we have embedded numerous sample Excel spreadsheets so that you can try out

the directions right away—without switching into Excel. When you double-click on one of these

spreadsheets, you launch Excel, and the spreadsheet “comes alive.” The menus and toolbars

even change to those for Excel. By clicking outside one of these spreadsheets, you’re back in

Word.

A few of the topics are best carried out on your own PC (as opposed to your school’s networked

PCs), and we haven’t included sample spreadsheets for these. The reason is that they change the

way a specific copy of Excel is set up. If you do one of these exercises on your school’s

networked PCs, the chances are that they won’t take effect, at least not permanently, because of

the way Excel is set up on the network. These topics are preceded by asterisks. Try them on

your own home PC, where you have complete control.

The easiest way to maneuver around this tutorial is to take advantage of built-in bookmarks.

Each main section is bookmarked. To go to any section, use Word’s Edit/Go To menu item,

select Bookmark under Go To What, and choose from the drop-down list of bookmarks. You

can do this at any time to find a topic you want to explore. In fact, try it right now to get a quick

feel for the topics covered in this tutorial.

Finally, we suggest that you save this file–RIGHT NOW–as MyXLTutorial.doc (or some such

name) and work with the copy. That way, if you mess anything up as you try the exercises, you

can always go back and retrieve the original file (ExcelTutorial.doc).

Have fun!

Moving to the top of the sheet

Often you want to reorient yourself by going back to the “home” position on the worksheet.

To go to the top left of the sheet (cell A1):

Press Ctrl-Home (both keys at once).

Try it!

Down in the midst of the worksheet

Using End-arrow key combinations

To go to the end of a range (top, bottom, left, or right):

Press the End key, then the appropriate arrow key. For example, press End and then right arrow

to go to the right edge of a range.

Try it! Starting at a corner (a bordered cell), move around to the other corners

The action of an End-arrow combination depends on where you start. It takes you to the last

nonblank cell if you start in a nonblank cell. (If there aren’t any nonblank cells in that direction,

it takes you to the far edge of the sheet.) If you start in a blank cell, it takes you to the first

nonblank cell.

Splitting the screen

It is often useful to split the screen so that you can see more information.

To split the screen vertically, horizontally, or both:

Click on the narrow “screen splitter” bar just to the right of the bottom scroll bar (for vertical

splitting) or just above the right-hand scroll bar (for horizontal splitting) and drag this to the left

or down.

Splitting gives you two “panes” (or four if you split in both directions). Once you have these

panes, practice scrolling around in any of them, and see how the others react.

Try it! Split the screen either way and then remove the split

Selecting more than one range

Say you want to format more than one range in a certain way (as currency, for example). The

quickest way is to select all ranges at once and then format them all at once.

To select more than one range:

Select the first range, press the Ctrl key, select the second range, press the Ctrl key, select the

third range, and so on.

For example, to select the ranges B2:D5 and F2:H5, click on B2, hold down the Shift key and

click on D5 (so now the first range is selected), hold down the Ctrl key and click on F2, and

finally hold down the Shift key and click on H5.

Try it! Select all three numerical ranges shown.

Copying and pasting

Copying and pasting (usually formulas) is one of the most frequently done tasks in Excel, and it

can be a real time-waster if done inefficiently. Many people do it as follows. They select the

range to be copied (often in an inefficient manner), then select the Edit/Copy menu item, then

select the paste range (again, often inefficiently), and finally select the Edit/Paste menu item.

There are much better ways to get the job done!

To copy and paste using keyboard shortcuts:

Select the copy range (using one of the efficient selection methods described above), press Ctrl-c

(for copy), select the paste range (again, efficiently), and press Ctrl-v (for paste).

The copy range will still have a dotted line around it. Press the Esc key to get rid of it.

Try it! Copy the formula in cell C2 down through cell C8 using Ctrl-c and Ctrl-v.

To copy and paste using toolbar buttons:

Proceed as above, but use the copy and paste toolbar buttons (on the top toolbar) instead of the

Ctrl-c and Ctrl-v key combinations.

Try it! Copy the formula in C2 down through cell C8 using the Copy and Paste buttons.

Buttons or key combinations? It’s a matter of personal taste, but either is a lot quicker than menu

choices!

A frequent task is to enter a formula in one cell and copy it down a row or across a column.

There are several very efficient ways to do this.

To avoid copying and pasting altogether, use Ctrl-Enter:

Starting with the top or left-hand cell, select the range where the results will go. (Use the

selection methods described earlier, especially if this range is a long one.) Type in the formula,

and press Ctrl-Enter instead of Enter.

Try it! Fill up the range C2:C8 with Ctrl-Enter.

Enter the formula in the top or left-hand cell of the intended range. Double-click on the drag

handle.

This method uses Excel’s built-in intelligence, but it only works in certain situations. Let’s say

you have numbers in the range A3:B100. You want to enter a formula in cell C3 and copy it

down to cell C100. Since this is a common thing to do, Excel does it for you if you double-click

on the drag handle. It senses the “filled-up” range in column B and figures you want another

filled-up range right next to it in column C. If there were no adjacent filled-up range, double-

clicking on the drag handle wouldn’t work.

Try it! Copy the formula in C2 down through C8 by double-clicking the “drag handle.”

Copying and Pasting with the Special/Values option

Often you have a range of cells that contains formulas, and you would like to replace the

formulas with the values they produce. Usually, you paste these values onto the copy range, that

is, you overwrite the formulas with values. However, you could also select another range for the

paste range.

To copy formulas and paste values:

Select the range with formulas, press Ctrl-c to copy, and select the range where you want to paste

the values (which could be the same as the copy range). Then (since there is no keyboard

equivalent) select the Edit/Paste Special menu item, and select the Values option.

Try it! Copy the range D2:D8 to itself, but paste values.

You might want to experiment with the other options on the Edit/Paste Special dialog box. For

example, if you have a set of labels entered as a row and you want this same set of labels entered

somewhere else as a column, try copying and pasting special with the Transpose option.

Moving (cutting and pasting)

Often you would like to move information from one place in the sheet to another.

To move (cut and paste):

Select the range to be cut, press Ctrl-x (for cutting), select the upper left corner of the paste

range, and press Ctrl-v.

As with copying and pasting, toolbar buttons can be used instead of key combinations, but either

is more efficient than selecting menu items. Also, note that you only need to select the upper left

cell of the paste range. Excel knows that the shape of the paste range is the same as the shape of

the cut range.

Try it! Move the range A2:C8 to the range D2:F8. (Watch how relative addresses affect the

eventual formulas in column F.)

Using absolute/relative references

Absolute and references are indicated in formulas by dollar signs or the lack of them, and they

indicate what happens when you copy or move a formula to a range. You typically want some

parts of the formula to stay fixed (absolute) and others to change relative to the cell position.

This is a crucial concept for efficiency in spreadsheet operations, so you should take some time

to understand it thoroughly. Here are two keys. (1) The dollar signs are relevant only for the

purpose of copying or moving; they have no inherent effect on the formula. For example, the

formulas =5B3 and =5$B$3 in cell C3, say, produce exactly the same result. Their difference

is relevant only if cell C3 is copied or moved to some range. (2) There is never any need to type

the dollar signs. This can be done with the F4 key.

To make a cell reference absolute or mixed absolute/relative using the F4 key:

Enter a cell reference such as B3 in a formula. Then press the F4 key.

In fact, pressing the F4 key repeatedly cycles through the possibilities: B3 (neither row nor

column fixed), then $B$3 (both column B and row 3 fixed), then B$3 (only row 3 fixed), then

$B3 (only column B fixed), and back again to B3.

Try it! Enter the appropriate formula in cell B7 and copy across to E7. (Scroll to the right to see

the correct answer.)

Month Price Units sold Revenue Jan $3.00 100 $300. Mar $3.25 50 $162. Jun $3.50 200 $700.

Columns are inserted in the same way, except that the key sequence is Alt-i and then c.

Try it! Insert blank columns for sales reps Baker, Miller, and Smith (so that the sales reps are in

alphabetical order from left to right).

Sales rep Allison Jones Taylor Commission rate 5.4% 6.5% 4.3% Sales $15,000 $12,000 $17, Commission $810 $780 $

To delete one or more rows:

Click on a row number and drag down as many rows as you want to delete, and then press Alt-e

and then d (the menu equivalent of Edit/Delete). Columns are deleted in exactly the same way.

Try it! The company no longer carries products K322 and R543, so get rid of their rows.

Product Code Units sold Unit price J645 148 $15. K322 278 $17. L254 384 $25. M332 13 $30. R543 247 $22. S654 315 $35.

Filling a series

Say you want to fill column A, starting in cell A2, with the values 1, 2, and so on up to 1000.

There is an easy way.

To fill a column range with a series:

Enter the first value in the first cell (1 in cell A2). With the cursor in the starting cell (A2), use

the menu item Edit/Fill/Series to obtain a dialog box. Change the Row setting to Column, make

sure the Type setting is Linear, make sure 1 is in the Step Value box, enter the final value (1000)

in the Stop Value box, and click on OK.

As you can guess from this dialog box, many other options are possible. Don’t be afraid to

experiment with them.

Try it! The series of days in column A should go from 1 to 25, in column D it should go from 26

to 50.

Day Sales Day Sales $227 $ $157 $ $143 $ $129 $ $102 $ $116 $ $269 $ $111 $ $210 $

Using the summation button

The SUM function is used so often to sum across rows or columns that a toolbar button (the

button) is available to automate the procedure. To illustrate its use, suppose you have a table

of numbers in the range B3:E7. You want the row sums to appear in the range F3:F7, and you

want the column sums to appear in the range B8:E8. It’s easy.

To produce row and column sums with the summation button:

Select the range(s) where you want the sums (F3:F7 and B8:E8–remember how to select multiple

ranges), and click on the summation button.

Note that if you select multiple cells, you get the sums automatically. If you select a single cell

(such as when you have a single column of numbers to sum), you’ll be shown the sum formula

“for your approval” and you’ll have to press Enter to actually enter it. Why does Excel do it this

way–your guess is as good as ours!

Try it! Use the summation button to fill in the row and column sums.

Suppose you have the labels Revenue, Cost, and Profit in cells A20, A21, and A22, and you

would like the cells B20, B21, and B22 (which will contain the values of revenue, cost, and

profit) to have these range names. Here’s how to do it quickly.

To create range names from adjacent labels:

Select the range consisting of the labels and the cells to be named (A20:B22). Then use the

Insert/Name/Create menu item, make sure the appropriate box (in this case, Left Column) is

checked, and click on OK.

Excel tries (usually successfully) to guess where the labels are that you want to use as range

names. If it guesses incorrectly, you can always override its guess.

Try it! Name the ranges A3:A8, B3:B8, and so on according to the labels in row 2.

Month UnitsSold UnitPrice Revenue Jan 100 $1.25 $125. Feb 150 $1.25 $187. Mar 200 $1.40 $280. Apr 230 $1.40 $322. May 200 $1.50 $300. Jun 300 $1.50 $450.

Sometimes you have entered a formula using cell addresses, such as =B20-B21. Later, you name

B20 as Revenue and B21 as Cost. The formula does not change to =Revenue-Cost

automatically. However, you can make it change (and hence become more readable).

To apply range names to an existing formula:

Select the cell (or range of cells) with the formula(s). Then use the Insert/Name/Apply menu

item, highlight any relevant range names for the formula(s) involved, and click on OK.

Try it! Apply the names of the cells B2 and B3 to the formulas in row 7.

Fixed cost $ Variable cost $ Month Jan Feb Mar Apr Units produced 224 194 228 258 Total cost $498 $438 $506 $

To see a list of all range names and check which ranges they apply to:

Click on the down arrow at the right of the name box, and click on any of the range names you

see. That range will then be selected automatically.

Try it! There are five named ranges below. Locate them.

98 Junk Junk Junk Junk

Sometimes it is straightforward to use range names in formulas. For example, if B20 is named

Revenue and B21 is named Cost, then entering the formula =Revenue-Cost in, say, cell B22 is a

natural thing to do. But consider this situation. The range B3:B14 contains revenues for each of

12 months, and its range name is Revenues. Similarly, C3:C14 contains costs, and its range

name is Costs. For each month you want that month’s revenue minus cost in the appropriate cell

in column D. You will get it correct if you select the range D3:D14, type the formula

=Revenues-Costs, and press Ctrl-Enter. If you click on any cell in this range, you’ll see the

formula =Revenues-Costs.

This can be confusing. How does Excel know that the formula in D3, for example, is really =B3-

C3? Let’s just say that it’s smart enough to figure this out. If it confuses you , however, you can

always enter =B3-C3 and copy it down. Then you’re safe, but you’ve lost the advantage of range

names!

Try it! Enter the formula for all of D3:D14 using range names. (If you like, calculate profits

again in column E in the usual way, without range names.)

There is a similar function, COUNTA, which counts all of the cells, numerical or otherwise, in

the range(s). For example, if cells A1, A2, and A3 contain Month, 1, and 2, respectively, then

=COUNT(A1:A3) yields 2, whereas =COUNTA(A1:A3) yields 3.

Try it! Use the COUNT and COUNTA functions to fill in cells E1 and E2. Note that there are

students below the visible portion of the spreadsheet.

Student ID Exam score Number enrolled 3416 62 Number who took exam 6125 73 1535 74 2323 Absent 577 77 9044 57 8403 67 5892 90 4242 77

To use the AVERAGE function:

Enter the formula =AVERAGE( range ) where range is any range. This produces the average of

the numerical values in the range.

Be aware that the AVERAGE function ignores labels and blank cells in the average. So, for

example, if the range C3:C50 includes scores for students on a test, but cells C6 and C32 are

blank because these students haven’t yet taken the test, then =AVERAGE(C3:C50) averages only

the scores for the students who took the test. (It doesn’t automatically average in zeroes for the

two who didn’t take the test.)

Try it! Use the AVERAGE function to calculate the averages in cells B1 and B2. (For B2, you’ll

have to replicate the exam scores in column C and make some changes.)

Average exam score (for students who took the exam) Average exam score (if absent students get zeroes) Student ID Exam score 1533 68 8031 74 9859 80 9106 63 3535 72 8192 Absent

To use MAX and MIN functions:

Enter the formula =MAX( range ) or =MIN( range ) where range is any range. These produce the

obvious results: the maximum (or minimum) value in the range.

Try it! Use the MAX and MIN functions to fill in the range B8:C9. For example, you want the

values $2300 and $3600 in cells B8 and C9.

Sales rep Allison Baker Jones Miller Smith Taylor Jan sales $3,700 $2,400 $2,300 $3,000 $3,800 $3, Feb sales $2,600 $2,200 $2,400 $2,800 $3,600 $2, Min sales Max sales Jan Feb

Using the paste function ( fx ) button in the top toolbar

If you haven’t used this button, you should give it a try. It not only lists all of the functions

available in Excel (by category), but it also leads you through the use of them. As an example,

suppose you know there is an Excel function that does net present value, but you’re not sure what

its name is or how to use it. You could proceed as follows.

To use the paste function wizard:

Select a blank cell where you want the function to go. Press the fx button and click on the

category that seems most appropriate (Financial in this case). Scan through the list for a likely

candidate and select it (try NPV). At this point you can get help, or you can press the Next

button and enter the appropriate arguments for the function (discount rate and one or more ranges

of values).

Try it! Use the function wizard to help you determine the function in cell B6. Use the range

names in cells B3 through B5 for improved readability. (Scroll to the right to see the correct

formula.)

Payments for Mr. Jones, who just bought a new car Amount financed $15, Annual interest rate 8.90% Term (number of months financed) 36 Monthly payment

Using IF functions

Each student gets an A (if score is 90 or above), S for satisfactory (if score if 60 or above but less than 90) or U for unsatisfactory if score is below 60 Student Score Grade 1 70 2 95 3 55 4 80 5 60 6 90

Sometimes more complex conditions (AND or OR conditions) are useful in IF functions. These

are not difficult once you know the syntax.

To use an AND condition in an IF function:

Enter the formula =IF(AND( condition1 , condition2 ), expression1 , expression2 ). This results in

expression1 if both condition1 and condition2 are true. Otherwise, it results in expression.

Note the syntax. The keyword AND is followed by the conditions, separated by a comma and

enclosed within parentheses. Of course, more than two conditions could be included in the

AND.

Try it! Use an IF function with an AND condition to fill in the bordered range. (Scroll to the

right to see the correct answer - note the double quotes for labels.)

Investor sells stock only if its price has gone up three consecutive days (including the current day) Day Price change Sell (yes or no)? 1 Up 2 Down 3 Up 4 Up 5 Up 6 Down

To use an OR condition in an IF function:

Enter the formula =IF(OR( condition1 , condition2 ), expression1 , expression2 ). This results in

expression1 if either condition1 or condition2 is true (or if they’re both true). Otherwise, it

results in expression.

Again, more than two conditions could be included in the OR.

Try it! Use an IF function with an OR condition to fill in the bonuses in column F. (Scroll to the

right to see the correct answer.)

Any student who scores at least 95 on any of the exams gets a bonus which is 1% of their total score. Student Exam 1 Exam 2 Exam 3 Exam 4 Bonus 1 87 83 83 80 2 77 72 74 97 3 80 95 79 75 4 82 87 96 88 5 78 94 81 79 6 75 83 80 72

Using lookup functions

Lookup tables are useful when you want to compare a particular value to a set of values, and

depending on where your value falls, assign a given “answer.” For example, you might have a

tax table that shows, for any gross adjusted income, what the corresponding tax is. There are two

versions of lookup tables, vertical (VLOOKUP) and horizontal (HLOOKUP). Since they are

virtually identical except that vertical goes down whereas horizontal goes across, we’ll only

discuss the VLOOKUP function.

The VLOOKUP function takes three arguments: (1) the value to be compared, (2) a table of

lookup values, with the values to be compared against always in the leftmost column, and (3) the

column number of the lookup table where you find the “answer.” Since the VLOOKUP function

is often copied down a column, it is usually necessary to make the second argument an absolute

reference, and this is accomplished most easily by giving the lookup table a range name such as

LookupTable. (Range names are always treated as absolute references.)

The only requirement of a lookup table is that the values in the first column (the comparison

column) must be sorted in ascending order. Let’s say you want to assign letter grades to students

based on a straight scale: below 60, an F: at least 60 but below 70, a D; at least 70 but below 80,

a C; at least 80 but below 90, a B; and 90 or above, an A. The spreadsheet sample below shows

how you would set this up. The comparison column in the lookup table starts at 0 (the lowest

grade possible), then records the cutoff scores 60 through 90. The lookup table in the range

E2:F6 is range-named LookupTable.

The typical formula in cell C2 (which is copied down column C) is

=VLOOKUP(B2,LookupTable,2). This compares the value in B2 (67) to the values in column E

and chooses the largest value less than or equal to it. This is 60. Then since the last argument in

the VLOOKUP function is 2, the score reported in C2 comes from the second column of the

lookup table next to 60, namely, D.