Vous êtes sur la page 1sur 381

Save this file under another name, su

Introduction Changes in Excel 2007 Tabs and ribbons Office button Quick Access Toolbar (QAT) Excel Options File extensions Right-clicking Basic Spreadsheet Tasks Documenting with cell comments and text boxes Moving to the top of the sheet Undoing actions Using End-arrow key combinations Splitting the screen Selecting a range Selecting multiple ranges Copying and pasting Copying and pasting special Cutting and pasting Inserting, deleting, hiding, unhiding rows or columns Manipulating worksheets Sorting Filling a series Go To options Absolute and relative addresses Showing formulas in R1C1 notation Auditing formulas Summation button Transposing a range Range names Printing

Basic Excel functions

Charts

Hyperlinks Goal Seek Data tables

Tables Pivot tables Conditional formatting Data validation Protecting worksheets and workbook Common counting, summing, and ave

Working with text

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy. Click on any of the hyperlinks below to learn about a topic.

Basic Excel functions fx button (function wizard) SUM and AVERAGE functions COUNT, COUNTA, and COUNTBLANK functions MAX and MIN functions IF function VLOOKUP and HLOOKUP functions Common math functions Charts Creating a chart Locating a chart Modifying a chart Hyperlinks Goal Seek Data tables One-way data tables Two-way data tables Tables Pivot tables Conditional formatting Data validation Protecting worksheets and workbooks Common counting, summing, and averaging functions COUNTIF, SUMIF, and AVERAGEIF functions COUNTIFS, SUMIFS, and AVERAGEIFS functions SUMPRODUCT function Working with text TRIM and VALUE functions Concatenating text Parsing text with common text functions

Working with dates Y2K problem NOW and TODAY functions YEAR, MONTH, DAY, and WEEKDAY functions DATEDIF function DATE and DATEVALUE functions Statistical functions MEDIAN, PERCENTILE, and QUARTILE functions STDEV and VAR functions CORREL and COVAR functions RANK, LARGE, and SMALL functions Financial functions PMT function NPV and XNPV functions IRR function Reference functions INDEX function MATCH function OFFSET function Recording a macro

WEEKDAY functions

d QUARTILE functions

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

My purpose with this Excel tutorial is to illustrate some Excel tips that will dramatically improve your efficiency. I make no attempt to be as encyclopedic as some of the 800-page Excel books available. I concentrate on common tasks, not every last thing that can be done in Excel. Also, I presume that you have some Excel knowledge. For example, I assume you know about rows and columns, values, labels, and formulas, 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 is easy to follow. The table of contents contains hyperlinks to the various worksheets where you can learn and practice various skills. Each of these worksheets has a hyperlink in cell A1 back to the table of contents sheet. I suggest that you save this fileRIGHT NOWas My Excel Tutorial.xlsx (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 (Excel Tutorial.xlsx). Have fun improving your Excel skills!

e, such as My Excel Tutorial.xlsx, and work with the copy.

matically improve your cel books available. I lso, I presume that and columns, values, ing about Excel, you hrough this tutorial.

inks to the various sheets has a hyperlink

such name) and work an always go back

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

If Excel 2007 is your first exposure to Excel, you will love it. However, if you are used to Excel 2003 or an earlier version, you will have some unlearning to do. There are several big changes in Excel 2007 and many smaller changes. The first big change is that worksheets are much bigger. You used to have about 65,000 rows and 256 columns. Now you have over a million rows and over 16,000 columns. You will hardly ever use this much space, but its available. Read the next few worksheets for other significant changes.

e, such as My Excel Tutorial.xlsx, and work with the copy.

used to Excel 2003 or hanges in Excel 2007 gger. You used to nd over 16,000 ext few worksheets

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The biggest change is the one you will notice right away. You no longer have the usual menus and toolbars. Microsoft has completely reorganized the user interface to provide tabs and ribbons tab (Home, Insert, Page Layout, etc.) has an associated ribbon that is similar to the old toolbars. For example, if you click on the Formula tab, you get a ribbon with buttons that are useful for working with formulas. Each ribbon has several groups of buttons. For example, the Formulas ribbon has one group called Defined Names for manipulating range names. There is only one way to learn these ribbons, by practicing and experimenting. If you are used to the old Excel, you will undoubtedly curse at the new ones a few times when you cant find something, but you can be assured that they are more logically organized than the old versions. You cant change the new ribbons; they are built in and fixed. Well, that isn't quite true. If you dont mind writing some XML, it is possible to create new ribbons that have your favorite Excel buttons or even new buttons attached to your own macros. This is somewhat advanced, so I won't cover it here. But if you are interested, the technology is called RibbonX, which you can search for on the Web. With the old menus gone, what about the keyboard shortcuts many of you depend on? As far as I can tell, they still work, or at least most of them still work. For example, you can still press Ctrl save a file or Ctrl-p to print a file. Also, if you prefer keyboarding to mousing, here's something you will like. Press the Alt key. In the ribbon area, you will see a shortcut key for each tab. For example, M is for Formulas. Press any of these shortcut keys to see the corresponding ribbon, and each one of its buttons will have a shortcut key. Press the one you want, which is equivalent to clicking on the button. To make these shortcut keys disappear, press the Alt key again.

A few of the new tabs are not visible until you select an appropriate object. For example, when you select a chart, three new Chart Tools tabs (Design, Layout, and Format) become visible. Or when you select an Excel table, a Table Tools Design tab becomes visible. In general, Excel 2007 is more intelligent about context. In the context of what you are doing, if something is necessary, it is likely to appear. Otherwise, it stays hidden.

e, such as My Excel Tutorial.xlsx, and work with the copy.

e usual menus and ribbons. Each the old toolbars. For useful for working mulas ribbon has one ay to learn these will undoubtedly curse ured that they are

uite true. If you dont orite Excel buttons or o I won't cover it search for on the

end on? As far as I n still press Ctrl-s to

s the Alt key. In the mulas. Press any of ns will have a shortcut make these shortcut

example, when you e visible. Or when you

you are doing, if

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Some of the most common actions, such as saving and printing, are missing from the ribbons.You can find them by clicking on the Office button, the multi-colored button at the top left of your screen (or the screen shot to the right). You will see a number of categories, including New, Open, Save, Save As, Print, and others. So if you can't find something on a ribbon, look under the Office button. Note that there are other options for these common operations. First, old shortcut key combinations such as Ctrl-s for save or Ctrl-p for print still work. Also, you can put your favorite buttons on the QAT, as explained on the next worksheet. Surprisingly, you won't find a Help option under the Office button, and you won't find it on a ribbon either. But the Help button is always visible as a question mark up in the right corner of the screen. (You can also press the F1 key for help.)

e, such as My Excel Tutorial.xlsx, and work with the copy.

m the ribbons.You top left of your luding New, Open, k under the Office

ut your favorite

n't find it on a ribbon orner of the screen.

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Although you cant change the new ribbons (at least not easily), you can customize the Excel user interface to some extent. Specifically, Excel provides a quick access toolbar (QAT) at the top left of the screen. You can put your favorite buttons on this toolbar so that they are always visible and available. The QAT comes with a few favorite buttons, but you can add more. To modify the QAT: Click on the dropdown arrow to the right of the QAT. You will see a list of the most commonly used buttons, which you can check to have them appear permanently on the QAT. You can also click on the More Commands item to see a dialog box with a wealth of other buttons you can add to the QAT. In fact, if you create your own macros to perform common tasks, you can place buttons to run them on the QAT. Note that you also get to the More Commands dialog box by clicking on the Office button, then on Excel Options, and then on Customize. Try it! Add some of your favorite buttons to the QAT. You will have to do this only once! You can see my QAT below. I have added a few of the "standard" buttons, plus a few extras to run my favorite macros.

e, such as My Excel Tutorial.xlsx, and work with the copy.

mize the Excel user T) at the top left of ways visible and

most commonly used ou can also click on ou can add to the place buttons to run

ice button, then on

a few extras to run

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

One particular menu item you will miss from earlier versions of Excel is Tools-->Options, for changing various options in Excel. It is not gone; it is just in a different place. To get to it, click on the Office button (in the upper left corner of the screen) and then the Excel Options button. As shown to the right, you will see that the options are grouped in categories: Popular, Formulas, and others. might have to hunt awhile, but there are an amazing number of options available. Try it! Under the Popular group, change the default number of worksheets in a new file from 3 to 1. (Why have 3 when you usually need only 1? Besides, if you need more, you can always add them.) Try it! Under the Advanced group, the first Editing option lets you choose the direction you want the cursor to move when you press Enter. Change it to the direction you prefer. Try it! Excel makes some automatic changes for you when you type certain characters. For example, if you type (c), it automatically changes this to a copyright symbol. If you find this annoying (as I do), you can change it through the AutoCorrect Options button in the Proofing group.

e, such as My Excel Tutorial.xlsx, and work with the copy.

Options, for get to it, click on the s button. As shown to mulas, and others. You

new file from 3 to 1. always add them.)

irection you want the

racters. For example, is annoying (as I do),

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

One other important change is file extensions. Unless you wrote your own add-ins in earlier versions of Excel, the only file extension you probably ever saw was .xls. You can still save files with this extension, but they will lose any features new to Excel 2007. To save them and keep new features, you should save them as .xlsx files. The new "x" at the end of the extension (which appears in Word and PowerPoint 2007 files) stands for XLM, the format that these files are now stored in. Note that if you save your file as an .xlsx file, people with Excel 2003 wont be able to open it unless they download and install a free file format converter from Microsoft. (Do a Web search for Microsoft Office Compatibility Pack to find this free download.) In the other direction, if you save file created in Excel 2007 as an .xls file, it will probably work fine, and it will be readable by users with older versions of Excel, but it won't be to take advantage of changes in Excel 2007.

One other new file extension is .xlsm. If your Excel file has associated VBA macros, then you must save it as an .xlsm file ("m" for macro). You might also see files with an .xlam extension. These are Excel add-ins.

e, such as My Excel Tutorial.xlsx, and work with the copy.

ins in earlier versions e files with this keep new features, hich appears in Word

ble to open it unless eb search for rection, if you save a eadable by users

os, then you must xtension. These are

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Right-clicking on various things is not new to Excel 2007, although I wouldn't be surprised if there are now more options than ever. If you want instant context-sensitive menus, you should get used to right-clicking. This almost always leads to a useful menu of options. Try it! Highlight the sales figures to the right and then right-click. This allows you to format the cells and do many other things. Format these cells as currency with zero decimals. Try it! Click anywhere on the chart to the right and then right-click. You will get a menu, but the menu items will depend on what you selected on the chart. Try selecting different parts of the chart to see what I mean. Try it! Select this text box you're reading and then right-click. You will get a menu for modifying the text box in some way. Try it! Select the screenshot to the right (which I inserted as a Picture) and then right-click. Another menu! Try it! Right-click on this worksheet's tab. Another menu! Are you starting to realize how useful right-clicking can be? Did you notice that when you right-clicked on the sales values, you not only got a menu, but you also got a mini-toolbar above the menu? Try it again to see what I mean. There is also a miniwhen you right-click on a chart. These toolbars are new to Excel 2007, so watch for them when you right-click on something. They don't always appear, but when they do, they provide still one more quick way to accomplish common tasks.

e, such as My Excel Tutorial.xlsx, and work with the copy. Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sales 3108 3993 1644 3078 1830 3279 3413 1197

surprised if there ou should get used

Sales
5000 4000 3000 2000 1000 0 Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09

u to format the cells

a menu, but the ent parts of the chart

nu for modifying the

click. Another

a menu, but you is also a mini-toolbar for them when you vide still one more

Jun-09 Jul-09 Aug-09

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

This section illustrates a number of ways to make you more efficient: how to select ranges, how to copy and paste, how to deal with absolute and relative addresses, how to insert and delete rows or columns, and a few others. Most Excel users know how to do these things, but they often do them inefficiently. So even though this material might seem elementary, read onyou might just pick up a few new tricks.

e, such as My Excel Tutorial.xlsx, and work with the copy.

lect ranges, how to t and delete rows or they often do them ou might just pick up

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

There is nothing worse than getting a spreadsheet from someone with no documentation. All you see are a lot of meaningless numbers and possibly a few not-well-thought-out labels. This is a very bad practice, and you shouldn't be guilty of it. There are a number of things you can do to document your work. Of course, you can have labels and a nice structure, such as in the example to the right. But you can do more than this. Specifically, you can include cell comments and text boxes, as explained below. A cell comment is useful when you want to explain something that is probably not obvious in a particular cell. You will know a cell contains a comment when you see a little red mark in the upper right corner of the cell. You can see the cell comment by hovering the cursor over the cell. By default, a cell comment starts with the owner's name, but you can delete this name if you like. To insert a cell comment in a cell, right-click on the cell. If there is no existing cell comment, you will see an Insert Comment item. If there is an existing cell comment, you will see Edit Comment and Delete Comment items. (See the screenshots to the right.) Try it! Add the following cell comment to cell R10: Sales are in $1000s. Then change the comment to: Monthly sales in $1000s. Then delete the cell comment.

When you add explanations to your worksheets, do you tend to start typing in a cell, and when it gets long enough, you continue typing on the next line, etc.? A lot of people do this, including myself in past years. It is not a good habit, mostly because of the difficulty of editing. It is much better to use text boxes, as you see throughout this tutorial. Text boxes are much better for explanations than cells because they have word wrap. They are essentially mini-word processors that can be edited (and moved or resized) easily. You should use them in virtually every spreadsheet you create! To insert a text box, click on the Text Box button on the Insert ribbon (see to the right), and drag a text box in some area of the worksheet. Then start typing. It's as easy as that. You might also want to change the appearance of the text box. To do so, click on it twice so that the border becomes a solid line (it's a dotted line after the first click). Then right-click and choose the Format Shape item. This brings up a dialog box where you can make all sorts of changes. For example, in this tutorial I changed the text boxes to have a light gray fill and a shadow. If you like the appearance, you can again right-click and choose the Set as Default Text Box item. Then every other text box you create in that workbook will automatically have the same appearance. Try it! Create a text box to the right and enter some text. You will see that it automatically has the same appearance as the rest of the text boxes in this tutorial. Now change the appearance of your new text box in some way.

e, such as My Excel Tutorial.xlsx, and work with the copy.

mentation. All you abels. This is a very u can do to document xample to the right. text boxes, as

not obvious in a d mark in the upper er the cell. By ame if you like.

ll comment, you will dit Comment and

Sales 15.3 14.7 9.6 12.1 14.2

ange the comment

a cell, and when it this, including myself is much better to for explanations sors that can be eadsheet you create!

e right), and drag a

n it twice so that the ck and choose the changes. For hadow. If you like the em. Then every other

tomatically has the appearance of your

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

e, such as My Excel Tutorial.xlsx, and work with the copy.

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): Try it! Press Ctrl-Home (both keys at once).

Down in the midst of the worksheet

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

We all make mistakes, often careless mistakes. For example, I often press Ctrl-v (paste) when I mean to press Ctrl-c (copy). This can have the effect of pasting a lot of junk onto a range that I never intended. At this point, I am hoping I can easily undo the mistake. This is usually possible, but not always. Excel stores most of your actions so that it can undo them. There are two ways to undo actions. The first is the simplest, but the second gives you more control. To undo the previous action: Press Ctrl-z. You can do this easily with the small finger and index finger of your left hand. This should become one of your favorite keyboard shortcuts! Or: Click on the Undo button (the button with a circular arrow pointing counter-clockwise to the right). This Undo button isn't on any of the ribbons, but it can be placed on the Quick Access Toolbar (QAT) at the top of the screen. In fact, I believe it is placed there by default. (There is also a Redo button, also shown to the right, for undoing an undo.) Note that there is a dropdown arrow next to the Undo button. This allows you to select the action (not necessarily the previous action) to undo. As you can see from this dropdown, Excel remembers a lot of your most recent actions. However, if you select , say, the third most recent action, you undo this action and the other two most recent actions, that is, it is cumulative. I am not sure which actions can be undone and which can't, so I experiment. For example, you can't undo adding a worksheet or deleting a worksheet. This is a good reason (one of many) for saving often! Try it! Enter formulas in column N to sum the two numbers to their left. Then get rid of these formulas with either undo method.

e, such as My Excel Tutorial.xlsx, and work with the copy. 11 15 45 48 45 18 26 17 14 43 4 10 45 39 19 16 40 1 38 41 12 14 1 43 38 25

(paste) when I mean ge that I never y possible, but not

ves you more control.

left hand. This

ckwise to the right).

Access Toolbar (QAT) also a Redo button,

to select the action wn, Excel remembers cent action, you

r example, you can't many) for saving

et rid of these

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

It is often useful to zoom to the bottom, top, left, or right edge of a data range. You can do this easily with the 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. (Let go of the End key before pressing the 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) to the right, move around to the other corners.

If you keep your finger on the Shift key while you do an End-arrrow combination, you select (highlight) the range in between. Try it! Starting at a corner (a bordered cell) to the right, move around to the other corners. But this time, keep your finger on the Shift key.

Note that 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 arent 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. Try it! Move around the range to the right, where there are some blank cells.

e, such as My Excel Tutorial.xlsx, and work with the copy.

You can do this

e pressing the arrow

8 5 10 10 5 7 2

1 5 5 10 4 4 8

1 7 3 5 3 5 9

1 6 10 9 4 1 10

her corners.

n, you select

her corners. But this

8 5 10 10 5 7 2

1 5 5 10 4 4 8

1 7 3 5 3 5 9

1 6 10 9 4 1 10

. It takes you to the lls in that direction, to the first nonblank

8 5 10 10 7 2

1 5 5 10 4 4

1 7 3 3 5 9 10 9 4 1 10

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

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. (See the screenshots below.) 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 both ways so that you can see the top left cell in the data to the right (cell M3) and the bottom right cell (cell AE265). Then remove the splits.

e, such as My Excel Tutorial.xlsx, and work with the copy. 61 95 33 49 10 14 21 8 94 84 62 16 93 6 28 66 56 3 33 34 80 53 77 64 39 75 58 56 5 80 6 52 83 8 55 51 39 50 42 48 54 15 28 28 99 91 8 93 47 65 69 80 74 33 17 79 29 54 39 91 28 100 34 13 55 45 96 57 86 28 97 14 58 99 67 22 100 32 51 21 88 97 80 73 60 12 63 41 15 3 84 14 80 37 46 15 46 24 56 60 43 76 2 52 57 57 36 87 50 3 89 54 38 26 43 99 66 57 11 47 30 67 19 93 30 93 37 41 4 26 31 54 18 100 52 8 68 5 41 42 73 93 77 88 87 80 6 11 66 78 51 48 45 83 9 83 41 52 30 41 71 95 81 59 99 3 91 90 30 49 61 14 96 25 34 66 42 72 28 27 3 33 60 56 52 11 35 9 51 32 11 90 82 33 29 87 46 45 53 67 23 100 44 35 27 66 35 48 7 77 40 27 44 28 5 96 25 76 21 87 87 15 18 4 39 62 23 30 38 90 75 95 92 73 46 9 32 33 2 82 44 60 76 20 99 31 1 94 69 86 63 18 63 8 50 19 59 22 55 26 88 17 49 30 79 68 32 36 9 60 11 13 13 46 37 77 35 46 22 100 24 40 18 23 24 99 71 85 83 25 12 28 46 52 76 42 41 27 84 42 67 11 100 97 1 59 44 43 74 62 48 73 54 94 4

ar (for vertical ag this to the left or

u have these panes,

a to the right (cell

24 19 21 30 93 32 35 82 23 59 17 4 67 17 71 48 29 58 64 14 67 90 83 21 14 38 64 10 53 79 90 60 67 22 80 86 41 8 58 9 21 64 59 18 17 22 72

32 28 31 76 98 54 32 86 94 62 19 62 58 41 8 41 97 15 66 48 56 97 17 32 27 87 15 24 10 70 19 59 9 53 17 16 46 66 52 10 23 79 93 54 49 24 62

55 46 14 53 84 80 25 46 71 88 95 36 54 21 45 36 30 37 57 78 76 41 24 27 3 57 57 39 66 94 84 36 71 52 94 44 51 13 88 80 18 96 64 3 70 96 35

62 73 78 91 86 51 34 28 95 21 63 55 91 18 90 7 76 56 26 6 7 63 75 46 62 5 23 52 31 39 3 83 3 45 59 67 42 63 11 57 11 60 38 25 22 90 54

100 83 87 46 97 59 37 54 56 2 4 37 39 24 1 69 59 25 39 72 97 79 31 59 48 39 94 80 7 66 4 90 84 50 82 60 50 76 35 97 83 21 26 10 71 79 98

30 78 14 94 9 62 83 56 37 57 99 49 76 6 34 54 85 71 63 26 89 20 11 22 39 100 63 100 99 37 48 42 2 20 93 14 52 23 21 49 7 49 71 80 98 26 13

82 96 49 2 98 6 51 26 97 19 93 11 25 65 11 5 39 3 17 1 44 90 98 82 43 56 96 28 48 7 34 45 95 39 50 38 38 58 57 89 50 80 1 46 81 13 94

56 10 72 72 94 44 4 44 80 41 21 35 44 38 45 47 64 79 25 47 2 73 97 62 22 48 63 59 23 73 87 25 87 1 25 3 21 46 41 74 8 64 60 24 66 5 51

81 95 77 46 62 16 78 53 8 77 28 79 19 82 91 24 36 62 11 1 65 21 29 31 42 12 62 83 53 85 76 36 49 65 7 15 88 8 32 5 52 28 75 32 100 21 11

96 47 68 33 70 63 4 42 23 13 20 17 27 78 77 39 57 44 56 96 45 96 26 48 23 99 60 41 55 62 44 61 6 3 5 36 92 27 70 50 77 1 59 42 97 61 13

90 39 43 91 62 96 57 63 12 57 14 53 44 93 37 50 8 21 79 34 17 87 8 1 87 78 7 52 94 26 15 5 24 98 62 21 53 24 57 73 79 99 23 22 47 56 49

42 40 75 76 1 93 89 53 57 84 34 48 81 9 45 25 7 75 80 33 6 87 25 100 55 21 95 33 79 65 5 95 96 88 60 81 26 80 7 14 18 41 50 45 89 43 60

44 74 89 68 71 42 63 73 71 1 77 31 54 49 46 65 85 43 68 30 16 33 35 11 73 25 7 77 73 82 76 95 32 93 41 37 82 66 68 35 82 63 98 40 46 59 16

88 48 23 54 46 98 14 15 55 92 12 52 47 1 5 52 97 58 68 92 19 95 27 71 89 58 9 59 53 48 8 55 90 52 36 48 74 74 37 70 17 89 8 78 89 39 15

80 69 44 36 90 29 87 80 67 78 59 50 91 36 93 31 32 36 10 51 54 18 20 84 2 80 6 55 6 6 48 49 89 82 29 11 43 17 100 65 26 85 27 74 90 81 87

38 59 43 96 35 11 99 41 86 98 7 65 58 92 31 42 76 13 72 41 51 22 36 81 32 80 73 88 14 85 82 16 65 96 39 49 21 77 87 56 50 4 34 50 4 67 10

15 95 36 63 33 97 83 1 89 73 61 6 44 28 27 27 74 30 34 64 44 68 76 83 35 49 48 39 68 2 90 70 76 81 13 96 73 29 58 63 7 11 52 36 53 18 62

55 21 99 2 45 85 90 99 90 2 27 73 11 37 55 37 40 44 68 66 70 19 29 45 35 44 54 92 28 88 87 33 38 70 40 18 40 50 88 89 90 95 95 79 74 3 20

84 59 84 69 100 100 96 56 17 43 45 62 100 38 85 83 8 71 46 64 39 62 14 67 77 55 20 91 42 9 29 38 66 57 71 36 37 77 19 78 32 8 58 4 9 36 81

4 78 57 5 95 17 54 87 97 55 25 5 82 4 54 42 61 60 1 25 66 49 36 76 100 44 12 88 87 46 56 89 65 16 72 30 28 10 44 60 25 72 72 91 37 41 35

68 9 72 56 30 81 33 85 64 81 32 96 50 30 65 5 46 83 35 66 38 31 22 65 51 25 73 70 68 3 68 89 90 56 68 71 24 53 54 49 80 16 88 62 100 24 2

85 63 8 14 70 35 24 66 75 47 75 62 90 9 58 87 5 71 40 77 62 75 68 68 60 38 13 65 11 100 93 99 47 62 36 50 71 33 68 80 82 70 95 24 1 91 100

30 71 18 23 68 20 42 34 35 61 83 32 2 4 47 29 37 55 27 90 31 7 54 17 53 44 2 78 74 79 77 39 15 100 37 30 63 54 32 89 22 43 33 70 42 26 79

97 10 40 86 65 39 69 71 7 39 38 49 31 60 83 30 65 13 2 32 22 75 34 81 39 18 66 33 100 1 58 52 65 64 100 8 57 72 91 86 53 74 7 27 24 84 78

86 68 81 50 22 36 77 48 53 77 56 76 1 71 28 76 32 82 33 82 48 57 43 73 63 1 24 93 95 30 4 60 34 94 34 81 70 49 5 36 19 72 76 78 11 65 99

13 99 20 65 38 60 10 48 28 63 55 59 86 6 10 72 8 26 73 40 69 36 18 51 39 14 33 61 33 38 76 13 2 41 96 33 12 3 34 50 14 45 39 78 41 71 41

26 9 19 69 67 83 87 54 9 54 5 48 96 49 39 11 44 58 3 62 66 24 89 24 49 6 64 75 87 38 71 65 49 79 54 75 93 68 66 78 39 41 88 36 78 15 89

91 92 21 52 79 62 33 45 82 89 96 40 41 33 15 91 42 53 87 49 28 65 25 99 52 88 9 81 58 2 79 16 3 3 46 76 83 38 31 81 86 13 55 85 58 32 12

58 45 21 53 5 35 53 51 35 22 4 8 75 5 13 31 98 6 97 67 16 49 6 81 55 79 7 97 68 26

12 98 50 25 51 83 25 24 4 80 54 88 28 35 5 64 67 64 55 43 79 82 83 84 13 51 60 29 29 43

65 2 29 43 1 10 29 71 69 64 13 74 66 40 86 50 43 79 34 50 76 70 5 67 37 75 8 35 86 93

57 43 23 25 1 62 1 78 90 22 100 93 58 86 97 32 64 7 5 69 21 80 79 96 12 17 51 1 53 34

60 82 18 98 36 46 97 75 27 36 97 53 48 85 42 28 41 7 19 37 85 13 15 65 100 89 74 37 36 93

52 3 59 79 34 46 7 40 70 66 23 84 87 56 43 86 72 94 89 11 12 44 91 88 57 44 41 65 26 35

37 26 79 6 51 82 45 97 16 3 71 2 30 79 21 46 95 92 58 16 67 70 92 82 68 22 84 88 23 17

33 12 34 50 31 36 95 28 39 61 52 62 31 49 88 18 33 86 13 33 14 21 72 28 44 63 32 54 56 90 32 72 11 60 16 68 69 27 44 96 34 11 96 43 18

83 3 23 100 56 66 27 100 93 83 22 94 42 87 45 32 30 28 7 93 27 29 50 48 12 15 29 97 76 92 57 12 18 46 86 44 92 73 68 39 46 91 3 56 63

70 100 57 40 29 32 25 22 77 71 58 34 58 46 3 34 26 100 27 18 75 68 83 27 47 91 35 81 54 86 49 79 68 59 85 95 16 88 36 45 29 96 50 98 56

84 42 56 59 78 97 39 31 39 93 80 34 13 75 30 71 38 70 92 92 89 76 56 67 79 40 46 34 23 59 8 9 91 77 86 13 86 11 69 13 50 14 58 80 22

94 23 82 34 88 51 33 97 51 74 41 91 20 58 36 54 78 72 43 16 99 44 12 62 46 1 96 12 33 59 63 27 99 45 100 18 68 79 98 91 88 29 89 86 66

30 85 3 22 67 41 93 78 75 34 93 57 20 95 90 65 44 45 19 9 9 97 29 52 32 68 80 85 77 94 64 31 41 7 90 81 83 6 35 85 14 64 69 71 36

49 57 62 37 62 90 81 79 63 52 77 9 58 64 61 39 4 7 59 95 46 68 60 39 58 95 77 9 7 24 10 20 92 12 83 23 22 16 16 3 43 78 40 40 51

86 84 89 39 23 79 44 17 6 4 33 49 23 9 40 72 59 49 8 61 3 7 65 46 36 2 31 66 2 17 34 25 91 6 1 31 89 40 18 47 47 57 42 15 18

7 89 17 24 32 49 4 62 63 26 8 93 16 8 12 94 90 10 91 27 51 19 93 20 71 61 34 69 2 90 41 54 19 57 63 28 64 73 54 50 47 91 5 90 29

17 39 85 64 94 8 54 57 84 66 50 62 22 10 60 9 96 78 46 84 99 95 72 12 8 61 6 88 21 78 91 17 44 23 47 99 16 1 6 1 96 80 66 49 44 63 56

79 32 75 34 44 29 45 3 7 65 100 7 55 83 21 46 30 83 76 26 19 87 91 65 81 5 54 21 85 57 41 64 67 68 67 57 49 70 14 5 3 80 39 26 23 60 28

11 42 84 41 61 4 52 67 68 32 2 70 23 45 93 46 40 65 99 48 73 92 5 48 19 62 27 15 20 92 11 83 18 48 46 37 60 47 82 83 33 52 49 52 94 59 85

41 45 43 41 47 30 57 91 8 89 28 31 23 42 63 60 26 98 14 29 67 71 65 24 36 84 1 62 63 31 41 9 14 12 19 53 66 15 3 24 46 4 58 92 46 38 44

86 66 63 26 37 63 4 83 51 11 34 11 66 84 88 90 36 46 37 43 47 50 100 83 76 84 58 70 37 47 40 66 12 5 28 48 4 11 30 65 95 6 11 36 84 35 97

87 2 48 17 24 63 41 73 24 58 92 67 74 57 93 18 82 78 30 21 34 68 75 93 57 11 23 91 20 61 59 92 31 79 23 92 10 25 59 32 22 2 42 2 7 22 88

71 7 88 44 28 77 22 74 19 49 64 64 49 73 15 3 50 59 96 16 84 16 83 88 69 3 46 48 86 93 2 37 77 51 33 63 61 50 11 94 99 96 23 14 72 25 39

67 87 61 46 75 3 37 6 55 47 34 54 57 25 18 10 80 25 5 65 85 50 59 84 70 80 28 36 24 13 100 83 11 73 4 14 75 14 72 90 54 16 50 22 88 50 57

93 67 71 100 84 11 31 54 32 38 58 37 66 58 40 84 68 9 76 24 42 17 92 64 52 49 58 56 81 91 33 58 53 41 62 15 62 88 82 63 46 42 40 82 46 83 66

33 72 27 82 49 36 63 21 48 13 47 29 8 20 71 71 6 44 25 70 61 99 30 77 22 88 20 28 45 55 73 44 43 26 43 67 30 33 55 87 29 69 91 92 73 19 94

37 44 53 74 90 32 11 38 77 19 30 16 24 76 47 14 16 84 21 17 9 19 69 87 73 4 37 78 93 5 54 81 43 76 94 87 71 76 84 65 56 97 84 9 33 41 67

61 83 55 73 97 31 40 47 6 73 32 42 67 63 15 24 11 64 63 3 23 92 28 38 27 39 63 49 69 82 18 51 36 97 66 79 37 70 29 56 56 26 25 76 29 82 91

67 30 59 26 12 92 87 62 80 93 43 32 7 63 18 94 84 99 85 22 37 88 63 88 67 15 33 16 6 50 3 39 37 51 60 56 57 91 57 85 56 50 59 58 43 2 32

11 93 36 66 61 30 10 23 63 13 59 29 84 77 46 59 28 80 79 59 48 4 84 82 74 5 60 17 55 68 40 13 56 42 24 50 38 60 5 51 43 30 21 32 46 73 65

88 97 73 95 50 61 30 62 34 72 89 99 28 16 36 63 95 70 37 5 20 57 25 92 73 10 25 13 98 83 51 30 47 54 100 52 79 83 82 54 30 9 50 44 41 84 21

12 12 89 46 100 73 39 19 38 10 24 56 77 95 8 65 38 84 69 36 20 79 27 100 32 51 59 92 4 6 87 54 79 3 23 6 52 26 48 75 82 44 94 50 83 3 89

51 78 67 21 58 2 51 5 75 45 56 63 28 82 63 31 72 97 82 3 40 9 3 100 35 64 91 8 99 32 91 49 51 84 72 49 81 92 26 88 39 38 4 57 59 11 53

21 55 83 56 92 83 55 96 73 43 64 14 76 15 8 93 50 90 95 39 75 84 4 32 100 23 15 77 58 7 87 1 14 69 92 61 29 63 40 27 9 9 32 98 75 36 90

40 59 11 70 23 87 56 74 6 46 47 69 28 99 94 43 73 68 84 21 21 98 14 53 81 53 27 97 86 68 54 38 52 37 55 10 4 30 82 39 80 30 48 30 77 51 71

85 36 93 66 92 5 59 85 43 6 66 65 26 17 90 24 31 76 32 38 74 76 68 76 67 58 82 86 16 30 49 22 67 50 21 51 14 55 62 34 9 36 92 79 22 89 26

2 68 84 65 15 71 32 29 23 58 95 21 93 88 56 68 92 20 34 45 64 84 87 100 46 86 47 53 68 79 100 56 74 6 65 32 56 77 18 92 77 6 13 44 19 8 27

68 21 75 75 64 57 34 6 3 18 22 72 81 37 4 57 79 8 98 31 99 89 89 39 93 24 50 95 5 3 34 2 77 73 45 27 65 79 84 15 47 38 86 2 16 90 50

46 98 56 10 41 87 56 73 74 96 31 10 15 90 3 97 87 48 27 34 18 100 5 47 8 87 73 13 12 77 93 22 95 11 30 8 78 48 10 100 84 31 93 18 51 100 100

3 28 15 97 25 40 17 40 60 91 61 27 33 1 84 67 18 25 52 17 98 96 42 28 83 48 76 61 97 14 31 71 88 82 73 26 7 25 61 19 5 51 91 39 66 27 5

49 28 80 100 55 30 12 42 9 86 93 58 49 77 8 13 8 58 51 4 18 9 37 59 32 65 6 27 43 12 39 10 25 8 36 2 74 70 51 90 91 87 28 47 27 59 12

96 43 83 60 7 39 94 65 26 93 26 29 62 59 56 41 70 33 8 83 51 25 65 9 57 79 98 56 44 10 85 74 10 78 83 45 71 87 76 16 13 63 46 58 68 4 62

43 75 32 1 30 55 57 73 83 2 3 28 75 61 20 20 43 53 16 1 87 81 87 22 16 38 65 89 78 13 87 95 67 66 50 59 47 64 97 86 8 27 23 8 38 52 10

11 4 59 75 97 69 4 82 61 92 90 29 11 19 71 2 90 81 10 32 54 72 1 49 66 7 73 47 14 52 10 90 68 11 34 68 29 97 25 78 50 42 64 79 7 95 77

80 75 12 28 13 11 55 35 82 56 75 33 89 31 84 71 84 39 58 60 3 21 94 99 37 8 50 24 10 10 7 12 46 9 58 2 96 81 69 8 13 87 16 50 51 79 90

60 99 4 71 88 42 91 14 66 91 65 60 62 56 84 60 68 6 82 4 58 69 64 95 69 87 100 10 41 76 40 57 42 23 61 39 51 6 89 4 62 34 37 15 27 31 48

98 24 72 32 93 51 52 54 43 73 80 20 22 25 65 9 76 99 100 72 56 79 86 22 88 51 33 8 85 34 73 57 32 40 7 38 85 37 35 51 91 42 35 27 59 75 41

27 10 22 60 51 34 15 11 90 69 18 82 57 22 78 16 14 49 91 55 21 23 86 32 3 54 9 54 63 28 26 35 76 63 51 25 77 35 56 20 8 99 31 71 88 46 19

76 49 93 39 51 36 62 40 67 83 42 56 67 19 72 94 79 77 83 97 100 10 25 5 86 35 90 21 5 82 6 80 41 60 55 64 22 11 39 88 63 84 4 66 8 39 5

20 30 40 88 17 50 12 58 21 17 64 87 77 1 3 72 7 14 14 83 94 34 92 74 44 92 16 94 14 89 95 19 47 39 90 36 5 65 15 51 47 81 32 93 78 87 95

63 29 35 93 89 48 7 23 39 19 31 70 13 2 68 12 33 10 45 7 12 14 19 4 78 35 28 85 72 37 19 43 40 27 20 1 57 31 59 91 72 23 63 74 17 34 71

11 55 2 51 70 7 66 97 41 16 92 7 42 64 36 82 35 50 6 32 94 47 34 19 43 1 65 70 9 68 27 13 73 18 49 18 15 14 88 14 79 29 94 40 63 73 17

25 52 48 30 17 47 16 97 15 14 46 55 12 20 71 98 83 40 38 79 18 57 29 98 80 34 1 99 83 6

71 86 63 89 93 97 62 69 56 81 63 10 83 7 86 2 92 25 82 92 32 27 50 12 27 62 38 45 19 99

26 28 97 48 73 46 83 39 96 69 52 2 27 86 70 36 44 88 66 17 68 70 79 30 71 95 82 100 63 55

11 100 17 13 53 92 26 89 48 35 11 22 91 34 58 54 61 51 35 18 90 26 67 63 32 25 80 96 68 7

31 2 61 79 95 22 37 5 1 5 60 35 53 2 29 95 62 22 48 56 19 14 74 87 38 66 95 58 88 42

70 10 39 80 53 63 36 79 24 9 47 39 26 63 73 100 3 59 59 13 28 67 10 90 95 66 64 5 10 29

14 75 85 1 51 28 79 8 33 64 59 48 36 86 6 81 12 50 87 51 49 63 13 22 69 59 35 46 83 55

88 78 83 15 21 60 93 35 27 2 76 4 10 81 5 98 77 50 55 45 60 24 15 41 58 30 84 37 19 37

34 3 56 35 88 26 56 38 52 45 77 93 46 17 10 51 12 36 93 14 12 34 92 37 74 19 26 11 26 95

18 53 6 64 72 16 88 1 31 55 38 62 69 100 19 59 43 21 55 11 38 6 60 82 83 97 12 72 19 11 80 5 30 47 61 35 80 91 88 2 90 27 10 70 14

39 25 28 31 65 49 50 69 7 60 89 45 51 60 89 47 100 27 42 5 24 5 21 66 52 54 49 40 80 46 87 13 18 28 64 80 60 36 24 16 15 89 90 18 33

54 57 99 5 32 75 19 26 55 27 95 7 15 65 39 24 9 54 23 36 33 58 8 58 40 39 70 83 23 62 45 91 86 83 84 70 12 4 57 61 46 65 97 61 53

4 97 26 86 98 78 1 74 24 51 20 62 70 68 34 86 70 43 11 4 63 66 47 1 39 61 96 90 27 32 58 100 8 98 67 59 26 86 41 94 73 24 7 100 55

38 4 20 63 24 68 48 46 8 28 32 90 3 52 35 79 96 28 49 16 95 53 40 85 39 5 84 15 78 62 74 31 7 45 29 52 89 49 26 6 36 51 57 9 64 60 70

54 45 71 29 96 60 24 32 2 49 14 40 23 26 16 47 82 74 65 82 78 37 73 41 10 24 17 88 89 70 81 4 56 37 27 50 19 16 50 76 63 15 84 61 51 85 97

44 69 58 24 11 60 53 19 67 39 27 81 17 91 98 67 17 1 52 99 91 33 19 63 16 37 80 39 69 41 81 66 47 15 44 92 47 14 63 15 38 38 62 72 68 94 30

71 90 32 7 4 52 36 80 19 31 14 97 76 48 26 41 97 62 50 56 97 94 70 49 39 67 4 93 6 3 44 40 7 44 15 43 48 94 41 56 7 59 14 77 71 24 77

40 78 56 46 31 83 34 95 65 66 44 30 27 8 15 16 5 3 100 52 65 2 44 59 22 93 76 38 5 84 50 31 2 53 42 93 93 37 20 35 11 19 36 55 66 69 23

12 89 62 19 3 55 74 80 62 64 26 28 96 4 28 71 84 93 71 1 42 41 79 7 60 67 44 83 92 77 92 100 55 19 63 86 50 72 7 13 36 25 13 18 65 53 79

10 6 87 80 37 41 72 4 50 68 47 94 84 41 32 88 15 96 26 45 17 9 55 1 37 3 28 41 23 76 62 16 93 95 99 70 46 38 84 20 50 64 71 18 88 10 75

37 20 85 14 63 20 58 56 41 9 31 59 6 50 30 3 2 47 58 7 70 13 61 72 62 84 70 91 45 56 81 40 38 95 96 67 53 66 34 28 33 74 60 88 32 33 37

66 15 36 52 61 79 99 22 36 100 67 35 50 73 9 38 40 72 61 60 36 17 48 39 16 7 19 25 72 29 70 96 89 30 28 81 1 15 63 11 39 45 88 15 35 3 44

16 15 100 42 71 98 20 7 58 15 9 27 5 66 91 39 74 18 6 22 70 67 98 98 71 90 51 88 71 6 67 34 69 97 39 53 30 15 47 76 81 49 85 90 85 43 48

68 46 78 8 5 85 35 7 66 54 3 68 45 32 72 11 98 12 68 74 19 34 10 65 27 6 78 73 82 30 32 99 42 83 57 1 27 72 53 81 4 50 35 15 43 57 71

85 97 96 90 68 23 92 99 35 54 38 2 20 39 19 46 73 41 43 33 46 71 82 19 37 23 92 49 28 35 69 53 2 68 91 75 76 32 29 39 61 65 40 32 24 17 75

98 16 82 32 63 7 38 30 13 84 65 74 76 87 88 42 21 64 43 75 24 66 22 3 88 72 6 86 39 86 41 70 65 16 94 78 39 52 100 81 86 16 50 99 6 95 1

3 28 85 82 68 34 41 5 30 43 83 16 76 74 8 65 24 21 87 92 6 30 52 26 5 78 91 71 98 9 83 22 63 6 56 31 90 19 9 34 48 2 10 13 20 48 90

100 9 97 69 73 32 87 84 75 31 1 95 89 46 32 93 85 88 6 65 14 97 51 66 38 79 29 1 56 97 90 74 98 19 53 90 19 42 38 27 37 96 95 81 69 44 40

16 72 87 51 42 16 41 59 20 27 33 60 48 91 71 9 16 100 7 48 83 91 8 68 94 69 41 55 94 62 16 9 15 28 17 51 14 12 72 21 83 28 74 49 68 54 22

26 73 27 94 93 91 75 75 25 80 10 9 67 8 92 36 62 14 88 71 52 94 27 46 11 86 90 18 36 65

41 5 95 85 34 1 94 6 19 64 81 84 80 33 65 17 23 35 7 53 46 30 19 25 81 51 96 32 84 59

73 25 58 44 27 48 87 94 13 47 3 74 84 79 39 77 90 52 82 31 48 31 19 88 99 6 8 63 78 47

23 37 16 59 24 62 58 63 79 74 22 63 42 31 20 22 83 34 96 89 54 1 43 44 50 44 6 71 48 95

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Usually in Excel, you select a range and then do something to it (such as enter a formula in it, format it, delete its contents, and so on). Therefore, it is extremely important to be able to select a range efficiently. This is easy if the whole range appears on the screen, but its a bit trickier if you cant see the whole range. In the latter case the effect of dragging (the method most users try) can be frustratingthings scroll by too quickly. Try one of the methods below instead. To select a range that fits on a screen: Click on the upper left corner of the range and drag to the bottom right corner. Or: Click on the upper left corner, hold down the Shift key, and click on the bottom right corner. Try it! Select the range L3:N8.

To select a range that doesnt fit on a screen: Click on the upper left corner of the range. Then, holding the Shift key down, use the End-arrow combinations (End-right arrow, then End-down arrow) to get to the bottom right corner. Or: Split the screen so that the upper left corner shows in the upper left pane and the bottom right corner shows in the bottom right pane. Click on the upper left corner, hold the Shift key down, and click on the bottom right corner.

Try it! Select the range L20:AF98. Try both of the methods suggested here.

e, such as My Excel Tutorial.xlsx, and work with the copy. 9 1 8 7 5 5 2 3 1 5 1 10 10 8 10 4 1 7

formula in it, format e to select a range ickier if you cant see rs try) can be

right corner.

-arrow

he bottom right Shift key down, and

63 52 18 25 26 42 14 87 100 59 43 19 86 7 52 18 1 71 75 2 64 64 6 87 64 58 76 15

61 95 98 21 76 52 29 41 71 51 72 73 58 62 78 32 89 71 18 5 89 67 30 78 64 33 54 79

4 40 47 7 55 72 75 48 10 90 53 49 55 41 37 62 92 58 70 21 38 81 42 33 15 81 84 47

36 75 28 68 60 79 36 22 11 35 21 38 59 62 18 79 86 14 77 95 32 11 3 53 28 90 66 71

45 28 65 16 55 16 52 25 90 94 60 33 41 26 45 86 88 37 52 16 8 34 68 48 44 48 65 19

85 67 17 12 19 14 75 77 15 83 22 42 63 17 98 31 94 27 6 8 51 16 27 86 65 26 78 74

91 79 86 80 82 85 17 3 62 77 33 49 75 95 35 58 12 73 45 66 63 30 12 17 29 55 3 58

73 43 83 41 55 23 54 81 16 31 47 69 82 66 19 58 8 4 22 5 33 57 67 4 52 46 79 28 95 40 96 3 96 39 46 23 6 72 8 48 70 57 98 45 69 50 17

85 40 54 85 72 22 74 54 86 38 67 4 28 69 85 30 98 22 89 81 95 32 55 10 69 25 71 51 41 76 61 7 37 33 15 24 64 36 34 91 29 78 92 23 70 56 20

20 26 38 63 42 17 23 24 24 91 39 10 25 81 32 88 6 18 29 48 12 94 5 12 35 70 61 23 44 54 55 17 82 1 81 3 5 24 69 81 30 44 39 30 86 42 19

100 30 91 28 24 76 86 61 58 46 26 56 20 19 47 16 1 11 84 65 21 59 66 86 8 45 38 75 60 4 1 28 70 82 86 40 95 58 26 13 5 99 60 91 55 18 68

6 59 59 29 59 50 88 41 99 44 54 89 88 78 1 44 74 61 88 9 18 15 36 91 38 99 37 42 83 46 59 87 8 35 74 30 11 23 14 94 18 59 45 89 70 47 2

46 98 27 59 41 67 85 43 49 15 85 66 92 100 69 90 2 5 18 67 73 22 26 11 63 56 66 89 57 23 67 5 56 51 69 27 15 89 77 87 75 65 75 36 5 2 10

17 46 82 47 78 17 98 13 50 23 65 13 28 57 68 9 53 100 67 13 31 18 34 73 20 34 24 79 61 28 37 98 25 71 22 73 90 45 15 18 97 31 30 9 78 85 2

55 64 87 96

56 68 77 72

25 99 77 80

28 77 13 61

1 20 85 73

71 38 62 72

64 29 4 86

23 75 23 87 61 49 33 57 24 26 67 84 19 97 40 3 49 31 8 82 86 16 86 4 10 49 88 63

17 49 63 59 42 81 66 32 83 79 29 8 34 79 73 14 38 83 57 72 1 39 77 61 57 34 17 57

76 76 73 29 44 7 50 3 66 61 71 49 37 98 72 26 52 28 78 87 91 65 24 4 92 23 97 4

49 61 21 27 69 25 33 57 47 84 56 97 84 6 63 15 54 3 24 85 68 51 87 59 91 15 53 83

49 77 16 56 9 30 13 3 88 100 28 11 29 20 10 87 16 11 41 64 20 49 38 86 96 74 7 8

44 11 58 14 80 92 51 79 15 79 72 80 81 53 72 60 18 85 43 24 2 14 25 33 93 17 40 31

70 51 34 91 23 61 65 32 53 8 4 93 94 54 6 88 26 63 29 24 43 73 46 25 29 57 45 50

31 34 98 25 78 71 39 66 21 5 48 63 78 18 36 86 17 41 67 49 85 98 61 95 54 89 83 96

67 31 16 91 100 26 29 4 64 42 24 95 9 4 30 45 24 71 82 30 42 20 68 28 7 12 35 96

24 85 98 76 1 6 79 44 93 12 52 99 97 27 16 91 35 43 12 78 17 77 82 14 68 4 97 42 59 66 96 31 41 55 85 16 36 83 8 48 27 91 34 64 71 49 12

86 23 39 81 53 97 83 91 65 32 4 22 42 52 19 68 85 49 26 55 85 4 59 28 16 98 91 22 39 29 52 62 16 66 64 85 44 68 21 63 62 38 53 11 51 53 79

49 75 91 24 7 74 51 18 88 70 57 10 65 80 28 87 80 34 34 36 97 84 8 67 64 77 44 58 9 76 95 72 72 43 69 2 97 65 71 29 76 13 95 54 70 17 67

11 83 77 49 65 84 6 59 8 22 1 18 45 9 71 24 71 10 18 53 86 63 48 95 58 70 29 99 7 37 10 52 94 20 17 20 99 48 64 16 3 35 70 8 48 51 93

52 37 31 12 34 32 88 20 30 27 79 90 72 78 63 38 49 76 86 17 25 99 60 47 75 92 57 92 62 22 74 32 49 5 99 44 41 77 93 6 18 9 8 68 77 67 73

3 53 75 36 60 10 15 62 73 1 98 45 47 17 73 39 91 40 17 97 77 36 41 63 86 42 83 40 71 59 12 71 11 77 90 68 50 13 34 60 66 85 93 10 78 58 40

58 99 6 47 47 84 60 17 2 50 30 74 25 35 18 66 9 93 49 64 59 53 33 73 75 91 93 22 50 66 13 18 94 86 76 34 82 71 51 50 54 46 88 100 55 70 50

61 90 72 54 82 74 13 80 52 3 14 53 73 52 49 100 29 79 63 53 36 34 53 89 87 29 81 35 62 40 94 55 84 5 84 47 67 63 48 91 58 78 42 42 91 51 46

34 65 36 76 72 22 17 12 71 15 12 80 82 54 41 74 46 81 39 44 86 59 1 94 12 47 40 2 16 58 72 72 79 19 14 77 13 5 55 58 74 100 64 10 47 87 24

8 96 66 49

7 6 11 79

23 92 95 89

15 60 99 52

42 90 57 100

28 85 13 9

56 83 74 74

33 53 28 100

99 39 33 64

78 56 16 6 6 85 26 18 70 12 95 86 7 82 88 36 26 15 62 78 58 67 17 55 56 64 76 33

20 61 3 63 96 93 41 40 1 28 93 51 89 59 50 76 34 42 63 73 20 33 26 17 2 28 57 80

98 83 76 35 47 71 17 62 78 95 61 19 73 48 5 98 94 87 14 44 43 84 43 6 38 100 8 20

47 33 5 98 41 55 65 45 81 25 92 2 42 62 57 59 59 85 59 70 73 7 20 92 88 76 24 14

88 24 25 67 50 67 93 4 16 63 70 50 37 76 27 65 13 55 91 99 71 71 49 45 87 42 76 56

51 91 39 39 33 10 92 17 29 13 63 71 45 93 19 73 57 33 11 53 43 36 99 98 86 1 15 22 12 66 74 48 37 71 2 75 72 32 4 50 33 79 8 42 41 24 40

43 21 51 22 20 26 71 78 21 41 11 3 29 74 11 12 47 7 36 28 73 36 83 4 60 6 68 16 49 14 86 65 61 53 41 8 40 53 36 74 95 62 96 28 83 24 58

90 95 25 5 74 39 45 96 41 71 54 35 39 77 42 87 10 97 23 85 23 61 15 33 9 61 41 75 28 77 71 84 48 94 63 15 99 14 28 27 84 86 51 52 94 86 83

73 48 72 30 52 64 45 55 59 13 41 74 100 66 49 42 98 43 63 29 68 84 65 90 93 53 45 16 73 3 33 87 32 65 23 98 95 40 63 69 63 36 12 74 91 36 53

25 61 97 98 1 41 25 79 69 78 43 24 75 50 3 30 82 44 37 8 25 37 56 51 6 31 67 8 5 54 36 26 35 73 37 5 25 69 100 5 60 45 13 95 46 54 94

10 66 70 46

30 37 22 37

73 79 90 32

51 6 29 98

16 95 78 10

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Suppose 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 L3:M5 and O3:P7, click on L3, hold down the Shift key and click on M5 (so now the first range is selected), hold down the Ctrl key and click on O3, and finally hold down the Shift key and click on P7. Try it! Select all three numerical ranges to the right. Note that in Excel 2007, the highlighting is sometimes hard to see. The shading isnt as dark as in previous versions of Excel, so you might be fooled into thinking you havent really highlighted multiple ranges. But the above method definitely works, exactly as it always has.

e, such as My Excel Tutorial.xlsx, and work with the copy. 10 1 5 13 9 4 7 12 1 6 15 9 7 1 12 2

, for example). The

key, select the third 13 4 10

Shift key and click on and finally hold

isnt as dark as in lly highlighted

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Copying and pasting (often formulas) is one of the most frequently done tasks in Excel, and it can be a real time-waster if done inefficiently. For example, many people scroll through a long range to highlight it, then click on the Copy button or a Copy menu item, then scroll again to select a paste range, and finally click on the Paste button or a Paste menu item. If this sounds familiar, you can definitely benefit from the tips here. Actually, there are several possibilities for efficient copying and pasting, as explained below.

To copy and paste using keyboard shortcuts: Select the copy range (using one of the efficient selection methods described above), press Ctrl (for copy), select the paste range (again, efficiently), and press Ctrl-v (for paste). If you practice pressing Ctrl-c or Ctrl-v with the little finger and index finger of your left hand, it will become automatic in a short time. Yes, you can click on the Copy and Paste buttons on the Home ribbon, but the keyboard shortcuts are faster. Besides, they work on virtually all Windows programs, not just Excel. Note that the copy range will still have a dotted line around it, which means that it is still stored on the clipboard. Press the Esc key to get rid of this dotted line.

A frequent task is to enter a formula in one cell and copy it down a column or across a row. 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 efficient 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 the range N25:N31 with Ctrl-Enter. Each cell should be the product of the two values to its

Pressing Ctrl-Enter enters what you typed in all of the selected cells (adjusted for relative addresses), so in general, it can be a real time-saver. For example, it can be used to enter the number 10 in a whole range of cells. Just select the range, type 10, and press Ctrl-Enter.
Try it! Fill up the range L37:N41 with the value 10 by using Ctrl-Enter.

If you place the cursor at the bottom right of a cell, the cursor turns into a plus sign. This is called the autofill handle. If you want to copy a formula down, you can use the autofill handle in two different ways. Here is the first. To copy with the autofill handle by dragging:

To copy with the autofill handle by dragging: Enter the formula in the top or left-hand cell of the intended range. Place the cursor on the autofill handle at the lower right of this cell (the cursor becomes a plus sign), and drag this handle down or across to copy.

The second way to copy down is to double-click on the autofill handle. Note that this method uses Excels built-in intelligence, but it works only in certain situations. Lets 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. Because this is a common thing to do, Excel does it for you if you double-click on the autofill handle. It senses the filled-up range in column B and guesses that 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 autofill handle wouldnt work. Try it! Copy the formula in N56 down through N62 by double-clicking on the autofill handle.

e, such as My Excel Tutorial.xlsx, and work with the copy.

n Excel, and it can be h a long range to n to select a paste familiar, you can efficient copying and

bove), press Ctrl-c ). If you practice t will become

keyboard shortcuts

3 4 2 2 5 4 3

3 1 3 1 1 2 5

at it is still stored on

cross a row. There

. (Use the efficient in the formula, and

6 9 4 7 2 8 3

2 1 9 6 3 5 9

the two values to its

or relative addresses), he number 10 in a

sign. This is called the ndle in two different

10 6 4 5

7 9 9 1

70

ursor on the autofill this handle down or

2 8 10

8 10 7

ain situations. Lets l C3 and copy it down click on the want another filledclicking on

7 2 10 4 4 3 7

8 1 2 1 5 8 8

56

tofill handle.

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

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. If you like, you can also select another range for the paste range. To copy formulas and paste as values: Select the range with formulas, press Ctrl-c to copy, and select the range where you want to paste the values (which can be the same as the copy range). Then, because there is no keyboard equivalent, select the Paste dropdown on the Home ribbon, and select the Paste Values option. Try it! Copy the range N3:N9 to itself, but paste as values.

The Paste dropdown on the Home ribbon (see to the right) has a number of other "special" ways paste. These include: 1. Paste formulas (not formats). 2. Paste formats. 3. Paste arithmetic operations. The following text boxes let you explore these options. We encourage you to explore the other

Column N to the right contains formulas. Paste these formulas to column P, but don't paste the formats.

Sometimes you want to copy only the formatting of a range. To copy the formatting of a range, highlight the range, press Ctrl-c, highlight the paste range, and select Formats from Paste Special on the Paste dropdown. (When you click on Paste Special, you get the dialog box to the right.)

Try it! Copy the formats in column P to column R. (Don't copy the values, just the formulas.) Then enter some values in column R to check that the formatting is correct.
Note: An easy alternative to this method is to use the Format Painter button next to the Paste dropdown (see to the right). I use this button all the time to copy formats. Just select a cell with the format you want to copy, click on the paint brush, and click on a cell (or drag a range) that you want to format. Note that if you double-click on the paint brush, you can copy the format multiple times. Click on Esc when you are finished.

Sometimes you would like to multipy each number in a range by a constant. For example, if you have revenues expressed in thousands of dollars, you might want to multiply each by 1000 so that they are then expressed in dollars.

have revenues expressed in thousands of dollars, you might want to multiply each by 1000 so that they are then expressed in dollars. To multiply a range by a constant: Enter the constant in a blank cell, and copy this cell. Then highlight the range of values to multiply and select Multiply from Paste Special on the Paste dropdown. (This same method can also be used to add, subtract, or divide.) Try it! Multiply each value in the range to the right by 1000. Then restore them to their original

e, such as My Excel Tutorial.xlsx, and work with the copy. 1 2 9 7 8 8 7 1 3 5 4 8 10 6 1 6 45 28 64 80 42

eplace the formulas nge, that is, you ge for the paste

e you want to paste o keyboard te Values option.

her "special" ways to

xplore the other

t don't paste the

10 6 1

2 7 8

20 42 8 $47.65 $44.20 $37.68 $31.34 $89.36 $68.15 $28.57

e paste range, and Paste Special, you get

he formulas.) Then

ext to the Paste select a cell with the range) that you want rmat multiple times.

r example, if you ach by 1000 so that

147 173

ach by 1000 so that 217 178 120 203 137 217 153

values to multiply hod can also be used

to their original

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Often you would like to move data from one range 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. (The little finger-index finger combination on your left hand is also good for pressing Ctrl-x.) As with copying and pasting, ribbon buttons can be used instead of key combinations, but the key combinations are more efficient. Also, note that you need only select the upper left cell of the paste range. Excel knows that the shape of the paste range must be the same as the shape of the cut range. Try it! Move the range L3:N9 so that it begins in cell L6. (Watch how relative addresses affect the eventual formulas in column N.)

e, such as My Excel Tutorial.xlsx, and work with the copy. 2 7 3 3 6 6 1 3 4 6 9 7 6 4 6 28 18 27 42 36 4

of the paste range, also good for

ations, but the key left cell of the paste hape of the cut

dresses affect the

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Often you want to insert or delete rows or columns. Note that deleting a row or column is not same as clearing the contents of a row or columnmaking all of its cells blank. Deleting a row or column means wiping it out completely. To insert one or more blank rows: Click on a row number and drag down as many rows as you want to insert. Then click on the Insert dropdown and select Insert Sheet Rows. (Interestingly, the Insert dropdown is in the Cells group of the Home ribbon, not on the Insert ribbon.) If you prefer a keyboard shortcut (as I do), press Alt-i and then r (i for insert, r for row). You can also right-click on the row labels and select Insert. The rows you insert are inserted above the first row you selected. For example, if you select rows 8 through 11 and then insert, four blank rows will be inserted between the old rows 7 and 8. Try it! Insert blank rows for the data below for Feb, Apr, and May.

Month Jan Mar Jun

Price Units sold $3.00 100 $3.25 50 $3.50 200

Revenue $300.00 $162.50 $700.00

To delete one or more blank rows: Click on a row number and drag down as many rows as you want to delete. Then click on the Delete dropdown and select DeleteSheet Rows. (Again, this is in the Cells group on the Home ribbon.) If you prefer a keyboard shortcut, press Alt-e and then d (e for edit, d for delete). Try it! Delete the rows you inserted in the above exercise.

You can insert or delete columns in exactly the same way. To insert columns, use the keyboard shortcut Alt-iand then c. To delete columns, use the keyboard shortcut Alt-e and then d, the same as for rows.

You can also hide rows or columns. I will explain hiding and unhiding rows. The same directions work for columns. To hide a group of adjacent rows, click on the top row number you want to hide, hold down the Shift key, and click on the bottom row number you want to hide. This selects the rows you want to hide. (Alternatively, you can drag the row numbers.) Then click on the Hide and Unhide arrow from

Shift key, and click on the bottom row number you want to hide. This selects the rows you want to hide. (Alternatively, you can drag the row numbers.) Then click on the Hide and Unhide arrow from the Format dropdown on the Home ribbon (see to the right). From there, click on Hide Rows. To unhide rows, highlight the adjacent nonhidden rows. For example, if you hid rows 51-60, you would highlight rows 50 and 61. Then go through the same buttons as for hiding rows, but this time click on Unhide Rows. Try it! Hide rows 60 to 75 below. Then unhide them. Person 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Age 36 33 49 25 21 46 27 35 22 27 37 36 21 35 39 48 35 38 36 44 34 50 44 41 43 48 29 34 22 28

e, such as My Excel Tutorial.xlsx, and work with the copy.

r column is not the Deleting a row or

n click on the Insert n the Cells group of

or row). You can also

if you select rows 8 ws 7 and 8.

n click on the Delete Home ribbon.)

same directions

e, hold down the e rows you want to Unhide arrow from

e rows you want to Unhide arrow from on Hide Rows.

60, you g rows, but this time

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Worksheets are where you place your data and formulas in Excel. Many people call them "sheets" but this isn't exactly accurate. Strictly speaking, a worksheet is a sheet that has rows and columns rectangular grid of cells. There is another kind of sheet, called a chart sheet. This type of sheet has no rows or columns, only a chart. The discussion here is about worksheets, not chart sheets. The actions discussed below are things you will do every day, so make sure you know how to do them.

The name of a worksheet appears in its tab at the bottom of the screen. To rename a worksheet:

Double-click on its tab and enter a new name.


Try it! Rename this worksheet as Worksheet Tasks. Then rename it again, to Worksheets. You often need to add new worksheets. Excel 2007 makes this easier than ever before. To add a new worksheet: Click on the rightmost tab at the bottom of the screen, the tab to the right of your rightmost worksheet tab (see to the right). This creates a new worksheet with a generic name such as Sheet3, which you can then rename.

Try it! Create a new worksheet and rename it Practice1.


You can select one or more worksheets. The "active" worksheet is the one you are viewing. Its tab is boldfaced. But others can be selected as well. If you do anything to the active worksheet, such as format a cell or enter a value, the same thing is done to all of the selected worksheets. This can save a lot of time with common data or formatting. To select multiple adjacent worksheets: Click on the tab of the leftmost of these, hold down the Shift key, and click on the tab of the rightmost of these. To select multiple nonadjacent worksheets: Click on the tab of any of them, and then while holding down the Ctrl key, click on the other tabs. When multiple worksheets are selected, one will be active (tab boldfaced), but the tabs of the others will be white, indicating that they are selected. They will remain selected until you click on the tab of some other worksheet. (There is one exception to this. If all of the worksheets are selected, you can click on any worksheet tab to activate it and deselect all of the others.) Try it! You should already have a Practice1 worksheet. Create several more new worksheets to its right and rename them Practice2, Practice3, and so on. Then select them all and enter the label "This is practice" in cell A1 of the active worksheet, Practice1. By visiting the other Practice

right and rename them Practice2, Practice3, and so on. Then select them all and enter the label "This is practice" in cell A1 of the active worksheet, Practice1. By visiting the other Practice worksheets, you should see that they all have this label in cell A1. Finally, activate the Worksheet you are reading now (Worksheets). This deselects the Practice worksheets.

You can delete one or more worksheets. However, if you try to delete all of the worksheets, Excel will warn you that at least one has to remain. To delete one or more worksheets: Select the ones you want to delete, as explained in the previous text box. Then right-click on any of the selected tabs. This brings up a context-sensitive menu, which has a few options you might want to try. For now, click on Delete. Note that if the worksheets have any contents, you will be asked if you really want to delete them. Deleting worksheets can be dangerous because it cannot be undone. So be careful!

You can also move or copy a worksheet. You can do this in one of two ways: by dragging tabs or through a Move or Copy menu item. The first way is easier; the second gives you more options. To move or copy a worksheet by dragging its tab: Drag its tab right or left to the position you want. If you hold down the Ctrl key while you are dragging, you will make a copy of the worksheet.

Try it! Move this worksheet to the right of the Fill Series worksheet, and then move it back again. Next, make a copy of this worksheet, just to the right of its current position. The copy will have the name Worksheets (1), which you can then rename if you want. For now, delete the copy.
To move or copy a worksheet with the Move or Copy menu item: Right-click on the worksheet's tab and select Move or Copy. This brings up a dialog that lets you select the workbook you want to move or copy to (including a new workbook), the position within that workbook, and whether you want to create a copy. (See the screenshots to the right.) If you select a different workbook and you don't check the latter option, the worksheet will no longer exist in the current file; it will move to the other workbook. So be careful.

Try it! Create a new worksheet called Practice and enter some data in it. Then move it to a new workbook. It will disappear from this workbook and appear in a new one. You can then close the new workbook and delete the file.

Finally, you can hide or unhide a worksheet. For example, you might want to hide, but not delete, a worksheet that contains technical data used in formulas in other worksheets. Of course, you might be the recipient of such a file, with formulas you can't figure out because they refer to data on a hidden worksheet. If you sense that something mysterious is going on, check whether there are any hidden worksheets!

hidden worksheets! To hide or unhide a worksheet: Click on the Format dropdown on the Home ribbon (not exactly where you would expect to find this!). Then click on the Hide and Unhide arrow (see to the right). This gives you the option to hide or unhide a worksheet. A telltale sign that there is at least one hidden worksheet is that the Unhide option is enabled (not grayed out). Try it! Hide this worksheet. Then unhide it.

e, such as My Excel Tutorial.xlsx, and work with the copy.

call them "sheets" rows and columns--a s type of sheet has chart sheets. The w how to do them.

orksheets.

our rightmost ame such as Sheet3,

are viewing. Its tab is orksheet, such as sheets. This can save

he tab of the

on the other tabs.

the tabs of the d until you click on orksheets are

w worksheets to its d enter the label her Practice

d enter the label her Practice te the Worksheet

worksheets, Excel

click on any of ons you might want

ant to delete them.

dragging tabs or u more options.

while you are

move it back again. e copy will have the

log that lets you the position within o the right.) If you et will no longer exist

it to a new an then close the

de, but not delete, a f course, you might efer to data on a hether there are any

uld expect to find the option to hide et is that the Unhide

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Sorting, which usually means putting in alphabetical order or increasing or decreasing numerical order, is such a common and simple operation that I almost forgot to include it in this tutorial. However, there are some obvious and nonobvious things you should know. The usual situation is that you have a multi-column data set such as the one to the right. If you want to do a simple sort on any of its columns, highlight any single data cell in this column and click on the A-Z or the Z-A button. You can find these buttons under the Sort & Filter dropdown on the Home ribbon, and they are also on the Data ribbon. But because you use them so often, you will probably want to put them on the QAT so that they are always accessible. Try it! Sort on any of the columns to the right, either in A-Z or Z-A order. Note that when you sort on any column such as Salary, the other columns change accordingly. That is, each row remains intact. Of course, this is the behavior you would expect and want. You can undo a sort, but just in case, it is often nice to have an "ID" column with consecutive integers, 1,2,3, etc. This is the role of the Person column to the right. No matter how many sorts you do, you can return to the original sort order by sorting (A-Z) on Person.

Note that I said to select a single cell before you click on A-Z or Z-A. If you highlight a range, such as the entire State column, and then click on A-Z or Z-A, you will be asked if you want to expand the selection (meaning to the full data set) or continue with the current selection. You probably want the former option, not the latter one. If you continue with the current selection, only the Salary values will be sorted, and the sorted salaries will not correspond to the right persons.

Excel gives you many more sort possibilities with its Custom Sort item under the Sort & Filter dropdown. This brings up a dialog box where, among other things, you can add levels (see to the right). The example to the right illustrates why you might want to do this. Suppose you want to sort so that all of the males are at the top. Then within each gender, you would like to sort in A-Z order on State. Then if there are multiple people of a given gender in the same state, you would like to sort them in decreasing order of Salary. This is possible only with a custom sort with three levels: first Gender, then State, then Salary. Try it! Sort the data to the right as explained above. Check that it works as intended. Try it again! This time have the three levels be Salary, then State, then Gender. Do you see the difference? There are no ties on Salary, so once Salary is sorted, no more sorting takes place. In general, the lower levels apply only when there are ties in the levels above them.

Sorting columns of text can be tricky, especially when non-alphabetic symbols are present. For example, sort in A-Z order on the Grade column to the right. Is this what you expected? Probably not. What about the Name column to the right, where some names are upper case and some are lower case? By default, the sort order is case-insentive, that is, case doesn't matter. Try sorting on Name with the A-Z button. They are indeed sorted in alphabetical order, except that Name got sorted too.

case? By default, the sort order is case-insentive, that is, case doesn't matter. Try sorting on Name with the A-Z button. They are indeed sorted in alphabetical order, except that Name got sorted too. (Press Ctrl-z to undo this sort.) To prevent the label getting sorted, bring up the Custom Sort dialog box and check the "My data has headers" item. While you are in Custom Sort dialog box, note the Options button at the top. One option is to check or uncheck the "Case sensitive" box. I believe it is unchecked by default. However, I checked it and then sorted on the Name column to the right. It still sorted in alphabetical order, ignoring case. Either this is a bug in Excel or something is wrong on my PC.

Sometimes you want to sort in a "natural" order, such as months in a year (Jan, Feb, etc.) or days of the week (Sun, Mon, etc.). You can do this with a custom list. To get to this option, bring up the Custom Sort dialog box, click on the Order dropdown, and select Custom List. As shown to the right, you will see several of custom lists built into Excel, the months of the year and the days of the week (either three-letter abbreviations or written out). You can also click on NEW and enter your own custom list. This new custom list is remembered on your PC for later uses. Try it! Sort on Day, using the built-in custom list. Then create a new custom list with items Morning, Afternoon, Evening (in this order), and sort on Time using this custom list.

e, such as My Excel Tutorial.xlsx, and work with the copy. Person 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Age 35 61 35 37 32 33 65 45 40 32 57 38 37 42 38 48 40 57 44 40 21 49 Gender Male Female Male Male Female Female Female Male Male Female Male Female Female Female Female Male Male Female Male Male Female Male State Ohio Illinois Illinois Indiana Ohio Illinois Illinois Ohio Illinois Ohio Illinois Indiana Indiana Ohio Ohio Ohio Indiana Indiana Illinois Ohio Indiana Ohio Children 1 2 0 2 3 3 2 1 3 1 1 0 2 2 2 1 0 2 2 0 2 1 Salary $65,400 $62,000 $63,200 $52,000 $81,400 $46,300 $49,600 $45,900 $47,700 $59,900 $48,100 $58,100 $56,000 $53,400 $39,000 $61,500 $37,700 $36,700 $45,200 $59,000 $54,300 $62,100

easing numerical in this tutorial.

the right. If you want lumn and click on opdown on the so often, you will

hat when you sort on row remains intact.

h consecutive r how many sorts you

range, such as ant to expand the You probably want n, only the Salary

e Sort & Filter levels (see to the ose you want to sort to sort in A-Z order you would like to with three levels:

Do you see the g takes place. In

are present. For pected? Probably

and some are lower ry sorting on Name Name got sorted too.

Grade A+ A AB+ B

Name FRED TOM jenny doug MARY

ry sorting on Name Name got sorted too. Custom Sort dialog

ne option is to check er, I checked it and r, ignoring case.

BC+ C CD+ D DF Order 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Time Morning Evening Evening Afternoon Evening Morning Afternoon Afternoon Afternoon Morning Evening Morning Afternoon Morning Afternoon Morning Afternoon Afternoon Afternoon Evening Morning Morning Morning Morning Morning

sam charlie BOB CHRIS

Feb, etc.) or days of on, bring up the s shown to the right, the days of the week d enter your own

with items Morning,

Day Saturday Wednesday Saturday Friday Tuesday Tuesday Monday Saturday Monday Tuesday Sunday Monday Wednesday Friday Saturday Tuesday Thursday Friday Friday Thursday Sunday Monday Sunday Sunday Saturday

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Suppose 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), select the Fill dropdown in the Editing group of the Home ribbon and then select the Series option to obtain a dialog box. Fill it out as shown below, that is, change the Rows setting to Columns, 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. Dont be afraid to experiment with them. Try it! The series of days in column L should go from 1 to 25, and in column O it should go from 26 to 50.

e, such as My Excel Tutorial.xlsx, and work with the copy. Day Sales $227 $157 $143 $129 $102 $116 $269 $111 $210 $117 $214 $150 $229 $241 $270 $224 $127 $246 $203 $207 $190 $256 $297 $175 $169 Day Sales $167 $107 $255 $113 $186 $124 $271 $288 $273 $285 $231 $272 $169 $269 $274 $133 $280 $289 $254 $114 $181 $259 $185 $117 $224

so on up to 1000.

cell (A2), select the es option to obtain a ns, make sure the e (1000) in the Stop

e afraid to

should go from 26 to

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The F5 key is called the "Go To" key. When you press it, you can type in any cell address (or range name) and press Enter. You go immediately to that cell. Try it! Use the Go To key to go directly to cell X100. (Then press Ctrl-Home to return to cell A1 so that you can do the next exercise below.)

The F5 key is much more flexible than indicated above. If you press F5 and then click on the Special button, you can "go to" (that is, highlight) a number of different things. For example, you can highlight a range, press F5, and select Blanks from the Special group (see the screenshot to the right). All of the blanks in the range are then highlighted. The following exercise shows how useful this can be. The gray range to the right has a lot of missing values, and we would like to fill them in in the obvious way. You could start dragging down, but there is a much easier way (especially if this example were much larger). 1. Highlight the gray range. 2. Press F5, click on Special, and select Blanks. All of the blank cells are now highlighted. 3. Enter an equals sign (=), press the up arrow key, and press Ctrl-Enter. See what happened? Each blank cell now has a formula that makes it equal to the cell above it, so all of the labels are effectively copied down.

e, such as My Excel Tutorial.xlsx, and work with the copy. address (or range

eturn to cell A1 so

click on the Special mple, you can reenshot to the shows how useful

Jan

Q1

2009

Feb

them in in the pecially if this

Mar

Apr

Q2

May

he cell above it, so all Jun

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Absolute and references are indicated in formulas by dollar signs (absolute) or the lack of (relative), 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 important things to remember: (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 =5*B3 and =5*$B$3 in cell C3, say, produce exactly the same result. Their difference is relevant only if you want to copy cell C3 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, if you press the F4 key repeatedly, you cycle 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 M8 and copy across to P8. (Scroll to the right to see the correct answer.)

Try it again! Enter one formula with appropriate absolute/relative addressing in cell N30 that can be copied to N30:Q34. (Scroll to the right to see the correct answer.)

This is an extremely important concept in Excel. There is no better way to be efficient (and avoid errors) than to set up a spreadsheet for copying. This often requires some careful planning, but the time spent in planning is more than made up for by efficient copying. So always be on the lookout for ways to make copying possible, and then take advantage of relative/absolute addressing in your formulas to get the correct results.

e, such as My Excel Tutorial.xlsx, and work with the copy. Fixed cost Variable cost Month Units produced Total cost $50 $2 Jan 224 Feb 194 Mar 228 Apr 258

he lack of (relative), You typically want to the cell position. take some time to

y have no inherent say, produce exactly ome range.

3 (neither row nor 3 fixed), then $B3

the right to see the

n cell N30 that can be

Table of revenues for various unit prices and units sold Units sold 50 Unit price $3.25 $3.50 $3.75 $4.00 $4.25

100

150

200

ficient (and avoid ful planning, but the be on the lookout te addressing in your

Fixed cost Variable cost Month Units produced Total cost

$50 $2 Jan 224 $498 Feb 194 $438 Mar 228 $506 Apr 258 $566

Unit price

$3.25 $3.50 $3.75 $4.00 $4.25

Units sold 50 $162.50 $175.00 $187.50 $200.00 $212.50

100 $325.00 $350.00 $375.00 $400.00 $425.00

150 $487.50 $525.00 $562.50 $600.00 $637.50

200 $650.00 $700.00 $750.00 $800.00 $850.00

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Speaking of relative and absolute addresses in formulas, it is pretty amazing how intelligent spreadsheets are. When you copy a formula in cell C1 such as =A1+B1 down, it automatically changes appropriately: =A2+B2, then =A3+B3, and so on. In a sense, these are all the same formula. Each says to add the two values to the left of the current cell. Excel allows you to see this equivalence even more clearly by viewing the formulas in a different format, called R1C1 notation. In this format, each of the formulas in column C is written as =RC[ 2]+RC[-1]. R stands for row, and C stands for column. The fact that there is nothing next to R means we stay in the same row. The numbers in brackets next to C mean to go 2 columns to the left and 1 column to the left, respectively. (For columns, negative numbers mean to go to the left, positive to the right. For rows, negative numbers mean to go up, positive down.) If there is a number next to R or C that is not in brackets, it indicates an absolute reference. For example, =R2C[2] placed in cell D5 is equivalent to =F$2 because the row reference is absolute and the column reference is relative to column D. The usual way of expressing formulas, such as =C5+D5, is called A1 format. The new way discussed here is called R1C1 format. You can easily toggle between them. To toggle between A1 and R1C1 formats: Select the Office button, select Excel options, select Formulas, and check or uncheck the R1C1 reference style option (see to the right).

Try it! Toggle between A1 and R1C1 reference style and for either, examine the formulas inside the border and in the Total row.
Note: I read an Excel book where the author suggested that we should move exclusively to R1C1 notation, arguing that it makes more logical sense. He might be right about the logic, but this is never going to happen. Way too many people are way too used to the A1 notation, and they are not about to change!

e, such as My Excel Tutorial.xlsx, and work with the copy. Multiplication table 1 2 3 4 Total 1 1 2 3 4 10 2 2 4 6 8 20 3 3 6 9 12 30 4 4 8 12 16 40

w intelligent automatically ll the same formula.

ulas in a different s written as =RC[hing next to R means mns to the left and 1 the left, positive to

e reference. For ence is absolute and

new way discussed

heck the R1C1

formulas inside the

to R1C1 logic, but this is ion, and they are not

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Many times, you will receive a spreadsheet from a colleague, and you will have absolutely no idea how its various cells are related. Where are the constants? Where are the formulas? How do the formulas incorporate the constants? How do the formulas build upon one another? In these very common situations, Excel's auditing tools can be a huge help. They let you find the precedents and dependents of any particular cell, defined as follows. 1. The precedents of any cell that contains a formula are all cells referenced by the formula in that cell. (If a cell doesn't contain a formula, it can't have any precedents.) 2. The dependents of any cell are all cells with formulas that reference that cell. The Formula Auditing group on the Formulas ribbon has buttons for tracing precedents and dependents (see the screenshot to the right). If you highlight a cell and click on Trace Precedents, you will see arrows from all of the cell's precedents to. If you click on Trace Dependents, you will see arrows from the cell to all of its dependents. (Click on the Remove Arrows button to get rid of these arrows.) You can do this multiple times. For example, if you show a cell's dependents and then click again on Trace Dependents, you will see all of the dependents' dependents. Try it! In the example to the right, a company sends catalogs to customers, which costs money. Unfortunately, only a small percentage of these customers responds by purchasing something. Use the formula auditing buttons to learn what is related to what. This should help you understand the business model and how it has been implemented in Excel. Note: Many spreadsheets in real businesses have cells that aren't related to anything. That is, they have no precendents or dependents. Typically, this is not good. It could mean that the constants in these cells are "hard-coded" (entered as constants) in one or more formulas, which is always a bad practice. It could also mean that these constants have been incorporated in the model with "mental arithmetic" rather than formulas, another bad practice. See if you can find examples of such "dangling" constants in the example to the right. Then incorporate them with appropriate formulas.

A common wish is to see all of the formulas, not their values. This is easy. Just click on the Show Formulas button in the Formula Auditing group. (This is equivalent to a keyboard shortcut you might know: Ctrl-~.) Try it! Click on the Show Formulas button to see all formulas in the model. Then click on this button again to show the values.

e, such as My Excel Tutorial.xlsx, and work with the copy. Unit printing cost Unit mailing cost Variable cost of printing and mailing Number mailed Average revenue per order Order fulfillment cost (% of revenue) Variable cost per order fulfillment Response rate Number of responses Total Revenue Fixed cost of printing Total variable cost of printing and mailing Total variable cost of order fulfillment Total cost Profit $0.10 $0.15 $0.25 100000 $60 60% $36.00 3% 3000 $180,000 $20,000 $25,000 $108,000 $153,000 $27,000

absolutely no idea ulas? How do the her? In these very the precedents and

the formula in that

cedents and Trace Precedents, endents, you will see on to get rid of these

d then click again on

ch costs money. sing something. Use you understand the

ything. That is, they hat the constants in hich is always a bad model with "mental mples of such ppropriate formulas.

lick on the Show d shortcut you might

n click on this button

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The SUM function is used so often to sum across rows or columns that a button (the S button) is available to automate the procedure. In fact, this button is on the Home ribbon and the Formulas ribbon (see the two screenshots to the right). To illustrate its use, suppose you have a table of numbers in some rectangular range. You want the row sums to appear to the right of the range, and you want the column sums to appear below the range. This is easy. To produce row and column sums with the summation button: Select the range(s) where you want the sums to appear 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 will be shown the sum formula for your approval and you will have to press Enter to actually enter it. Why does Excel do it this way? I have no idea! Note that there is a dropdown next to the summation button. If you want a sum, click directly on the S button. Alternately, you can click on the dropdown for other options, including Average, Count Numbers, Max, and Min (see to the right). Try it! Use the summation button to fill in the row and column sums to the right.

e, such as My Excel Tutorial.xlsx, and work with the copy. 51 37 13 73 38 94 6 83 64 11 15 2 29 46 3 7 41 88 32 80 167 86 213 215 132

button) is the Formulas have a table of ght of the range, and

ation button.

ect a single cell (such um formula for your do it this way? I have

m, click directly on uding Average, Count

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Often you set up a spreadsheet and then decide that you would rather have a portion of it transposed. That is, you would like to turn it on its side, so that rows become columns and vice versa. This is simple with one of Excels Paste options. To transpose a range: Select a range that you want to transpose and press Ctrl-c to copy it. Then select the upper left cell of the range where you want the transposed version to go, select the Paste dropdown, and select the Transpose option (see to the right). Make sure there is enough room for the transposed version. For example, if the original range has 3 rows and 5 columns, the transposed version will have 5 rows and 3 columns. If you select cell D5, say, as the upper left cell for the transposed version, everything in the range D5:F9 will be overwritten by the transposed version. Try it! Transpose the range L5:O8 to a range with upper left cell L11.

e, such as My Excel Tutorial.xlsx, and work with the copy. Sales figures Jan 2300 4300 5500 Feb 3200 3500 6500 Mar 4500 4200 6000

ortion of it columns and vice

ct the upper left cell pdown, and select

North West East

e original range has 3 you select cell D5, 5:F9 will be

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Range names are extremely useful for making your formulas more understandable. After all, which formula makes more sense: =B20-B21 or =Revenue-Cost? Efficient use of range names takes some experience, but here are a few useful tips. To create a range name: Select a range that you want to name. Then type the desired range name in the upper left name box on the screen. (This box is just above the column A heading. It usually shows the cell address, such as A1, where the cursor is. See to the right.) Make sure you press Enter after typing the range name; otherwise, the name you type won't "stick." Many useful range name options appear in the Defined Names group on the Formulas ribbon (see to the right). For example, you can use the Define Name option to name a range. Typing the range name in the name box is quicker and more intuitive, but the buttons in the Defined Names group give you many more options. By the way, range names are not case sensitive, so that Revenue, revenue, and REVENUE can be used interchangeably.

To manage range names, you should use the Name Manager on the Formulas ribbon. This enables you to modify or delete a range name. To modify or delete a range name: Select the Name Manager on the Formulas ribbon. This shows a list of all range names in your workbook (see to the right). Click on the one you want to modify or delete. Then click on Edit or Delete. Note that if you click on Edit, you can change the name and/or the range that the name refers to. Try it! Rename the above range of numbers as MyData. Then delete the MyData range name.

Suppose you have the labels such as Revenue, Cost, and Profit in some range, and you would like the adjacent cells (which will contain the values of revenue, cost, and profit) to have these range names. There is a quick way to do this.

To create range names from adjacent labels:


Select the range consisting of the labels and the cells to be named. Then click on the Create from Selection button in the Defined Names group on the Formulas ribbon. In the resulting dialog box, make sure the appropriate option (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 (see the screenshot to the right). You can always override its guess. Try it! Name the ranges P34:P39, Q34:Q39, and so on according to the labels in row 33.

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

Sometimes you enter 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) as follows. To apply existing range names to a formula: Highlight the formula, and select Apply Names from the Define Name dropdown in the Defined Names group (see to the right). Then highlight all range names that apply to this formula. (Actually, you can highlight several formulas and apply range names to them all at once.) Try it! You should now have the range names UnitsSold and Revenue for the ranges M34:M39 and O34:O39. Apply these to the SUM formulas in cells M40 and O40.

If you have many range names, it is often useful to show a list of them and the range addresses they apply to. To paste a list of all range names on a worksheet: Select a cell with plenty of blank space below it, select the Use in Formula dropdown in the Defined Names group, and click on the Paste Names option. Try it! Paste a list of all range names, starting in cell P63.

e, such as My Excel Tutorial.xlsx, and work with the copy. 71 15 14 40 28 41 28 31 74 49 43 72 56 81 9 46 25 20 30 90 43 69 84 38 75 92 89 81 5 27 83 83 75 73 61

ble. After all, which names takes some

upper left name ws the cell address, er typing the range

rmulas ribbon (see to Typing the range ned Names group o that Revenue,

bbon. This enables

names in your n click on Edit or e that the name

a range name. Month Jan Feb Mar Apr May Jun Totals UnitsSold UnitPrice 100 $1.25 150 $1.25 200 $1.40 230 $1.40 200 $1.50 300 $1.50 1180

nd you would like have these range

Create from sulting dialog box,

use as range names

ou name B20 as

ou name B20 as matically. However,

n in the Defined s formula. (Actually,

nges M34:M39 and

addresses they

Range names used in this sheet:

down in the Defined

Revenue $125.00 $187.50 $280.00 $322.00 $300.00 $450.00 $1,664.50

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Printing Excel worksheets is easy -- well, sort of. If you want to print a worksheet, activate it and press Ctrl-p. This brings up the dialog box to the right, showing the printer and a number of settings. You can simply click on OK and hope for the best. However, as you have probably experienced, the printout might not be what you want. There might be too many pieces of paper printed, and they might be broken into pages in an unappealing way. You can gain a lot more control over printing by first visiting the Page Setup dialog box. You get this dialog box from the Page Layout ribbon by clicking on the little arrow at the bottom right of the Page Setup group. (You can try the other buttons in this group, but I like the Page Setup dialog box, which is unchanged from previous versions of Excel.) The Page Setup dialog box has four tabs, two of which are shown below. Here are some comments/suggestions.

1. The Page tab allows you to choose between Portrait and Landscape. In the Scaling section, you can change the settings to get a better fit to the paper. If I don't have too much on a worksheet, I tend to select the "Fit to" option and let everything else as is. Then I am assured that my selected Print area (see next point) will be printed on a single piece of paper.
2. The Sheet tab lets you specify the Print area you want printed. You can also specify whether you want Gridlines and/or Row and column headings to show. So experiment with these (and many other ) print options. You do have a lot of control over what is printed and how it looks on the paper. Save some trees! By the way, you might sometimes find that certain objects like text boxes, buttons, and arrows do not get printed. To remedy this, right-click on the object, select Size and Properties, and click on the Properties tab. This contains a "Print object" option that you can check or uncheck.

e, such as My Excel Tutorial.xlsx, and work with the copy.

et, activate it and a number of settings. ly experienced, the r printed, and they

log box. You get this tom right of the ge Setup dialog box, x has four tabs, two

caling section, you on a worksheet, I d that my selected

pecify whether you

control over what is

ons, and arrows do ties, and click on the

Payment

#NUM!

Note that the PMT function is in the financial category. In general, it has 5 arguments, but the last two are optional and aren't needed here. There is a minus sign next to Principal because it is paid , not received .

o are optional

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

There are many useful functions in Excel. You should become familiar with the ones most useful to you. For example, financial analysts should learn the financial functions. But there are a few that everyone should know, and they are covered in this section. By the way, I capitalize the names of these functions, just for emphasis. However, they are not sensitive. You can enter SUM or sum, for example, with the same result. Some of these functions are so useful that Excel automatically applies them to selected ranges (when at least two cells are selected). The results are displayed in the status bar at the bottom of the screen. If you right-click in any blank space on the status bar, you can check the functions you want to be visible. Try it! Highlight any parts of the data to the right and look at the status bar.

e, such as My Excel Tutorial.xlsx, and work with the copy. Bob 10 5 13 2 9 18 18 2 18 Mary 6 11 10 15 5 16 15 19 14 Jack 5 7 6 19 20 19 1 10 6

ones most useful to ere are a few that

er, they are not case

selected ranges ar at the bottom of the functions you

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

If you havent used the fx button located just to the left of the formula bar, you should give it a try. I like to call it the function wizard. 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 calculates payments on a loan, but you are not sure what its name is or how to use it. You could proceed as follows. To use the 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 PMT). At this point you can get help, or you can press the OK button and enter the appropriate arguments for the function (interest rate, term, and principal, the latter expressed as a negative number). Some people use the function wizard as a "crutch" every time they want to enter an Excel function. I don't recommend this for functions you know well because it takes more time. However, the function wizard is great for learning how to use functions you are less familiar with. Try it! Use the function wizard to help you determine the function in cell M8. (Scroll to the right to see the correct formula.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Payments for Mr. Jones, who just bought a new car Amount financed Annual interest rate Term (number of months financed) Monthly payment $15,000 8.90% 36

should give it a try. I Excel (by category), w there is an Excel e is or how to use it.

ick on the category likely candidate and n and enter the atter expressed as a

er an Excel function. I However, the

croll to the right to

Payment

$476.30

Note that the PMT function is in the financial category. In general, it has 5 arguments, but the last two are optio and aren't needed here. There is a minus sign next to Principal because it is paid , not received .

ction is in the financial category. uments, but the last two are optional e. There is a minus sign next to

paid , not received .

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The SUM function is probably the most used Excel function of all. It sums all values in one or more ranges. To use the SUM function: Enter the formula =SUM(range), where range is any range. This sums the numeric values in the range. If there are any nonnumeric or blank cells in this range, they are ignored. Actually, it is possible to include more than one range in a SUM formula, separated by commas. (This can also be done with the COUNT, COUNTA, AVERAGE, MAX, and MIN functions.) For example, =SUM(B5,C10:D12,Revenues) is allowable (where Revenues is the name for some range). The result is the sum of the numeric values in all of these ranges combined. Again, if any cells in any of these ranges are nonnumeric or blank, they are ignored. Try it! Use the SUM function in cell M12 to calculate the total of all costs.

The AVERAGE function averages all of the numeric cells in a range. To use the AVERAGE function: Enter the formula =AVERAGE(range) where range is any range. This produces the average of the numeric values in the range. Note that the AVERAGE function ignores labels and blank cells. 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 havent yet taken the test, then =AVERAGE(C3:C50) averages only the scores for the students who took the test. (It does not automatically average in 0s for the two who didnt take the test.) Try it! Use the AVERAGE function to calculate the averages in cells P21 and P24. (For P24, you will have to replicate the exam scores in column N and make some changes.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Table of costs for units produced in one month (along side) for use in another month (along top) Feb $3,700 Mar $4,000 $4,500 Apr $4,600 $4,700 $3,000 May $4,100 $3,900 $3,800 $4,300

ues in one or more

eric values in the

ted by commas. ctions.) For example, me range). The result ells in any of these

Jan Feb Mar Apr Total cost

he average of the

, if the range C3:C50 hese students havent udents who took the

. (For P24, you will

Student ID Exam score 1533 68 8031 74 9859 80 9106 63 3535 72 8192 Absent 6102 85 6774 70 7558 64 314 72 9082 81 2397 75 2517 80 2432 73 6016 63 5269 80 4847 88 6537 71 9922 73 4525 71 1491 71 7897 68 4088 82 166 76 7925 75 6405 81 802 76

Average (for students who took the exam)

Average (giving 0s to students who were absent)

2931 7625 2628 5417 7804 3994 394 8847 7855 8668 Absent 3738 5534 6965 8863 8762 6466 6100 1878 5970 9691 8666 4865 6198 8554 6753 9574 3891 8186 Absent 1306 6835 3136 4938 4807 4421

83 67 67 92 72 69 85 78 81 77 70 71 69 73 60 76 74 67 62 77 91 81 87 76 77 81 73 83 59 74 74 78

who took the exam)

tudents who were absent)

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The COUNT function counts all of the cells in a range with numeric values. The COUNTA function counts all nonblank cells in a range. The COUNTBLANK function counts all blank cells in a range. To use the COUNT function: Enter the formula =COUNT(range), where range is any range. This returns the number of numeric values in the range. To use the COUNTA function: Enter the formula =COUNTA(range), where range is any range. This returns the number of nonblank cells in the range. To use the COUNTBLANK function: Enter the formula =COUNTBLANK(range), where range is any range. This returns the number of blank cells in the range. For example, if cells A1, A2, and A3 contain Month, 1, and 2, respectively, then =COUNT(A1:A3) returns 2, whereas =COUNTA(A1:A3) returns 3. Note that Excel is a bit inconsistent in the terms it uses on the status bar. If you highlight a range and look at the status bar, it will show "Count" and "Numerical Count." The first corresponds to COUNTA, and the second corresponds to COUNT. Try it! Use the COUNT, COUNTA, and COUNTBLANK functions to fill in cells O4, O7, and O10.

e, such as My Excel Tutorial.xlsx, and work with the copy. Student Exam score 1 62 2 73 3 74 4 5 77 6 57 7 67 8 90 9 77 10 83 11 71 12 75 13 72 14 82 15 68 16 86 17 77 18 68 19 86 20 21 80 22 81 23 84 24 71 25 76 26 81 27 99 28 72 29 78 30 67 31 89 32 70 33 77 34 35 83 36 74 37 87 38 75 39 86 40 77 41 73 42 74 43 79 44 80 Number enrolled

COUNTA function in a range.

Number who took exam

number of numeric

Number who were absent

number of nonblank

ns the number of

=COUNT(A1:A3)

highlight a range and responds to

O7, and O10.

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

77 72 77 71 70 68 79 75 80 73 61 62 68 92 85 77 79 86 83 83 76 89 72 69 66 71 80 61

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The MAX function returns the largest numeric value in a range. Similarly, the MIN function returns the smallest numeric value in a range. 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 M9:N10. Note that MAX and MIN work only on numeric data. If you have a list of names, you might expect MIN and MAX to return the first and last in alphabetical order, but they don't. Too bad! (There are two other functions called MAXA and MINA, but I'm not sure why anyone would want to use them.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Sales rep Jan sales Feb sales Allison $3,700 $2,600 Baker $2,400 $2,200 Jones $2,300 $2,400 Miller $3,000 $2,800 Smith $3,800 $3,600 Taylor $3,700 $2,300

IN function returns

se produce the Jan Feb

Min sales Max sales

you might expect oo bad! (There are d want to use them.)

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

IF functions are very useful for performing logic, and they vary from simple to complex. I will provide a few examples. To enter a basic IF function: Enter the formula =IF(condition,expression1,expression2), where condition is any condition that is either true or false, expression1 is the value of the formula if the condition is true, and expression2 the value of the formula if the condition is false. A simple example is =IF(A1<5,10,NA). Note that if either of the expressions is a label (as opposed to a numeric value), it should be enclosed in double quotes. Try it! Enter appropriate IF formulas in columns C and D. (Scroll to the right to see the answer.)

Sometimes IF functions are nested. For example, there might be three possibilities, depending on whether the value in cell A1 is negative, zero, or positive. A nested IF formula can then be used as follows. To use nested IF functions: Enter the formula =IF(condition1,expression1,IF(condition2,expression2,expression3)). If condition1 is true, the relevant value is expression1. Otherwise, condition2 is checked. If it is true, the relevant value is expression2. Otherwise, the relevant value is expression3. An example is =IF(A1<0,10,IF(A1=0,20,30)). Suppose this formula is entered in cell B2. Then if A1 contains a negative number, B2 contains 10. Otherwise, if A1 contains 0, B2 contains 20. Otherwise (meaning that A1 must contain a positive value), B2 contains 30. Try it! Use a nested IF function to fill in the grades in column C. (Scroll to the right to see the

Sometimes more complex conditions (AND/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 expression2. Note the syntax. The keyword AND is followed by the conditions, separated by a comma and enclosed within parentheses. Also, note that more than two conditions could be included in the AND, all separated by commas. 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. Make sure you use double quotes for labels.)

see the correct answer. Make sure you use double quotes for labels.)

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 both are true). Otherwise, it results in expression2. 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 answer.)

e, such as My Excel Tutorial.xlsx, and work with the copy. For each product, if the end inventory is less than or equal to 50 units, enough units are ordered to bring stock back up to 200; otherwise, no units of that product are ordered Product 1 2 3 4 End inventory 100 40 20 70 Order placed (yes or no)? # of units ordered

omplex. I will provide

ny condition that is expression2 is

a label (as opposed

ee the answer.)

ties, depending on an then be used as

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 1 2 3 4 5 6 Score 70 95 55 80 60 90 Grade

. If condition1 is true, the relevant

ell B2. Then if A1 ntains 20. Otherwise

ht to see the

tions. These are not

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

This results in expression2.

a comma and e included in the

croll to the right to

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

s results in wise, it results in

. (Scroll to the right

Order placed? # ordered no 0 yes 160 yes 180 no 0

Grade S A U S S A

Sell? No No Yes No

Bonus

Bonus 0 3.2 3.29 3.53 0 0

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

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). Because they are virtually identical except that vertical goes down and horizontal goes across, I will discuss only the VLOOKUP function. Besides, VLOOKUP appears to be used much more frequently than HLOOKUP. The VLOOKUP function takes three arguments plus an optional fourth argument: (1) the value to be compared, (2) a lookup table, 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; and (4) TRUE or FALSE (which is TRUE by default if omitted). Because the VLOOKUP function is often copied down a column, it is usually necessary to make the second argument an absolute reference. This can be accomplished by giving the lookup table a range name such as LookupTable (range names are always treated as absolute references), but a range name is not necessary. The most common use of a lookup table is when the values in the first column (the comparison column) are sorted in ascending order. (Then the fourth argument can be omitted.) Lets 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 example to the right 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 formula in cell N4 is =VLOOKUP(M4,$P$4:$Q$8,2), which is copied down column N. This formula compares the value in M4 (67) to the values in column P and chooses the largest value less than or equal to it. This is 60. Then because the last argument in the VLOOKUP function is 2, the score reported in N4 comes from the second column of the lookup table next to 60, namely, D.

To use a VLOOKUP function: Create a lookup table with at least two columns, where the values in the left column are in ascending order. Then enter the formula =VLOOKUP(value,lookup table,column #), as described above. Try it! Enter a lookup table in columns P and Q, and VLOOKUP functions in column N. Assume there is a quantity discount pricing scheme: for orders less than 300 units, the unit price is $3; for orders of at least 300 units but less than 400, the unit price is $2.50; for orders of 400 units or more, the unit price is $2. (Scroll to the right to see the answer.)

There are times where the first column of the lookup table are not sorted in ascending order. This is still allowable, but then you need to include the fourth argument with value FALSE in the VLOOKUP function. In this case, VLOOKUP will look for an exact match and will return an error if doesnt find an exact match.

an exact match. Try it! Use a VLOOKUP function in column N to find the gradepoints for each student. Note that the grades in column P of the lookup table are in the natural order, but they are not in Excels A-Z sort order. Therefore, FALSE must be entered as the fourth argument in the VLOOKUP function.

e, such as My Excel Tutorial.xlsx, and work with the copy. Student 1 2 3 4 5 6 7 8 9 Score 67 72 77 70 66 81 93 59 90 Grade D C C C D B A F A Lookup table 0 60 70 80 90

of values, and u might have a tax There are two use they are virtually s only the VLOOKUP

F D C B A

t: (1) the value to be n the leftmost swer; and (4) TRUE s often copied down rence. This can be nge names are

the comparison ed.) Lets say you F: at least 60 but 0 or above, an A. The in the lookup table

olumn N. This he largest value less function is 2, the o 60, namely, D.

lumn are in , as described

mn N. Assume there ice is $3; for orders units or more, the

Order # Units sold Total cost 1 373 2 475 3 459 4 441 5 238 6 349 7 344 8 203

cending order. This is LSE in the VLOOKUP error if doesnt find

Student Adams Davis Edwards

Grade B AC+

Gradepoints

Grade A AB+

Gradepoints 4 3.7 3.3

but they are not in nt in the VLOOKUP

Johnson Myers Smith Thomson

BB+ A C

B BC+ C C-

3 2.7 2.3 2 1.7

Total cost $932.50 $950.00 $918.00 $882.00 $714.00 $872.50 $860.00 $609.00

Lookup table 0 300 400

$3.00 $2.50 $2.00

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

There are a number of math functions you might find useful. I will list a few of the most common ones here. For more technical math functions, click on the fx button and browse the Math and Trig category. The INT function takes a decimal value and returns an integer by "chopping off" the decimal. More exactly, it returns the integer just to the left of the given decimal number on the number line. It does not round to the nearest integer. To use it: Enter the formula =INT(value), where value is a number or a reference to a cell with a number. Try it! In row 8, apply the INT function to the numbers in row 7.

The ROUND function rounds a value to the number of decimals you specify. To use it: Enter the formula =ROUND(value,decimals), where value is a number or a reference to a cell with a number, and decimals indicates the number of decimal places to round to. If decimals is 0, it rounds to the nearest integer. If decimals is positive, it rounds to this many decimals. If decimals is negative, it rounds to the nearest ten (decimals=-1), the nearest hundred (decimals=-2), the nearest thousand (decimals=-3), and so on. Try it! In row 18, apply the ROUND function to the numbers in row 16, using the decimals values in

The ABS function returns the absolute value of a number. To use it: Enter the formula =ABS(value), where value is a number or a reference to a cell with a number. Try it! In row 27, apply the ABS function to the numbers in row 26.

The SQRT function returns the square root of a number. To use it: Enter the formula =SQRT(value), where value is a number or a reference to a cell with a number. If value is negative, this returns an error. Try it! In row 34, apply the SQRT function to the numbers in row 33. The LN function returns the natural logarithm of a number. To use it: Enter the formula =LN(value), where value is a number or a reference to a cell with a number. If value is zero or negative, this returns an error. Try it! In row 41, apply the LN function to the numbers in row 40. Note: There is also a LOG10 function, which returns the log to the base 10 that you might have learned in high school. There is also a LOG function, where you can supply the base. But LN tends to

Note: There is also a LOG10 function, which returns the log to the base 10 that you might have learned in high school. There is also a LOG function, where you can supply the base. But LN tends to be used in most real applications.

The EXP function returns the exponential function of a number. That is, if you apply EXP to some number x, the result is the special number e to the power x, where e is approximately 2.718. In math books, you see this written as ex. It turns out that EXP and LN are "inverses" of one another. If you start with a number x and take EXP of it, and then take LN of the result, you end up with x. To use the EXP function: Enter the formula =EXP(value), where value is a number or a reference to a cell with a number. Try it! In row 52, apply the EXP function to the numbers in row 51. Then in row 53, apply the LN function to the numbers in row 52. Note that the value you get in cell L52 is e.

The SUMSQ function returns the sum of squares of numbers. To use it: Enter the formula =SUMSQ(range), where range is any range of numbers. Try it! In cell Q65, calculate the sum of squares of the numbers to its left.

The RAND function returns a random number uniformly distributed between 0 and 1. That is, the random number is just as likely to be near any number between from 0 to 1 as to any other number between 0 and 1. To use it:
Enter the formula =RAND(). This is a function with no arguments (nothing inside the parentheses), but the parentheses must be included. You can enter this formula in as many cells as you like, and each will have a different random number. Also, these numbers are "live." If you press the recalc (F9) key, they will all change. Try it! Enter the RAND function in cell L72 and copy it to some range. Then press the F9 key a few times and watch the random numbers change.

Until Excel 2007, the RAND function was the only function for generating random numbers. Fortunately, another very useful function, RANDBETWEEN, was added in Excel 2007. It takes two integer arguments and generates a random integer between these two values (inclusive) so that all of the possibilities are equally likely. To use it: Enter the formula =RANDBETWEEN(min,max), where min and max are two integers (with min than max). Try it! Generate random rolls of a die (1 to 6) in several cells to the right. Then press the F9 key to

e, such as My Excel Tutorial.xlsx, and work with the copy.

he most common e the Math and Trig

" the decimal. More e number line. It

1.7

-3.2

14

-7

with a number.

rence to a cell with a is 0, it rounds decimals is negative, the nearest thousand

100.35 0

14325 -2

16.3467 2

154432 -3

0.3569 1

decimals values in

-50

l with a number.

64

0.5

-20

ell with a number. If

1023

0.7

-40

with a number. If

you might have base. But LN tends to

you might have base. But LN tends to

pply EXP to some mately 2.718. In math

-4

2.3

15

umber x and take EXP

with a number.

53, apply the LN

21

43

21

35

and 1. That is, the to any other number

e the parentheses),

erent random ll all change.

s the F9 key a few

m numbers. 2007. It takes two inclusive) so that all

egers (with min less

press the F9 key to

Payment

$0.00

Note that the PMT function is in the financial category. In general, it has 5 arguments, but the last two are optional and aren't needed here. There is a minus sign next to Principal because it is paid , not received .

o are optional

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Nothing tells a story better than a well-designed chart, and Excel provides many, many charting possibilities. In fact, whole books have been devoted to Excel charts. I can't hope to cover all of the possibilities here, but I can illustrate how to create basic charts quickly and easily. If you have created a lot of charts in Excel 2003, but you are new to Excel 2007, you will see some significant changes. The most important are listed below. 1. To create a chart, use the Insert ribbon. It has a Charts group with buttons for Column, Line, Pie, Bar, Area, Scatter, and Other Charts. Each button has a dropdown for the various subtypes. 2. Once you have a chart and then select it (that is, click somewhere on it), you get three new Chart Tools tabs: Design, Layout, and Format (see below). The corresponding ribbons have plenty of buttons for modifying an existing chart. Probably the most important of these is the Select Data button on the Design ribbon, which lets you edit the data range(s) the chart is based on. Of course, you can experiment with the other buttons, and you can also experiment by right-clicking on various parts of a chart to see the possibilities. You could spend a lot of time reading thick chapters or even entire books on Excel charts, but it is better to experiment on your own. You can learn a lot by modifying an existing chart in various ways. You might not learn some of the esoteric tools this way, but you will learn the tools you use most often.

e, such as My Excel Tutorial.xlsx, and work with the copy.

y, many charting e to cover all of the

you will see some

r Column, Line, Pie, us subtypes.

get three new Chart have plenty of s the Select Data based on. Of course, clicking on various

cel charts, but it is chart in various n the tools you use

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Probably the easiest way to create a chart, based on a given data set, is to highlight at least part of the data set, including the data to be charted and the labels for the horizontal axis, if any, and select one of the chart types from the Insert ribbon. You will almost certainly want to modify the resulting chart, but this at least gives you a good start. The example to the right is typical. I want a column chart of monthly sales, so I highlighted the entire data range, L3:M15 (including the labels in row 3), and selected a column chart (of the first subtype) from the Insert ribbon. The only change I made to the chart was to delete the legend. Excel guessed, correctly, that I wanted to chart one series, Sales, and that I wanted the dates in column L to be used as labels for the horizontal axis.

Here is another example. I have monthly sales of two products, and I want a line chart that contains both series. I highlighted the entire data range, L19:N31, and selected a line chart with markers from the Insert ribbon. This time, the legend is appropriate, so I kept it. However, there was no title above the chart, so I added one (from the Chart Tools Layout ribbon). Note that the horizontal axis titles are vertical by default. If you would rather have them at an angle, right-click on the horizontal axis and select to format the alignment of the axis labels.

The most important concept in charts is a series. Every Excel chart contains one or more series. In the first chart above, there is one series, Sales. In the second chart, there are two series, Sales1 and Sales2. Typically, each series is a column of data, with a label at the top, although series are sometimes in rows, as in the example to the right (which is simply the transpose of the example above). Again, I highlighted the entire data range in rows 35-37 and inserted a line chart. Excel guessed, correctly, that my data series were in rows, not columns. But what if it makes the wrong guess? See the example below.

The data set to the right contains sales data for 4 products in 6 regions. I highlighted the entire data range, L53:P59, and inserted a line chart. What are the series? By default, Excel created a line for each product, with the region lables on the horizontal axis. That is, it guessed that the columns the series. Suppose you would rather have the rows as the series, that is, you would rather have a line for each region. This is easy. To switch the roles of rows and columns:

Click anywhere on the chart and click on the Switch Row/Column button on the Chart Tools Design ribbon.

Try it! Create a column chart (of the first subtype) for the data to the right, where each series corresponds to a product. Sometimes you change your mind and want to have another chart type. To change the chart type: Click anywhere on the chart and click on the Change Chart Type button on the Chart Tools Design ribbon. Try it! Change the column chart you just created to a line chart. Make sure each series still

By highlighting the appropriate data and then inserting a chart, you usually get what you want. But suppose you create a chart and it doesn't chart the right data. You can either delete this chart and start over, or you can modify the data series.

To modify the data series in an existing chart:


Click anywhere on the chart and click on the Data Series button on the Chart Tools Design ribbon. This brings up a dialog box with the series charted on the left and the data used for the horizontal axis labels on the right. You can then edit (or delete) any of these. Try it! I created the line chart to right by highlighting the data range N81:Q86, without the months or the labels in row 80. There are three problems: (1) the months should be labels on the horizontal axis; (2) the "junk" series shouldn't be part of the chart; and (3) the two sales series should be named by the labels in cells P80 and Q80. Open the Data Series dialog box and fix these problems.

One chart type that works a bit different from the others is the scatter chart. This type of chart is useful for detecting relationships between two variables, such as height (inches) and weight (pounds) in the data to the right.
To create the chart, I highlighted the range M96:N106 and inserted a scatter chart of the first subtype. I then changed the title, deleted the legend, and added horizontal and vertical axis titles. If you open the Data Series dialog box, you will see that there is one series, Weight. However, if you click on Edit for this series, you will see that there is a Y-series and an X-series. By default, when you select two columns for a scatter chart, the data in the rightmost column, in this case Weight, is the Y-series (it goes on the vertical axis), and the other is the X-series (it goes on the horizontal axis). If you want them reversed, you have to go through the Data Series dialog box.

Try it! Starting with the scatter chart to the right, change it so that Height is on the vertical axis and Weight is on the horizontal axis. (You will have to change the axis titles manually.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09 Nov-09 Dec-09 Sales $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586 $8,476 $9,191 $7,242 $8,277

ight at least part of xis, if any, and select modify the resulting

Sales
$10,000 $8,000 $6,000 $4,000 $2,000 $0

highlighted the entire (of the first subtype) egend. Excel guessed, n column L to be

e chart that contains art with markers from ere was no title the horizontal axis ck on the horizontal

Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09 Nov-09 Dec-09

Sales1 $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586 $8,476 $9,191 $7,242 $8,277

Sales2 $8,452 $6,801 $5,497 $10,329 $5,995 $8,103 $6,386 $5,047 $8,641 $10,696 $6,914 $9,004

Monthly Sales of Two Produ


$12,000 $10,000 $8,000 $6,000 $4,000 $2,000 $0 Apr-09 May-09 Mar-09 Jan-09 Feb-09 Jun-09 Jul-09

or more series. In wo series, Sales1 and h series are e of the example ne chart. Excel makes the wrong

Month Sales1 Sales2

Jan-09 $8,627 $8,452

Feb-09 $5,343 $6,801

Mar-09 $6,244 $5,497

Apr-09 $9,451 $10,329

May-09 $6,698 $5,995

Jun-09 $6,752 $8,103

Monthly Sales of Two Products


$12,000 $10,000 $8,000 $6,000 $4,000 $2,000 $0

$0 Mar-09 May-09

Aug-09

Apr-09

Jun-09

Oct-09

Jan-09

hted the entire data created a line for columns are ould rather have a

Region1 Region2 Region3 Region4 Region5 Region6

Product1 Product2 Product3 Product4 $4,806 $2,898 $2,609 $3,999 $2,109 $3,291 $2,936 $4,616 $3,483 $4,843 $4,169 $2,847 $4,660 $2,896 $2,863 $1,094 $4,493 $1,499 $4,860 $4,105 $2,650 $2,361 $1,862 $2,183

$6,000 $5,000 $4,000 $3,000 $2,000 $1,000 $0 Region1

e Chart Tools Design

ere each series Product1 Product2 Product3 Product4 Product5 Product6

Chart Tools Design

Jan-09 $3,369 $3,460 $3,503 $1,981 $3,389 $3,703

Feb-09 $3,574 $2,613 $3,968 $1,630 $4,147 $4,650

Mar-09 $4,842 $1,665 $1,459 $1,099 $1,836 $4,016

Apr-09 $3,017 $3,657 $1,152 $4,981 $3,769 $4,673

May-09 $3,871 $2,478 $4,581 $1,297 $3,030 $3,941

Jun-09 $4,694 $1,791 $2,811 $3,878 $1,643 $3,701

h series still

what you want. But elete this chart and

ools Design ribbon. d for the horizontal

Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09

Junk1 21 74 42 62 9 44

Junk2 42 8 2 80 39 37

Sales1 $3,640 $2,028 $1,713 $1,289 $3,275 $2,454

Sales2 $2,932 $1,388 $4,732 $2,549 $3,206 $3,177

without the months els on the horizontal eries should be fix these problems.

5000 4500 4000 3500 3000 2500 2000 1500 1000 500 0

Nov-09

Feb-09

Sep-09

Jul-09

his type of chart is s) and weight

Weight

art of the first d vertical axis titles. If ht. However, if you

htmost column, in series (it goes on a Series dialog box.

Person 1 2 3 4 5 6 7 8 9 10

Height 60 61 62 63 63 65 70 72 72 76

Weight 155 162 162 162 164 168 175 199 215 241

Height versus weigh


300 250 200 150 100 50 0 0 10 20 30

the vertical axis and

Sales of Two Products

Sales1 Sales2

Aug-09

Jul-09 $5,985 $6,386

Aug-09 $5,586 $5,047

Nov-09

Dec-09

Sep-09

Oct-09

Jul-09

Sep-09 $8,476 $8,641

Oct-09 $9,191 $10,696

Nov-09 $7,242 $6,914

Dec-09 $8,277 $9,004

wo Products

Sales1 Sales2

Nov-09

Dec-09

Product1 Product2 Product3 Product4

Region1 Region2 Region3 Region4 Region5 Region6

5000 4500 4000 3500 3000 2500 2000 1500 1000 500 0 1 2 3 4 5 6

Series1 Series2 Series3 Series4

Height versus weight

30

40 Height

50

60

70

80

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

A chart can be placed in one of two locations: on a worksheet (probably the worksheet that contains the data the chart is based on), or on a separate chart sheet (a sheet that has no rows or columns, only a chart). Some people prefer the first option, and others prefer the second. It is totally a matter of taste. When you create a chart from the Insert ribbon, the chart automatically goes on the worksheet with the data. However, it is easy to move it. To change the location of a chart: Highlight the chart, and click on the Move Chart button on the Chart Tools Design ribbon (see below). You can then choose from the above two options. Try it! Move the chart to the right to a separate chart sheet. (This chart sheet will have a generic name like Chart1, but you can rename it if you like.) Then move the chart back to this worksheet. Note that when you move the chart back to this worksheet, the chart sheet will disappear.

e, such as My Excel Tutorial.xlsx, and work with the copy. Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09 Nov-09 Dec-09 Sales $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586 $8,476 $9,191 $7,242 $8,277

rksheet that contains o rows or columns, . It is totally a matter ly goes on the

Sales
$10,000 $9,000 $8,000 $7,000 $6,000 $5,000 $4,000 $3,000 $2,000 $1,000 $0

gn ribbon (see

ill have a generic to this worksheet. disappear.

Sales

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Once you create a chart and ensure that it charts the correct series, you are usually still not finished. Just about everything you see on the chart can be modified to suit your taste (or tell the story better). Here are some, but certainly not all, of the changes you can make: 1. Add, delete, or change the chart title. 2. Add, delete, or change the axis titles. 3. Add, delete, or move the legend. 4. Change the scale, font, or alignment of the axis labels. 5. Add, delete, or change the gridlines, e.g., make them lighter. 6. Add data labels to points on the chart. 7. Change the background color of the plot area (the inner part of the chart).

To make these or other changes, you can use the buttons on the Chart Tools ribbons, or you can right-click on the part of the chart you want to change to get a context-sensitive menu. From there, it is a matter of experimenting.
Try it! I got the top chart to the right by highlighting the range M3:N15 and inserting a scatter chart of the first subtype. Then I modified it quite a lot to produce the bottom chart. Repeat this exercise by creating the default scatter chart and then modifying it to look like my finished version. Hints: If you click on a point on a scatter chart, you select all of the points. But you can select a single point by clicking twice in a row (not double-clicking but clicking once and then clicking again.) However, this still didn't help with the label at the top. The only data labels you can add to points on a scatter chart are the X-values or the Y-values. I wanted to add the month label to the point near the top, so I had to resort to a text box (from the Insert ribbon). Clearly, you can spend a lot of time modifying a chart. Sometimes it is time well spent, and sometimes it isn't. You have to use common sense. My best advice is: Make sure it looks professional, make sure it tells the story clearly, and keep it simple! Usually simple charts look best and tell the story best.

e, such as My Excel Tutorial.xlsx, and work with the copy. Person Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09 Nov-09 Dec-09 Sales1 $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586 $8,476 $9,191 $7,242 $8,277 Sales2 $23,919 $19,507 $34,377 $30,285 $19,673 $21,007 $16,644 $21,022 $23,928 $31,403 $25,333 $28,071

ually still not finished. r tell the story

Sales2
$40,000 $35,000 $30,000 $25,000 $20,000 $15,000 $10,000 $5,000 $0 $0 $2,000 $4,000

bbons, or you can e menu. From there,

rting a scatter chart Repeat this exercise ed version.


Product 2 ($1000s)

Sale of product 2 versus sales of prod


35.0 32.5 30.0 27.5 25.0 22.5 20.0 17.5 15.0 5 6 7 Product 1 ($1000s)
March

you can select a then clicking again.) can add to points on l to the point near

spent, and

ple charts look best

Sales2

Sales2

$6,000

$8,000

$10,000

product 2 versus sales of product 1

10

Product 1 ($1000s)

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

This tutorial is built around hyperlinks, links like the one in cell A1 that let you maneuver easily from one worksheet to another. If you have never tried using hyperlinks in your Excel files, you should start now. They are really easy. To create a hyperlink such as the one in cell A1 that takes you back to the Table of Contents worksheet, right-click on a cell and select Hyperlink to bring up the dialog box below. Enter the label you want in the "Text to display" box. Then, as you can see in the list on the left, you can choose several types of hyperlinks. The ones I have used for this tutorial are of type "Place in This Document", where you can select a worksheet and a cell reference to jump to. The other types you will probably use most often are "Existing File or Web Page" and "E-mail Address". Actually, Excel is quite smart about Web sites and email adresses. For example, if you enter a URL in a cell such as http://www.amazon.com, you won't even need the dialog box to the right. Excel will immediately sense that this is a URL, and it will add the hyperlink automatically. Then when you select this cell, your default browser will open and take you to the specified URL. Or if you enter an address that looks like an email address, such as jones@aol.com, Excel will sense that this is an email address and will add a hyperlink automatically. Then when you select this cell, your default email program will start up, with a new message to this address. Once you have a hyperlink in a cell, you can modify or delete it by right-clicking on the cell and choosing Edit Hyperlink or Remove Hyperlink.

e, such as My Excel Tutorial.xlsx, and work with the copy.

maneuver easily from l files, you should

of Contents elow. Enter the label , you can choose ace in This

mail r example, if you e dialog box to the k automatically. he specified URL. Or , Excel will sense that select this cell, your

on the cell and

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Do you remember your high school algebra class where you had to solve a single equation for a single "unknown" value? You can do this in Excel with the Goal Seek tool. The unknown is called a changing cell. Essentially, you want to change the value in this cell to force a formula in some other cell to be equal to a specified value. A simple example of this appears to the right. Demand for a company's product is determined by a linear demand curve: the higher the price, the lower the demand. The company produces exactly enough to meet demand, with the given unit cost of production. The company wants to find the breakeven price, that is, the price that makes profit equal to 0. We can do this with Goal Seek. Here are the steps. 1. Choose Goal Seek from the What-If Analysis dropdown on the Data ribbon. 2. Fill in the resulting dialog box as shown to the right. Specifically, the price in cell M4 should be changed so that the profit in cell M12 is 0. If you try this, you will see that the result isn't very interesting. It turns out that the price should be set to 100, at which point the demand is 0, and this yields no sales and no profit. It is probably more interesting to force the profit to some positive value. Try it! See if you can change the price so that profit equals $12,500. Note: For numerical reasons, Goal Seek can't force profit to exactly the value you specify; it only gets close. For example, when I tried to force profit to 0, I got the result in the dialog box to the right, indicating that profit got forced to the very small "current value" shown. If this isn't close enough, you can change an Excel setting to make it closer. Click on the Office button, then on Excel Options, and choose the Formulas group. Then change the "Maximum Change" to a smaller value

e, such as My Excel Tutorial.xlsx, and work with the copy. Unit cost Unit price 50 60

e equation for a nknown is called a in some other

is determined by a y produces exactly wants to find the with Goal Seek. Here

Demand curve (linear) Intercept 2000 Slope -20 Demand Profit 800 8000

cell M4 should be

the price should be t. It is probably more

ou specify; it only dialog box to the f this isn't close utton, then on Excel to a smaller value

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Data tables, also called what-if tables, allow you to see very quickly how one or more outputs change as one or two key inputs change. This is called sensitivity analysis, or simply what-if analysis, and it is a key part of most business models. There are two types of data tables: one-way tables and two-way tables. A one-way table has one input and any number of outputs. A two-way table has two inputs but only one output. I will demonstrate both types on the following two worksheets. Business models are all about what-if questions. What would happen to profit if our unit cost increased by x%? What would happen to our sales if our competitor's production decreased by y%? And so on. Data tables are perfect for answering these types of questions in a systematic way, and they are surprisingly easy to create. Therefore, it is always surprising to me that so few business students (and business employees) are aware of data tables. This is a very valuable skill, so make

Some data tables are very long (many rows), and each value might require the recalculation of a complex business model, so the recalculation of the entire data table might take a while, several seconds or even minutes. By default, this recalculation occurs every time anything in the spreadsheet changes. So you could be waiting and waiting for many data table recalculations. For this reason, there is an Excel calculation setting you can change. To change the calculation setting: Click on the Office button, then Excel Options, then on Formulas. There you can change the Calculation mode from Automatic to Automatic except for data tables (see to the right). With this setting, a data table will not recalculate until you want it to. You can force it to recalculate by pressing the Recalc (F9) key. By the way, there is one other calculation setting you will see, Manual. With this setting, nothing recalculates until you press the F9 key. It's hard to think of a time you would need this setting,

e, such as My Excel Tutorial.xlsx, and work with the copy. more outputs -if analysis,

way table has one output. I will

f our unit cost on decreased by y%? ystematic way, and so few business able skill, so make

recalculation of a e a while, several

recalculations. For

n change the

orce it to recalculate

nothing ed this setting,

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

A one-way data table lets you see how one or more selected outputs change as a single input varies over some range. To illustrate, suppose Mr. Jones buys a new car for $20,000, makes a $5,000 down payment, and finances the remaining amount over the next 36 months at a 6.5% annual interest rate. There are at least two outputs that might be of interest: the monthly payment and the total interest paid through the duration of the loan. These are affected by the four inputs in blue to the right. Lets first look at a simple one-way data table, which illustrates how a single output, monthly payment, varies as the annual interest rate varies. This is shown in the example to the right. To create the table in columns O and P (which I already did): Enter a link for the output in cell P5. Specifically, because the monthly payment was calculated with the PMT function in cell M9, enter the formula =M9 in cell P5. Then, starting in cell O6, enter any sequence of interest rates. Select the entire tablethe range O5:P10. Next, select the Data tab, and in the Data Tools group, select Data Table from the What-If Analysis dropdown (see top screenshot to the right). Finally, enter M6, the interest rate cell, as the column input cell. There is no row input cell, so leave it blank (see bottom screenshot to the right). It is important to understand exactly what happens when you do this, so read this paragraph several times until it sinks in. Excel takes each interest rate in column O, substitutes it into the column input cell you designated (cell M6), recalculates the formula in cell M9 with this new interest rate (and hence the link in cell P5, the one I colored gray for emphasis), and records the answer in the data table. You use a column input cell because the possible values of the input (the interest rates) are listed in a column. You can tell you have a data table by looking at any of the "answer" cells, such as cell P6. It contains a formula =TABLE(,M6), surrounded by curly brackets. The part inside the parentheses shows the row and column input cells, the first of which is blank in this example. The curly brackets indicate that this is an array formula. Essentially, this means that it is entered in all of the answer cells of the data table at once, as a group. You never need to enter this formula; you create the table as explained above. However, the formula documents what the answer range contains.

It is also possible to capture multiple outputs in a one-way data table. An example appears to the right, where the single input is still the interest rate, but there are two outputs: monthly payment and total interest paid. This table is formed exactly as before except that the table range is now O39:Q44.

Try it! Create a one-way data table that shows the monthly payments and the total interest paid for each term (value in cell M51) from 12 to 48 in increments of 12. (Scroll to the right for the answer.)

Try it! Create a one-way data table that shows the monthly payments and the total interest paid for each term (value in cell M51) from 12 to 48 in increments of 12. (Scroll to the right for the answer.) Try it again! Delete the data table you just created. Next, change the calculation setting from Automatic to Automatic except for data tables, as explained on the previous worksheet. Create the data table again. You should see the same value through the table. Press the F9 key to get the right answers. Then go back and change the calculation setting to Automatic.

e, such as My Excel Tutorial.xlsx, and work with the copy. input varies Price of car Down payment Amount financed Annual interest rate Number of payments Monthly payment Total interest paid $20,000 $5,000 $15,000 6.50% 36 $459.74 $1,550.46 Data table Interest rate 6.00% 6.25% 6.50% 6.75% 7.00%

wn payment, and est rate. There are at interest paid o the right.

tput, monthly to the right.

Monthly payment $459.74 $456.33 $458.03 $459.74 $461.44 $463.16

was calculated with cell O6, enter any ect the Data tab, and (see top screenshot here is no row input

his paragraph several nto the column input nterest rate (and nswer in the data interest rates) are

as cell P6. It contains ntheses shows the brackets indicate he answer cells of the e the table as

ple appears to the monthly payment ble range is now

Price of car Down payment Amount financed Annual interest rate Number of payments Monthly payment Total interest paid

$20,000 $5,000 $15,000 6.50% 36 $459.74 $1,550.46

Data table Interest 6.00% 6.25% 6.50% 6.75% 7.00%

Monthly payment $459.74 $456.33 $458.03 $459.74 $461.44 $463.16

otal interest paid for ght for the answer.)

Price of car

$20,000

otal interest paid for ght for the answer.)

n setting from orksheet. Create the key to get the right

Down payment Amount financed Annual interest rate Number of payments Monthly payment Total interest paid

$5,000 $15,000 6.50% 36 $459.74 $1,550.46

Total interest $1,550.46 $1,427.85 $1,489.08 $1,550.46 $1,611.98 $1,673.63

Data table

Term 12 24 36 48

Monthly payment $459.74 $1,294.45 $668.19 $459.74 $355.72

Total interest $1,550.46 $533.36 $1,036.65 $1,550.46 $2,074.77

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Two-way tables allow you to vary two inputs, one along a row and one along a column, and capture a single output in the body of the table. The example to the right illustrates this, where the annual interest rate and the amount of the down payment both vary, and the single output is the monthly payment. To create this table (which I already did for you): Enter the formula =M9 for the single output in the upper left corner, cell O4, of the data table. (Again, I colored this cell gray for emphasis.) Enter any sequence of down payments to the right of this and any sequence of interest rates below this. Next, select the Data menu, and in the Data Tools group, select Data Table from the What-If Analysis dropdown. Finally, enter M4 as the row input cell, and enter M6 as the column input cell (see to the right). As with one-way tables, you can tell you have a data table by looking at any of the "answer" cells, such as cell P5. Each contains the formula =TABLE(M4,M6), surrounded by curly brackets. This formula indicates that M4 is the row input cell and M6 is the column input cell. In words, the values for down payment go across the top row of the table, and the values for interest rate go down the left column of the table. Remember that a two-way data table allows only one output. If you want to analyze multiple outputs, you have to create multiple data tables, one for each output. Try it! Create a two-way data table that shows the total interest paid for each term from 12 to 60 in increments of 12, and each down payment from $4000 to $6000 in increments of $1000. Put down payments along the top, terms along the side. (Scroll to the right for the answer.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Price of car Down payment Amount financed Annual interest rate Number of payments Monthly payment Total interest paid $20,000 $5,000 $15,000 6.50% 36 $459.74 $1,550.46 Data table of monthly payment $459.74 $4,000 $5,000 6.00% $486.75 $456.33 6.25% $488.57 $458.03 6.50% $490.38 $459.74 6.75% $492.21 $461.44 7.00% $494.03 $463.16

column, and capture , where the annual utput is the monthly

the data table. ents to the right of and in the Data Tools as the row input

he "answer" cells, y brackets. This In words, the values st rate go down the

alyze multiple

erm from 12 to 60 in of $1000. Put down

Price of car Down payment Amount financed Annual interest rate Number of payments Monthly payment Total interest paid

$20,000 $5,000 $15,000 6.50% 36 $459.74 $1,550.46

Data table of total interest paid

$6,000 $425.91 $427.49 $429.09 $430.68 $432.28

Data table of total interest paid $1,550.46 12 24 36 48 60

Data table of total interest paid $4,000 $5,000 $6,000 $568.91 $533.36 $497.80 $1,105.76 $1,036.65 $967.54 $1,653.83 $1,550.46 $1,447.10 $2,213.08 $2,074.77 $1,936.45 $2,783.50 $2,609.53 $2,435.56

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

It is very common to work with "data sets" in Excel, where a data set is typically arranged in a rectangular range with "observations" in the rows, "attributes" in the columns, and attribute names in the top row. (Attributes are also called variables or fields.) A typical data set appears to the right. Each row is an observation on some person, and each column is lists an attribute about the people. Excel users have worked with data sets for years, and for several versions of Excel, they were known somewhat informally as "lists." But in Excel 2007, they gained much more prominence and became known as "tables." This was a much needed change. You can do so many useful tasks with the new tables that you either couldn't do before or could do only with extra work. Now these tasks are easy.

It is not enough to have a rectangular range of data to apply the new tools. You must designate the range as a table. There are two ways to do this, both equally easy. For each, make sure your cursor is somewhere (anywhere) in the table. Then: 1. Click on Table toward the left of the Insert ribbon, or 2. Click on Format as Table on the Home ribbon and choose any of the color styles. Excel guesses that the range "surrounding" the cursor position is the table range, but you can override this guess if necessary. Try it! Designate the data set to the right as a table. You will see that the formatting changes, and you will see two other important changes. First, there is a dropdown arrow next to each attribute name. These are used for sorting and filtering, as discussed below. Second, if your cursor is inside the table, there is a new Table Tools Design tab and corresponding ribbon. It contains the tools for manipulating the table. If you don't want the range to be a table, I suggest that you first select a table style that is "plain" (like a regular worksheet). Then click on Convert to Range on the Table Tools Design ribbon. The dropdown arrows will disappear. Try this on the table you just created. One of the main uses of tables is filtering, that is, hiding (but not deleting) rows that don't match various conditions. Filtering is done through the dropdown arrows next to the column headings. I won't even begin to explain all of the options, but with a little bit of experimenting, you should be able to master them in no time. Just remember that they build upon one another. For example, if you filter on Gender so that only males are showing, and you then filter on Children so that only people with at least 2 children are showing, you will see only males with at least 2 children. Try it! Designate the data set to the right as a table if necessary, and then experiment with the filters. Note that there are number filters, text filters, and date filters. Experiment with all of them. To clear a filter, click on the columns dropdown arrow and select the Clear Filter item. To clear all filters, click on the Clear button in the Sort & Filter group on the Home ribbon. (It is also on the Data ribbon.) Try it now by clearing all your filters.

You probably noticed that when you clicked on a column dropdown arrow, there are also sorting options. I already discussed sorting in a previous worksheet, and the options here are about the same. If sorting in tables provides any advantages over sorting in regular (non-table) data sets, I haven't noticed them.

One important advantage of a table is that you can summarize filtered data easily. To do so, check the Total Row box on the Table Tools Design ribbon. This generates a "total" row below the table. By default, it shows the sum of the values in the rightmost column. But it gives you many more options. If you click on any cell in the total row, you will see a dropdown list of ways you can summarize the column (count, sum, average, and others). And importantly, if you then filter the data, the summary measures will be only for the filtered data. (This couldn't be done, at least not easily, before Excel 2007.) Try it! Create a total row fo the table to the right, and show summary measures that seem appropriate. Then filter in some way and see whether the summary measures change.

A feature of tables that business people will love is that they expand automatically as new data is added. For example, suppose you designate the data set to the right as a table. Later you add new products to the right or new monthly sales at the bottom. These will automatically be part of the table. Better yet, if you build a chart from the table, the chart will update automatically to include new data. (The same is true of pivot tables built from tables.) Try it! Designate the data set to the right as a table. Next, highlight the entire table and insert a line chart. By default, you should see a line for each product, with time on the horizontal axis. Now add a couple more months of data at the bottom of the table and add a new product with some reasonable data at the right of the table. The chart should update automatically!

My Excel Tutorial.xlsx, and work with the copy. Person 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Birthdate 8/5/1959 10/15/1977 1/3/1981 5/5/1949 4/4/1987 6/30/1949 5/22/1949 10/30/1952 1/17/1957 9/18/1985 7/19/1953 12/10/1946 3/29/1986 12/12/1952 6/12/1977 11/19/1989 9/6/1957 9/30/1970 10/24/1973 6/8/1978 8/27/1990 2/9/1947 4/1/1989 3/12/1970 3/28/1970 5/6/1963 5/7/1959 3/6/1987 2/9/1958 8/4/1955 11/9/1984 2/10/1961 4/1/1961 10/20/1961 4/25/1970 2/17/1977 4/13/1985 5/16/1966 10/28/1969 11/30/1958 9/27/1962 1/25/1968 10/15/1988 2/11/1978 Gender Male Female Male Male Female Female Female Male Male Female Male Female Female Female Female Male Male Female Male Male Female Male Male Male Male Male Male Male Male Female Male Female Female Male Male Male Male Male Female Male Male Male Female Female State Illinois Wisconsin Ohio Indiana Michigan Indiana Illinois Michigan Michigan Indiana Ohio Wisconsin Michigan Indiana Indiana Wisconsin Ohio Michigan Wisconsin Illinois Ohio Indiana Michigan Wisconsin Ohio Michigan Indiana Michigan Illinois Ohio Indiana Ohio Ohio Illinois Michigan Michigan Michigan Ohio Indiana Illinois Illinois Ohio Wisconsin Michigan Children 1 2 0 2 3 3 2 1 3 1 1 0 2 2 2 1 0 2 2 0 2 1 0 0 1 1 3 2 1 2 2 1 1 0 2 0 2 0 3 1 1 2 0 0 Salary $65,400 $62,000 $63,200 $52,000 $81,400 $46,300 $49,600 $45,900 $47,700 $59,900 $48,100 $58,100 $56,000 $53,400 $39,000 $61,500 $37,700 $36,700 $45,200 $59,000 $54,300 $62,100 $78,000 $43,200 $44,500 $43,300 $45,400 $53,900 $44,100 $31,000 $67,400 $59,300 $48,600 $58,400 $65,500 $46,900 $41,000 $89,300 $71,800 $95,000 $49,700 $71,700 $52,900 $58,300

e table. By e options.

45 6/19/1974 Male 46 9/22/1989 Male 47 7/25/1983 Female 48 4/9/1956 Female 49 2/9/1989 Male 50 12/10/1960 Female 51 8/6/1956 Male 52 9/20/1981 Male 53 1/31/1963 Male 54 12/7/1973 Female 55 12/3/1988 Male

Indiana Wisconsin Wisconsin Indiana Ohio Michigan Michigan Indiana Wisconsin Ohio Wisconsin

2 0 1 2 2 1 2 2 2 0 0

$82,000 $41,300 $72,000 $73,500 $55,200 $57,000 $84,300 $68,900 $59,000 $83,200 $52,400

Now add a

Month Jan-08 Feb-08 Mar-08 Apr-08 May-08 Jun-08 Jul-08 Aug-08 Sep-08 Oct-08 Nov-08 Dec-08 Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09

Product1 $2,905 $1,459 $1,643 $4,799 $3,437 $3,439 $1,265 $1,826 $1,732 $4,411 $3,150 $3,665 $2,939 $2,559 $1,069 $2,558 $1,496 $2,204 $3,266 $2,214 $2,014 $1,051

Product2 $2,332 $2,865 $2,155 $3,993 $4,159 $4,328 $4,636 $3,979 $4,069 $1,607 $3,949 $4,023 $2,738 $1,481 $2,260 $4,935 $4,187 $1,802 $4,033 $1,247 $3,583 $3,205

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Pivot tables are a manager's dream. They allow you "slice and dice" data in a typical data set in all sorts of ways. Essentially, you use pivot tables to break down variables like revenue or items sold by categories, such as by region, by month, by store, and so on. Pivot tables have been included in Excel since the late 1990s, and each new version has changed them slightly. Then Excel 2007 changed them a lot, or at least it changed the user interface for pivot tables a lot. This was evidently in response to users who complained that the old interface was not very user friendly. Although I don't happen to agree with this complaint (I always though pivot tables were pretty easy to use), I agree that the Excel 2007 user interface is better than ever. In fact, I know of no tool in any software package that enables you to get so much information so quickly and easily. Probably the only thing that makes pivot tables difficult for some users is that there are so many options. Whole books have been written about pivot tables. I don't recommend them, simply because they spend a lot of pages and directions explaining options that are quite intuitive. Rather than read such books, I recommend that you learn the essentials and then experiment. The discussion here will get you started, but I make no attempt to explain anywhere near all of the

The data set to the right is typical. Each row is a sale to some customer. The last two variables, Items Ordered and Total Cost, are numeric, so they are candidates for breaking down by the categorical variables to their left. To create a pivot table, place your cursor somewhere (anywhere) in the data set and click on the Pivot Table button on the Insert ribbon. Excel guesses the data range, which you can override if necessary, and it asks where you want the pivot table to be placed. Try it! Create a pivot table from this data set, and place it on a new worksheet. The new worksheet's name will be something generic like Sheet9, and it will be located just to the left of this worksheet. Rename the new worksheet Practice Pivot Table. (To keep from having to go back and forth between worksheets, you might want to copy this text box and the ones below to the new worksheet.) You should see a blank pivot table to the left, and if your cursor is inside it, you should see a Pivot Table Field List window on the right and two PivotTable Tools tabs (Options and Design) and corresponding ribbons at the top. (I'll say it again. The field list window and the pivot table tabs are visible only when your cursor is inside a pivot table. So if they disappear, you'll know why.) The key is the field list on the right. The top pane shows all of the available fields (columns), and the bottom pane shows the four areas you can drag these to. Rather than listen to a long explanation, try the following: Drag Gender to the Row Labels area, drag Region to the Column Labels area, drag Paid With to the Report Filter area, and drag Total Cost to the Values area. You have just broken down Total Cost by Gender, Region, and Paid With. Each number in the pivot table is the sum of Total Cost for its particular category values.

Here are some other things you can do to the pivot table you just built:

Here are some other things you can do to the pivot table you just built: 1. By default, the sums are for all categories of the Report Filter variable. To show sums only for VISA sales, say, click on the dropdown arrow next to Paid With and select VISA. 2. You can hide any row or column categories. For example, click on the Column Labels dropdown and select only Midwest and West. 3. You can change the way Total Cost is summarized and the way its values are formatted. To do so, right-click on any of the numbers in the pivot table and select Value Field Settings. (You will do this often, so remember it.) In the Summarize by list, select Average. Then click on the Number Format button and select a number format in the usual way. Now you see the average of Total Cost for the various categories.

4. In the bottom pane of the field settings window, drag Gender to the column area and Region to the row area. This is called pivoting. (So guess why they're called pivot tables!)
5. In the bottom pane of the field settings window, drag any of the fields to a blank space on the worksheet (or simply uncheck its box in the top pane). This removes the field from the pivot table. There is no requirement that each of the four areas must contain a field. 6. You can have two (or even more) fields in a given area. For example, put both Region and Time in the row area. It starts to get "busy," but you are certainly allowed to do it. 7. You can sort the values in the row or column area through the dropdown arrows, but the sort order might not be the "natural" order. For example, drag Time to the row area (and drag any other variable off). The natural order is Morning, Afternoon, Evening, but this isn't what you get with a sort. Fortunately, there is a trick. Select the Morning cell, and place your cursor at the bottom of the cell so that it becomes a 4-way arrow. Now drag it up above Afternoon. 8. With your cursor in the pivot table, click on the PivotChart button on the PivotTable Tools Options ribbon, and select a chart type. You not only get a very nice-looking Excel chart, but it updates automatically as you make changes in the pivot table. That is, the pivot table and the corresponding pivot chart are perfectly synchronized. Make some changes to the pivot table to see what I mean. This is almost too good to be true! If the field in the Values area is numeric, as it usually is, then you probably want to summarize it by sums or averages. But you can also summarize by counts. Then it doesn't matter which field is in the Values area. Try it! Start over by dragging everthing off the pivot table. Now drag Region to the row area, Gender to the column area, and any variable to the Values area. If you drag a text variable to the Values area, you get counts by default. But let's say you drag a numeric variable such as Total Cost to the Values area. Then you will have to right-click on any number in the pivot table, select Value Field Settings, and select Count to summarize by. (If you do the latter, it's a good idea to change the Custom Name in the Value Field Settings dialog box to Count, rather than Count of Total Cost. The reason is that Total Cost has nothing to do with the counts, so including it in the label is misleading.) In either case, you can then reformat the counts as integers if necessary.

integers if necessary.

Each count shows the number of customers in the category. For example, you should see that there are 43 females from the Midwest.
Sometimes it is more informative to display the counts as percentages. To do this, open the Value Field Settings dialog box in the usual way, click on the "Show values as" tab, and select the "% of row" item from the dropdown list. You should see, for example, that 26.5% of all female customers are from the NorthEast. Do it again, but this time select the "% of column" item. Now you should see, for example, that 32.26% of all South customers are male. You can experiment with these and other "Show values as" options. It all depends on how you want to "tell the story."

The last useful feature I will discuss is grouping. If you drag a field to, say, the row area, you will get a row for each distinct value of that field. If there are a lot of distinct values, the pivot table will become unwieldy and probably not very useful. In this case, it is a good idea to group on the field. Try it! Start over by dragging all of the fields off the pivot table. Then drag Date to the row area and Total Cost to the Values area. Note that there is some summarizing going on here because multiple sales were made on some of the dates, but there are too many dates for a manager to get much sense of what is happening through time. So it is useful to group on dates. Try it! Right-click on any date, select Group, and then select Month. Now you see total sales in each of the 4 months.

If this data set were over a multi-year period and you grouped as above, you would see all of the Januaries lumped together, and similarly for the other months. To see them broken down by year, the trick is to select Month and Year from the Group dialog box.

There can be a distinct advantage to building a pivot table from a table instead of from a fixed range. The advantage is that if you decide to add rows or columns to the table, the table expands automatically, as explained in the previous worksheet, and the pivot table can then be refreshed with the click of a button to accommodate the new data. That is, you do not need to build a new pivot table. Try it! Designate the data to the right as a table. It will get a default table name, such as Table2, which you can change if you like. Then build a pivot table from the table. You will notice that the data source box (labeled Table/Range) contains the name of the table, not a range address. This is what you want. Now go back and add a new column to the right of the table (possibly with a formula) and/or add some extra data to the bottom of the table. Go back to the pivot table and click on the Refresh button on the PivotTable Tools Options ribbon. The pivot table is automatically populated with the new data!

Change in Excel 2010: Excel 2010 includes a new feature for pivot tables called a slicer. As far as I can tell, this is essentially equivalent, except for the user interface, to a variable placed in the Report Filter area. For example, if you build a pivot table from the data to the right, you can then select to insert a slicer based on

equivalent, except for the user interface, to a variable placed in the Report Filter area. For example, if you build a pivot table from the data to the right, you can then select to insert a slicer based on the Time variable. You will see a new window for this slicer with three buttons: Morning, Afternoon, and Evening. By clicking on any of them (or any combination of them), you are simply filtering the pivot table on these categories. Maybe after some experience, I will see some benefit of a slicer over a variable in the Report Filter area, but I haven't seen it yet.

e, such as My Excel Tutorial.xlsx, and work with the copy. Date 10-Mar 10-Mar 10-Mar 10-Mar 10-Mar 10-Mar 11-Mar 11-Mar 11-Mar 12-Mar 12-Mar 12-Mar 13-Mar 13-Mar 14-Mar 14-Mar 14-Mar 14-Mar 15-Mar 15-Mar 16-Mar 16-Mar 16-Mar 17-Mar 17-Mar 18-Mar 18-Mar 18-Mar 19-Mar 19-Mar 20-Mar 20-Mar 20-Mar 20-Mar 21-Mar 21-Mar 21-Mar 22-Mar 22-Mar 22-Mar 22-Mar 22-Mar 22-Mar 22-Mar Day Mon Mon Mon Mon Mon Mon Tues Tues Tues Wed Wed Wed Thurs Thurs Fri Fri Fri Fri Sat Sat Sun Sun Sun Mon Mon Tues Tues Tues Wed Wed Thurs Thurs Thurs Thurs Fri Fri Fri Sat Sat Sat Sat Sat Sat Sat Time Morning Morning Afternoon Afternoon Afternoon Afternoon Evening Evening Evening Morning Morning Afternoon Morning Afternoon Morning Afternoon Afternoon Afternoon Morning Afternoon Morning Afternoon Evening Afternoon Evening Morning Afternoon Evening Afternoon Afternoon Morning Afternoon Afternoon Evening Morning Afternoon Evening Morning Morning Morning Evening Evening Evening Evening Region West West West NorthEast West NorthEast West South West MidWest NorthEast South NorthEast NorthEast West West South West South South West West West South West NorthEast South MidWest MidWest South West NorthEast NorthEast West West South NorthEast NorthEast MidWest NorthEast West West West West Paid With VISA Mastercard VISA VISA Mastercard VISA Mastercard VISA Cash Mastercard Mastercard VISA VISA Mastercard Mastercard VISA Cash VISA Mastercard Cash VISA VISA Mastercard VISA VISA Mastercard Mastercard Mastercard VISA Cash Mastercard VISA VISA VISA VISA Mastercard VISA Mastercard Mastercard Cash VISA Mastercard Cash VISA Gender Female Female Female Female Male Female Male Male Male Female Female Male Male Male Female Male Female Female Male Male Male Male Female Female Male Female Male Male Male Female Female Male Female Female Female Female Male Female Male Female Male Male Female Male

pical data set in all enue or items sold by

sion has changed er interface for pivot d interface was not ys though pivot ter than ever. In fact, rmation so quickly

here are so many d them, simply ite intuitive. Rather eriment. The e near all of the

t two variables, Items by the categorical

t and click on the u can override if

The new worksheet's t of this worksheet. ck and forth to the new

should see a Pivot d Design) and pivot table tabs are know why.)

s (columns), and the a long explanation,

ag Paid With to the down Total Cost by tal Cost for its

ow sums only for

n Labels dropdown

formatted. To do so, gs. (You will do this he Number Format of Total Cost for the

area and Region to

ank space on the om the pivot table.

h Region and Time in

ows, but the sort (and drag any other hat you get with a at the bottom of the

otTable Tools Options but it updates d the corresponding o see what I mean.

t to summarize it by r which field is in the

the row area, Gender

s say you drag a click on any marize by. (If you do gs dialog box to g to do with the format the counts as

23-Mar 24-Mar 24-Mar 24-Mar 24-Mar 24-Mar 25-Mar 25-Mar 25-Mar 26-Mar 27-Mar 27-Mar 28-Mar 28-Mar 28-Mar 28-Mar 29-Mar 29-Mar 29-Mar 29-Mar 29-Mar 29-Mar 29-Mar 29-Mar 29-Mar 29-Mar 30-Mar 30-Mar 31-Mar 31-Mar 31-Mar 31-Mar 1-Apr 1-Apr 1-Apr 1-Apr 2-Apr 2-Apr 2-Apr 2-Apr 3-Apr 3-Apr 3-Apr 3-Apr 4-Apr 4-Apr 5-Apr

Sun Mon Mon Mon Mon Mon Tues Tues Tues Wed Thurs Thurs Fri Fri Fri Fri Sat Sat Sat Sat Sat Sat Sat Sat Sat Sat Mon Mon Wed Wed Wed Wed Thurs Thurs Thurs Thurs Fri Fri Fri Fri Sat Sat Sat Sat Sun Sun Mon

Afternoon Morning Morning Afternoon Afternoon Afternoon Morning Afternoon Evening Morning Morning Afternoon Morning Afternoon Afternoon Evening Morning Morning Morning Morning Afternoon Afternoon Afternoon Afternoon Evening Evening Afternoon Evening Afternoon Afternoon Evening Evening Morning Afternoon Afternoon Afternoon Morning Afternoon Afternoon Afternoon Morning Afternoon Afternoon Evening Morning Afternoon Morning

MidWest South NorthEast South West South West South West West West West NorthEast South West NorthEast NorthEast NorthEast MidWest NorthEast NorthEast MidWest South MidWest NorthEast South South West South MidWest West NorthEast NorthEast West NorthEast West MidWest MidWest NorthEast NorthEast South South West NorthEast MidWest South NorthEast

VISA Mastercard Mastercard Mastercard Mastercard Cash Mastercard Mastercard Cash VISA Mastercard Cash Mastercard Mastercard Mastercard VISA VISA Cash Mastercard Mastercard Cash Cash VISA VISA Cash VISA Mastercard VISA VISA Mastercard Mastercard Cash Cash Mastercard Cash Mastercard Mastercard Mastercard VISA Mastercard VISA Mastercard VISA Mastercard VISA Cash VISA

Female Female Female Female Female Female Female Female Male Female Female Female Female Female Male Male Female Male Male Female Female Male Female Male Male Female Female Female Female Male Male Male Male Female Female Female Female Female Female Female Female Male Female Male Female Male Male

hould see that there

his, open the Value d select the "% of ll female customers . Now you should ment with these and

ow area, you will get e pivot table will group on the field. to the row area and

e made on some of hat is happening

ee total sales in each

all of the oken down by year,

of from a fixed the table expands hen be refreshed ed to build a new

, such as Table2, ill notice that the nge address. This is ossibly with a e pivot table and click s automatically

tell, this is essentially er area. For example, t a slicer based on

5-Apr 5-Apr 5-Apr 5-Apr 6-Apr 6-Apr 6-Apr 6-Apr 7-Apr 8-Apr 8-Apr 8-Apr 8-Apr 9-Apr 9-Apr 9-Apr 9-Apr 9-Apr 10-Apr 10-Apr 10-Apr 10-Apr 10-Apr 10-Apr 11-Apr 12-Apr 12-Apr 12-Apr 12-Apr 13-Apr 14-Apr 14-Apr 14-Apr 15-Apr 15-Apr 15-Apr 15-Apr 15-Apr 15-Apr 15-Apr 16-Apr 16-Apr 16-Apr 17-Apr 17-Apr 17-Apr 18-Apr

Mon Mon Mon Mon Tues Tues Tues Tues Wed Thurs Thurs Thurs Thurs Fri Fri Fri Fri Fri Sat Sat Sat Sat Sat Sat Sun Tues Tues Tues Tues Wed Fri Fri Fri Sat Sat Sat Sat Sat Sat Sat Sun Sun Sun Mon Mon Mon Tues

Afternoon Afternoon Afternoon Evening Morning Afternoon Afternoon Evening Evening Morning Morning Morning Evening Morning Morning Morning Morning Morning Morning Morning Afternoon Afternoon Evening Evening Afternoon Morning Morning Afternoon Afternoon Afternoon Morning Afternoon Afternoon Morning Morning Morning Afternoon Afternoon Evening Evening Afternoon Afternoon Evening Morning Afternoon Evening Morning

MidWest MidWest NorthEast NorthEast NorthEast NorthEast South MidWest West NorthEast West West MidWest West NorthEast West NorthEast West South MidWest MidWest South NorthEast MidWest West MidWest NorthEast South NorthEast South South MidWest West South MidWest MidWest West NorthEast MidWest West West NorthEast South MidWest West West South

VISA Mastercard Mastercard VISA Cash VISA Mastercard Mastercard VISA VISA Cash Mastercard Cash VISA Mastercard Mastercard Mastercard Cash Mastercard Cash Mastercard Mastercard Cash VISA VISA Mastercard Mastercard Mastercard Mastercard Mastercard Cash Mastercard VISA Cash VISA VISA VISA Cash Cash Mastercard Cash Cash Mastercard VISA VISA Cash VISA

Male Female Female Female Female Female Female Female Male Male Female Female Male Male Male Male Female Male Female Female Male Female Male Male Female Female Female Female Female Female Female Male Female Male Female Female Male Female Female Female Male Female Female Female Female Male Female

er area. For example, t a slicer based on Morning, Afternoon, simply filtering the benefit of a slicer over

18-Apr 18-Apr 19-Apr 19-Apr 19-Apr 20-Apr 20-Apr 20-Apr 21-Apr 21-Apr 21-Apr 21-Apr 22-Apr 22-Apr 22-Apr 23-Apr 23-Apr 24-Apr 24-Apr 24-Apr 24-Apr 24-Apr 24-Apr 25-Apr 25-Apr 26-Apr 26-Apr 26-Apr 27-Apr 27-Apr 27-Apr 28-Apr 28-Apr 28-Apr 28-Apr 29-Apr 29-Apr 29-Apr 29-Apr 29-Apr 29-Apr 29-Apr 30-Apr 30-Apr 30-Apr 1-May 2-May

Tues Tues Wed Wed Wed Thurs Thurs Thurs Fri Fri Fri Fri Sat Sat Sat Sun Sun Mon Mon Mon Mon Mon Mon Tues Tues Wed Wed Wed Thurs Thurs Thurs Fri Fri Fri Fri Sat Sat Sat Sat Sat Sat Sat Sun Sun Sun Mon Tues

Afternoon Evening Morning Afternoon Evening Afternoon Evening Evening Morning Afternoon Afternoon Afternoon Morning Afternoon Evening Morning Afternoon Morning Morning Afternoon Afternoon Evening Evening Morning Evening Morning Morning Afternoon Morning Evening Evening Afternoon Afternoon Evening Evening Morning Morning Afternoon Evening Evening Evening Evening Morning Afternoon Evening Afternoon Evening

NorthEast NorthEast MidWest MidWest NorthEast NorthEast South West West NorthEast NorthEast NorthEast South MidWest NorthEast South South South West NorthEast South South South West NorthEast West South MidWest MidWest South NorthEast West South NorthEast NorthEast NorthEast MidWest West South MidWest MidWest West West South NorthEast NorthEast NorthEast

VISA Mastercard Mastercard Mastercard Mastercard Cash VISA VISA VISA Mastercard Cash VISA Cash Mastercard Mastercard VISA Cash Mastercard Mastercard VISA VISA Cash VISA Mastercard Mastercard VISA Cash Cash VISA VISA Mastercard Mastercard Mastercard VISA VISA VISA Mastercard Mastercard VISA Mastercard Mastercard VISA Mastercard Mastercard Mastercard VISA Cash

Female Male Female Female Male Male Male Male Female Female Female Female Male Female Male Female Female Female Female Female Female Male Female Female Male Female Male Female Female Male Male Female Female Male Female Male Male Male Male Male Female Male Female Female Male Female Male

3-May 3-May 4-May 5-May 5-May 6-May 6-May 6-May 6-May 6-May 6-May 6-May 6-May 6-May 6-May 7-May 7-May 8-May 8-May 8-May 8-May 8-May 8-May 9-May 9-May 9-May 9-May 10-May 10-May 11-May 11-May 12-May 12-May 13-May 13-May 13-May 13-May 14-May 15-May 15-May 15-May 15-May 15-May 15-May 15-May 16-May 16-May

Wed Wed Thurs Fri Fri Sat Sat Sat Sat Sat Sat Sat Sat Sat Sat Sun Sun Mon Mon Mon Mon Mon Mon Tues Tues Tues Tues Wed Wed Thurs Thurs Fri Fri Sat Sat Sat Sat Sun Mon Mon Mon Mon Mon Mon Mon Tues Tues

Afternoon Afternoon Evening Morning Afternoon Morning Morning Morning Morning Morning Afternoon Afternoon Evening Evening Evening Evening Evening Morning Afternoon Evening Evening Evening Evening Morning Afternoon Evening Evening Morning Afternoon Afternoon Evening Morning Evening Morning Afternoon Evening Evening Evening Morning Morning Afternoon Afternoon Afternoon Afternoon Evening Morning Afternoon

West South West NorthEast NorthEast West MidWest West South West MidWest NorthEast NorthEast West West NorthEast MidWest West South South South West West West South West South MidWest MidWest West MidWest West NorthEast South West South NorthEast NorthEast West NorthEast South NorthEast South South West West MidWest

Mastercard VISA VISA VISA VISA VISA Mastercard Cash VISA Mastercard Mastercard Cash Mastercard VISA Mastercard Mastercard Cash VISA VISA Cash Mastercard VISA Mastercard Cash Mastercard VISA Mastercard Mastercard VISA Mastercard Cash Mastercard VISA Cash VISA Mastercard Cash VISA Mastercard VISA VISA Mastercard Mastercard VISA VISA VISA Mastercard

Female Female Female Female Female Female Male Female Female Male Female Female Male Male Female Female Female Female Female Male Male Male Male Male Female Male Female Female Female Female Male Female Male Male Male Female Male Female Female Female Female Female Female Female Male Male Female

16-May 16-May 17-May 17-May 17-May 17-May 18-May 18-May 18-May 19-May 19-May 19-May 19-May 19-May 19-May 19-May 19-May 19-May 19-May 20-May 21-May 21-May 21-May 21-May 22-May 22-May 22-May 22-May 22-May 22-May 23-May 24-May 24-May 24-May 25-May 25-May 25-May 26-May 26-May 26-May 26-May 27-May 27-May 28-May 28-May 29-May 29-May

Tues Tues Thurs Thurs Thurs Thurs Fri Fri Fri Sat Sat Sat Sat Sat Sat Sat Sat Sat Sat Sun Mon Mon Mon Mon Tues Tues Tues Tues Tues Tues Wed Thurs Thurs Thurs Fri Fri Fri Sat Sat Sat Sat Mon Mon Tues Tues Wed Wed

Evening Evening Morning Morning Evening Evening Morning Afternoon Evening Morning Morning Morning Morning Afternoon Afternoon Afternoon Afternoon Afternoon Evening Afternoon Afternoon Afternoon Evening Evening Morning Afternoon Afternoon Afternoon Afternoon Evening Evening Morning Afternoon Afternoon Morning Afternoon Afternoon Morning Afternoon Evening Evening Afternoon Evening Morning Evening Evening Evening

NorthEast South South NorthEast South MidWest South MidWest South MidWest MidWest West South West MidWest South South NorthEast MidWest West West West NorthEast West West South South NorthEast NorthEast West West South West NorthEast South NorthEast West NorthEast MidWest West MidWest South West MidWest South South MidWest

Mastercard Mastercard Mastercard Mastercard VISA Mastercard Mastercard VISA VISA Mastercard Cash Mastercard Mastercard Cash Cash Cash VISA Mastercard Cash Cash VISA VISA VISA Cash Mastercard Cash Mastercard VISA VISA Cash Mastercard VISA Mastercard Cash VISA Mastercard VISA Mastercard Mastercard VISA VISA Mastercard VISA VISA VISA Mastercard Mastercard

Female Male Female Female Male Female Male Male Male Male Female Male Male Female Female Female Female Male Female Female Female Male Male Male Male Female Female Female Female Male Male Female Male Female Female Male Female Male Female Female Male Female Male Female Male Male Male

30-May 30-May 30-May 30-May 31-May 31-May 31-May 31-May 31-May 1-Jun 1-Jun 1-Jun 1-Jun 1-Jun 1-Jun 1-Jun 1-Jun 2-Jun 2-Jun 3-Jun 3-Jun 4-Jun 4-Jun 4-Jun 4-Jun 4-Jun 5-Jun 6-Jun 6-Jun 7-Jun 7-Jun 7-Jun 7-Jun 8-Jun 8-Jun 8-Jun 8-Jun 9-Jun 10-Jun 10-Jun 10-Jun 10-Jun 10-Jun 10-Jun 11-Jun 11-Jun 11-Jun

Thurs Thurs Thurs Thurs Fri Fri Fri Fri Fri Sat Sat Sat Sat Sat Sat Sat Sat Sun Sun Mon Mon Tues Tues Tues Tues Tues Wed Thurs Thurs Fri Fri Fri Fri Sat Sat Sat Sat Sun Mon Mon Mon Mon Mon Mon Tues Tues Tues

Morning Morning Afternoon Evening Morning Morning Morning Afternoon Evening Afternoon Afternoon Afternoon Evening Evening Evening Evening Evening Morning Evening Afternoon Evening Morning Morning Evening Evening Evening Evening Morning Evening Morning Afternoon Afternoon Evening Morning Evening Evening Evening Afternoon Afternoon Afternoon Afternoon Evening Evening Evening Afternoon Afternoon Afternoon

NorthEast West NorthEast South NorthEast MidWest South South NorthEast NorthEast West NorthEast MidWest South NorthEast MidWest South MidWest South NorthEast South NorthEast NorthEast West West West NorthEast NorthEast West West MidWest West NorthEast NorthEast MidWest West NorthEast NorthEast West West NorthEast MidWest West NorthEast MidWest NorthEast MidWest

VISA Mastercard VISA Mastercard Mastercard Mastercard Mastercard VISA VISA Mastercard VISA VISA Mastercard Mastercard Mastercard VISA VISA Cash VISA Cash Mastercard Mastercard Mastercard VISA Cash VISA VISA Mastercard VISA VISA VISA VISA Cash Mastercard Mastercard Cash Mastercard Cash VISA Cash Cash Cash VISA VISA Mastercard VISA Cash

Female Female Female Female Female Female Female Female Male Female Female Male Male Female Male Female Female Female Female Female Female Male Female Female Male Female Male Female Male Female Female Female Male Male Female Male Male Male Female Female Female Male Male Male Female Male Female

11-Jun 11-Jun 12-Jun 12-Jun 12-Jun 12-Jun 13-Jun 13-Jun 13-Jun 14-Jun 14-Jun 14-Jun 14-Jun 14-Jun 15-Jun 15-Jun 15-Jun 15-Jun 15-Jun 16-Jun 17-Jun 17-Jun 18-Jun 18-Jun 19-Jun 19-Jun 19-Jun 20-Jun 21-Jun 21-Jun 21-Jun 21-Jun 21-Jun 21-Jun 21-Jun 22-Jun 22-Jun 22-Jun 22-Jun 23-Jun 23-Jun 23-Jun 23-Jun 23-Jun 23-Jun 23-Jun 24-Jun

Tues Tues Wed Wed Wed Wed Thurs Thurs Thurs Fri Fri Fri Fri Fri Sat Sat Sat Sat Sat Sun Mon Mon Tues Tues Wed Wed Wed Thurs Fri Fri Fri Fri Fri Fri Fri Sat Sat Sat Sat Sun Sun Sun Sun Sun Sun Sun Mon

Evening Evening Morning Evening Evening Evening Morning Morning Afternoon Afternoon Afternoon Afternoon Afternoon Evening Morning Morning Morning Afternoon Afternoon Morning Morning Afternoon Afternoon Evening Evening Evening Evening Morning Morning Morning Afternoon Afternoon Afternoon Evening Evening Morning Morning Afternoon Evening Morning Morning Afternoon Evening Evening Evening Evening Morning

MidWest South South NorthEast West West South MidWest West NorthEast South West MidWest West South West NorthEast NorthEast MidWest MidWest West South NorthEast West South South MidWest West MidWest South West NorthEast West South West West NorthEast NorthEast NorthEast NorthEast South West NorthEast NorthEast West South NorthEast

Mastercard Mastercard Mastercard Cash Mastercard Cash VISA VISA VISA VISA Mastercard Mastercard VISA Mastercard Cash VISA VISA VISA Cash Mastercard VISA VISA Mastercard Mastercard Cash VISA Cash VISA VISA Mastercard Mastercard Mastercard Mastercard Mastercard Cash Mastercard Mastercard VISA VISA Mastercard Cash Mastercard VISA Mastercard Mastercard Mastercard VISA

Male Male Female Male Male Male Male Female Male Female Male Female Male Female Female Male Male Male Female Male Female Female Female Male Female Male Male Female Female Female Male Female Female Male Male Female Male Male Female Male Female Male Male Male Male Male Female

24-Jun 24-Jun 25-Jun 25-Jun 25-Jun 26-Jun 26-Jun 26-Jun 26-Jun 26-Jun 26-Jun 26-Jun 27-Jun 27-Jun 27-Jun 28-Jun 28-Jun 28-Jun 28-Jun 28-Jun 28-Jun 29-Jun 29-Jun 29-Jun 29-Jun 29-Jun 29-Jun

Mon Mon Tues Tues Tues Wed Wed Wed Wed Wed Wed Wed Thurs Thurs Thurs Fri Fri Fri Fri Fri Fri Sat Sat Sat Sat Sat Sat

Afternoon Afternoon Morning Afternoon Afternoon Morning Morning Morning Afternoon Afternoon Afternoon Evening Morning Morning Evening Morning Morning Morning Afternoon Afternoon Afternoon Morning Afternoon Afternoon Afternoon Afternoon Afternoon

MidWest NorthEast NorthEast West South MidWest South South NorthEast West West NorthEast West South West West West MidWest West MidWest NorthEast MidWest NorthEast NorthEast West NorthEast NorthEast

VISA Mastercard Mastercard Cash VISA Mastercard Mastercard Cash VISA Mastercard Mastercard Mastercard VISA Mastercard Cash Cash VISA Mastercard Mastercard Mastercard VISA VISA VISA Cash Mastercard VISA VISA

Female Female Female Female Female Female Female Female Female Female Female Male Female Female Male Female Female Male Female Female Female Male Male Female Male Male Female

Items Ordered 4 1 5 1 4 5 1 4 2 1 2 2 3 1 3 5 6 4 1 1 4 2 9 1 3 5 3 3 1 2 3 4 2 2 7 2 4 2 2 8 4 6 1 2

Total Cost Column1 $136.97 $25.55 $113.95 $6.82 $147.32 $142.15 $18.65 $178.34 $25.83 $18.13 $54.52 $61.93 $147.68 $27.24 $46.18 $107.44 $96.53 $77.44 $15.19 $45.52 $157.05 $51.95 $429.98 $33.37 $71.84 $139.51 $78.46 $125.13 $14.76 $83.38 $104.91 $101.37 $53.16 $40.63 $286.41 $59.39 $185.45 $35.08 $91.62 $155.50 $20.89 $186.29 $42.22 $42.19

1 3 6 1 3 2 2 5 4 2 4 8 1 1 3 2 2 4 3 3 3 2 1 4 4 2 2 2 7 5 6 2 4 9 6 1 3 2 6 3 4 3 2 3 1 3 Low

$47.86 $139.76 $186.42 $54.08 $84.98 $27.13 $54.70 $229.54 $124.21 $26.39 $106.97 $377.18 $24.31 $34.47 $106.19 $55.30 $82.98 $101.79 $99.28 $100.09 $88.91 $62.58 $28.87 $141.29 $66.54 $69.03 $65.51 $35.59 $320.18 $128.57 $248.42 $50.04 $145.48 $403.60 $284.14 $81.14 $82.36 $32.65 $200.70 $99.13 $85.88 $183.52 $53.87 $44.08 $82.34 $151.29 5

$87.02

Low Low Low Low Low Low Medium High Low Low High Low Low Medium Low Low High High Low Low Medium High Low Low High High High High High High Medium Medium High Low Medium Low Medium Low High High High Low Low Low Low High Medium

2 1 3 2 5 2 3 4 1 4 4 2 1 3 3 1 1 4 2 2 2 4 2 2 4 4 5 3 6 7 1 4 6 2 2 3 4 1 6 9 6 6 1 3 2 7 3

$54.96 $65.11 $76.69 $48.38 $76.64 $54.08 $130.00 $218.29 $38.10 $100.02 $248.73 $25.80 $52.83 $131.89 $82.69 $70.03 $102.86 $174.13 $49.80 $29.97 $82.53 $142.76 $72.58 $55.39 $206.39 $245.67 $265.69 $124.46 $206.26 $306.23 $48.12 $113.95 $261.44 $59.90 $49.73 $65.06 $97.71 $49.84 $233.94 $370.26 $313.11 $141.77 $27.99 $81.34 $97.15 $352.49 $88.75

Medium Medium Medium Low Low Medium High Low Medium High Low High Medium Medium High Medium Low High High High High High High Medium High Medium High High High High Medium High Low Low Low Low High Low High Medium Medium Low High High High Medium Medium

4 5 4 2 4 3 3 2 8 9 1 5 4 5 5 2 3 5 8 4 6 4 3 2 5 2 6 4 4 4 3 5 1 2 4 4 3 2 3 1 2 4 4 3 6 3 2

$107.95 $186.22 $159.23 $82.43 $99.42 $79.32 $160.01 $51.99 $267.67 $429.22 $46.20 $240.02 $157.14 $140.40 $204.93 $88.18 $95.47 $224.73 $344.73 $185.32 $297.31 $223.32 $164.40 $123.57 $236.97 $82.75 $307.75 $200.73 $242.06 $215.09 $162.90 $214.31 $42.07 $69.05 $148.90 $105.74 $138.32 $61.71 $120.11 $72.80 $134.86 $89.75 $220.04 $168.39 $277.80 $130.49 $94.39

Low High High Medium Low Low Low Low Low Medium Low Medium Low Low Low Medium Low Low Medium Medium Medium Medium Low High High High Medium High Low High Medium Medium High Low Low High High Low Low Low Low Low High Medium Low Medium Medium

4 6 9 4 2 3 2 3 2 1 2 2 1 3 2 1 1 3 4 3 4 4 2 4 2 10 5 6 1 6 2 2 5 3 1 1 7 3 1 3 1 3 3 3 3 3 2

$120.48 $304.95 $389.79 $161.08 $69.61 $59.99 $120.78 $82.30 $91.88 $87.10 $70.10 $106.67 $34.31 $77.69 $85.31 $65.92 $89.98 $102.07 $199.83 $134.21 $188.41 $102.72 $85.63 $206.87 $141.22 $463.40 $166.54 $260.62 $79.16 $320.40 $79.01 $126.22 $263.45 $135.86 $98.74 $101.05 $361.60 $120.56 $52.68 $99.51 $85.29 $143.59 $197.13 $190.74 $111.44 $153.39 $65.40

High High High High High Low Low High Medium Medium High Medium Low Low Medium High High Low Medium Medium Low Low Medium Medium Low Medium Low High High Low Medium Low Low High Medium High High High High Medium Medium Medium High Medium Medium High Low

9 2 5 7 4 3 2 8 2 3 6 5 2 3 4 4 2 2 8 3 3 2 4 3 4 4 3 7 6 2 4 2 2 5 4 5 7 5 2 3 2 2 9 5 2 4 2

$448.20 $123.19 $210.28 $349.46 $290.63 $103.03 $112.54 $399.36 $68.18 $146.58 $309.50 $177.96 $119.46 $119.66 $168.87 $192.39 $101.73 $74.94 $291.30 $161.00 $116.01 $74.39 $226.25 $135.19 $126.16 $156.30 $73.42 $310.74 $296.26 $115.29 $212.94 $85.93 $80.02 $286.17 $190.27 $265.24 $353.93 $314.77 $169.23 $149.71 $105.35 $111.47 $441.16 $179.56 $83.15 $262.86 $82.51

High Medium Medium Low Medium High Low High Low High High Low Medium Medium Medium Medium Low Low Low Low Low Low Medium High Low Medium Medium Medium Low Low Low Low High High High Low Low Medium Medium High High High Low High Low Low Medium

5 5 3 2 3 5 4 7 2 8 5 1 3 1 9 1 2 2 2 2 3 3 4 3 1 3 6 2 2 2 6 5 7 11 4 2 1 5 4 4 7 4 2 4 3 4 2

$290.27 $223.08 $165.77 $99.81 $158.95 $280.99 $149.89 $363.52 $93.97 $391.97 $275.54 $115.55 $125.00 $103.15 $256.70 $117.99 $98.55 $112.93 $76.30 $129.80 $140.25 $149.79 $172.20 $139.85 $96.46 $127.83 $215.88 $133.49 $117.33 $107.98 $203.11 $193.33 $343.26 $485.01 $221.93 $94.04 $113.37 $188.26 $170.19 $224.15 $352.32 $257.18 $122.06 $239.95 $124.44 $116.58 $154.46

Low Medium High Low High Low Low High Medium Low Low Low Low Low Medium Medium Medium High Low Low High High Low Low Medium Low Low Low Low High Low High Low Low Medium High Low Low High Medium Medium Medium Medium High Low High Low

1 4 6 1 7 2 4 5 7 3 1 1 2 1 1 2 5 10 3 3 7 7 3 2 2 1 1 3 1 2 1 7 3 1 1 5 1 1 6 2 5 6 2 3 4 4 2

$76.92 $194.85 $367.70 $119.50 $270.94 $94.71 $154.01 $313.30 $217.99 $127.22 $135.97 $87.14 $96.77 $74.74 $117.48 $132.89 $230.26 $451.03 $153.31 $117.79 $357.32 $374.17 $122.28 $122.57 $134.59 $134.98 $109.45 $131.52 $88.76 $174.28 $100.70 $387.43 $160.71 $105.91 $101.46 $271.67 $112.74 $96.42 $271.48 $156.79 $249.63 $278.62 $84.46 $221.17 $194.79 $199.22 $141.70

Medium Low Low High High High Low Low Low Medium Low High Medium Medium High Low Medium Medium Medium Medium High Low Medium Medium Medium Medium Low

4 2 3 7 3 4 1 3 1 4 2 8 4 4 7 3 5 2 4 2 4 1 6 3 6 4 1

$191.15 $142.41 $134.53 $374.37 $241.73 $278.58 $106.25 $115.71 $78.34 $216.03 $140.01 $458.51 $210.60 $189.49 $359.42 $132.06 $252.33 $172.05 $206.19 $143.98 $276.67 $111.67 $268.39 $169.11 $242.46 $168.64 $107.59

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Of all the tools available in Excel, conditional formatting is arguably the "coolest." As the name implies, conditional formatting allows you to format cells depending on conditions you specify. The cool part is that the formatting changes automatically if the cell values change. For example, suppose you use conditional formatting to color a cell red if its value is greater than 100. If its current value is 90, it won't be red, but if you change its value to 110, it will turn red automatically. Conditional formatting was available before Excel 2007, but it wasn't very prominent, and most users didn't even know it was available. Now it is very prominent, right in the middle of the Home ribbon. It is also much easier to use. As illustrated below, many uses of conditional formatting are really easy, but a few are tricky.

A typical use of conditional formatting is to color all "high" values one color and all "low" values another color. In the example to the right, suppose you want to color all high scores green and all low scores, where a high score is greater than the value in cell O4 and a low score is less than the value in cell O5. To do so: 1. Highlight all exam scores in column L. 2. Click on the Conditional Formatting dropdown, then on Highlight Cell Rules, and then on Greater Than. 3. In the Greater Than dialog box, enter a cell reference to cell O4 and select a green format of your choice. 4. Repeat steps 2 and 3 in the obvious way for the low values. Try it! Perform the above steps. Then change the values in cells O4 and O5 and watch how the formatting changes automatically. If you want to get rid of the formatting, click on the Conditional Formatting dropdown and then on Clear Rules. If you want to change the formatting rules, click on the Conditional Formatting dropdown and then

As you can see when you click on the Conditional Formatting dropdown, there are a lot of "built choices that are very easy to apply. Try out some of the following: The Highlight Cell rules let you format numbers that satisfy inequalities, as in the example above, and they also let you format text or dates that satisfy natural conditions. The Top/Bottom rules let you format the top (or bottom) x items (or x percent of items), where you can choose x. For example, you can format the maximum number in a list by specifying the top 1 item. The Data Bars, Color Scales, and Icon Sets are amazing (and can be overdone). The point of all of them is to different levels of values, such as salaries or sales values. Try it! Use any interesting formats you like to format the dates, text, or numbers to the right. Remember that you can always modify the formats or clear them.

Try it! Use any interesting formats you like to format the dates, text, or numbers to the right. Remember that you can always modify the formats or clear them.

You can get even more control by building your own rules. You do this by clicking on the Conditional Formatting dropdown and then on New Rule. The resulting dialog box has more options than I can explain here, so I will provide just one example. In the data set to the right, I have entered monthly sales data for 6 regions. Actually, I have entered these as random numbers with the RANDBETWEEN function, so if you press the F9 key, they will all change in a random way. (This makes the example even more impressive!) Suppose we want to color the maximum sales value in each column green. One way is to do it separately for each column, formatting the top 1 item. However, this takes too much time, especially if there were many more columns. Here is a better way. 1. Starting at cell M57, drag to highlight the range M57:R68. 2. Choose New Rule from the Conditional Formatting dropdown, and select the "Use a formula to determine which cells to format" item. 3. In the "Format values where this formula is true:" box, enter the formula =(M57=MAX(M$57:M$68)). Then select a green format of your choice. Try it! Apply the above steps to the sales data. Apply a similar formula to format the minimum value in each column red. Then press the F9 key a few times and watch how the green and red cells bounce around. If you can understand how this formula works, you can do some pretty amazing conditional formatting. Remember that you highlighted the entire sales range, but M57 is the active cell (because you started the dragging from it). The formula as written applies to cell M57. Specifically, if its value is the maximum value in column M, it is formatted green. But because the entire sales range is highlighted, the formula is applied, in a relative sense, to each cell in the range. The the MAX function are made absolute because the maximum is always over these rows.

e, such as My Excel Tutorial.xlsx, and work with the copy. Exam score 62 88 77 62 94 68 73 61 99 94 88 82 87 65 82 70 94 80 96 Person 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Birthdate 8/5/1959 10/15/1977 1/3/1981 5/5/1949 4/4/1987 6/30/1949 5/22/1949 10/30/1952 1/17/1957 9/18/1985 7/19/1953 12/10/1946 3/29/1986 12/12/1952 6/12/1977 11/19/1989 9/6/1957 9/30/1970 10/24/1973 6/8/1978 8/27/1990 2/9/1947 4/1/1989 Cutoffs for extremes High 94 Low 66

t." As the name ons you specify. The For example, than 100. If its n red automatically.

minent, and most middle of the Home nal formatting are

"low" values ores green and all re is less than the

and then on Greater

green format of your

watch how the

pdown and then on

dropdown and then

are a lot of "built-in"

e example above,

of items), where you ecifying the top 1

The point of all of

s to the right.

Gender Male Female Male Male Female Female Female Male Male Female Male Female Female Female Female Male Male Female Male Male Female Male Male

State Indiana Michigan Illinois Wisconsin Michigan Wisconsin Ohio Ohio Illinois Indiana Illinois Michigan Wisconsin Illinois Illinois Ohio Ohio Michigan Illinois Ohio Ohio Illinois Wisconsin

Children 1 2 0 2 3 3 2 1 3 1 1 0 2 2 2 1 0 2 2 0 2 1 0

Salary $65,400 $62,000 $63,200 $52,000 $81,400 $46,300 $49,600 $45,900 $47,700 $59,900 $48,100 $58,100 $56,000 $53,400 $39,000 $61,500 $37,700 $36,700 $45,200 $59,000 $54,300 $62,100 $78,000

s to the right. 24 25 26 27 28 29 30 Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09 Nov-09 Dec-09 3/12/1970 3/28/1970 5/6/1963 5/7/1959 3/6/1987 2/9/1958 8/4/1955 Region1 $2,694 $1,627 $3,370 $2,106 $2,607 $2,682 $3,065 $4,096 $2,105 $3,536 $4,399 $3,437 Male Male Male Male Male Male Female Region2 $2,278 $2,959 $1,592 $1,039 $3,143 $1,769 $4,930 $2,254 $4,925 $4,706 $3,455 $4,186 Ohio Indiana Michigan Ohio Indiana Michigan Indiana Region3 $3,493 $4,580 $2,741 $1,941 $3,597 $4,274 $3,664 $1,183 $3,707 $1,688 $3,156 $1,548 0 1 1 3 2 1 2 Region4 $3,454 $2,035 $3,055 $1,380 $4,104 $4,693 $3,213 $4,347 $4,746 $2,838 $3,511 $2,253 $43,200 $44,500 $43,300 $45,400 $53,900 $44,100 $31,000 Region5 $1,385 $2,206 $3,022 $1,874 $1,906 $4,871 $1,320 $2,267 $3,911 $3,705 $2,111 $2,970 Region6 $3,206 $1,360 $3,284 $3,549 $3,216 $1,214 $3,654 $1,273 $3,470 $1,354 $1,665 $3,459

Conditional e options than I can

ually, I have entered e F9 key, they will all pose we want to ately for each lly if there were

"Use a formula to

t the minimum value n and red cells

g conditional cell ll M57. Specifically, if the entire sales he range. The rows in

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

At some point, you might be developing spreadsheets for others to use, and you might want to force them to use certain values in certain cells because other values wouldn't make sense or wouldn't satisfy business rules. You can do this fairly easily with data validation. There are actually many, many possibilities, but I will illustrate only the most common here. All of the options are found from the Data Validation item on the Data Validation dropdown on the Data ribbon. This leads to a fairly self-explanatory dialog box (see to the right). All of the examples below assume you have selected the cell you want to validate, and they assume that you have opened this dialog box and have chosen the Settings tab. To allow only values between two given values:

Choose Whole Number (if you want only integers) or Decimal in the Allow dropdown, choose Between from the Data dropdown, and enter values in the Min and Max boxes. You can also place cell references in the Min and Max boxes. You can experiment with the other options in the Data dropdown. They are pretty obvious.
You can actually go farther than this. The Data Validation dialog box has two other tabs, Input Message and Error Alert. The first allows you to create a message that the user sees when she is about to enter something in this cell. The second allows you to create a message that the user sees if she enters an incorrect value in the cell. Try it! Force the values in the gray cells in column L to have values indicated by the labels to their right. Add your own input messages and error alerts. Then try entering some appropriate and

Probably the easiest data validation is to allow the user to choose from a dropdown list of values. To do this, first create the list somewhere, usually out of sight to the far right. Then from the Allow dropdown in the Data Validation dialog box, select the List item, and in the Source box, provide a cell reference to the list. When the user selects the cell to be validated, a dropdown arrow will automatically appear, with the values in the list to choose from. Try it! The example to the right lets a user enter an amount to be financed, an annual interest rate, and a term (number of months to pay), and it returns the monthly payment (using the PMT function that has already been entered). Create a list out to the right somewhere that contains the possible terms: 12, 24, 36, 48, and 60, and then create a data validation for the term cell that lets the user choose from these 5 values. Check that it works.

Suppose you want to make sure the person enters a valid date in a cell. This is a great place for a data validation. By choosing the Date option from the Allow dropdown, you can force the user to enter only values that are recognized as dates. This is no small achievement! In addition, you can put limits on the dates. For example, suppose you want the person to enter the date he took out a loan. This must not only be a date, but it can't be in the future. To allow only such dates, you can select "less than or equal to" from the Data dropdown and then enter the following formula in the End date box: =TODAY(). The effect is that the user will not be allowed to enter a future date, regardless of today's date.

future date, regardless of today's date. Try it! Create the date validation just described in cell M39. Then enter incorrect and correct entries to see how it works. (Can you change it so that only dates at least a week ago are allowed? Just change the formula slightly.)

e, such as My Excel Tutorial.xlsx, and work with the copy.

u might want to force sense or wouldn't e actually many, tions are found from This leads to a fairly you have selected g box and have

down, choose . You can also place options in the Data

her tabs, Input sees when she is ge that the user sees

the labels to their ppropriate and

any integer between 1 and 10 any decimal number between 1 and 10 any positive integer any negative decimal number any integer between the values in cells N25 and O25 30 40 Amount financed Interest rate Term Monthy payment $25,000 6.25% #NUM!

own list of values. To n from the Allow rce box, provide a own arrow will

annual interest rate, ing the PMT function ontains the possible that lets the user

a great place for a n force the user to

Date of loan

e person to enter the re. To allow only such enter the following lowed to enter a

ct and correct entries re allowed? Just

cells N25 and O25

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

If you are creating an Excel file for others to use, you probably don't want them to mess up the formulas you entered so carefully. In fact, you might not even want them to be able to see the formulas (company secrets?). Excel gives you plenty of options for protecting (or unprotecting) your work. I will explain a few of them here. You can then experiment with others. The key idea is locking cells. Right-click on any cell on this sheet, select Format Cells, and click on the Protection tab. You will see that the Locked option is checked. By default, all cells are locked until you unlock them. But this locking has no effect until you protect the worksheet (or the workbook). Therefore, protecting is a two-step process. 1. Unlock all cells you want users to have access to. These are typically "input" cells where a user can enter data like unit cost, amount ordered, and so on. 2. Protect the worksheet (or workbook). To do this, select Protect Sheet (or Protect Workbook) from the Review ribbon. For example, when you select Protect Sheet, you see the dialog box to the right. It is clear that you have a lot of options for what you want to allow users to do. For example, with the settings shown, users will be allowed to select locked cells but not modify them. If the "Select locked cells" were unchecked, users wouldn't even be allowed to select locked cells, so any formulas in these cells would be hidden. Note that you can also add a password when you protect a worksheet or workbook. Just be careful to remember it. Otherwise, you won't be able to unprotect (and then modify) your own work!

e, such as My Excel Tutorial.xlsx, and work with the copy.

to mess up the see the or unprotecting) your

Cells, and click on the lls are locked until (or the workbook).

cells where a user can

tect Workbook) from alog box to the right. For example, with hem. If the "Select cells, so any formulas u protect a be able to unprotect

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

I already discussed the COUNT, COUNTA, SUM, and AVERAGE functions, arguably the most frequently used functions in Excel. In this section I discuss some less common functions for counting, summing, and averaging. Although they are less common and are considered more "advanced," they are extremely useful in certain situations. The functions on the next two sheets allow you to count, sum, or average, but only over rows that satisfy certain conditions. They all contain IF in their name, such as COUNTIF and SUMIFS. The last function in this section, SUMPRODUCT, does exactly what its name implies. It is absolutely indispensable in many business models.

e, such as My Excel Tutorial.xlsx, and work with the copy.

ly the most unctions for counting, more "advanced," heets allow you to all contain IF in their DUCT, does exactly

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

There are several Excel functions that allow you to count values, or sum or average values, subject to conditions. Until Excel 2007, this was possible only for a single condition, such as all people younger than 35 years old, and there were only two functions available, COUNTIF and SUMIF. In response to a lot of customer demand, Microsoft added four new functions in Excel 2007: AVERAGEIF (for a single condition), and COUNTIFS, SUMIFS, and AVERAGEIFS (for multiple conditions). These are all very handy functions, and you should definitely learn how to use them.

The COUNTIF function counts all values in a specified range that satisfy a certain condition.

To use the COUNTIF function:


Enter the formula =COUNTIF(criterion_range,condition) in any cell, where condition is any expression that evaluate to TRUE or FALSE. This counts all values in criterion_range that satisfy the condition. The condition can be tricky to specify. If we want a specific value, such as Male, we can specify it easily as "Male" (quotes required), or we can use a cell reference such as R3. Also, if we want a specific inequality, such as younger than 20, we can specify it literally as "<20". But if we want it to be younger than the value in cell R4, then we need to piece it together as a literal part, "<", and a variable part, whatever is in cell R4. The correct syntax is "<"&R4. The ampersand (&) symbol connects the two pieces. For example, if we want to know the number of students who are older than 20, the correct formula is =COUNTIF(M4:M75,">"&R4). Try it! Use COUNTIF in cell R7 to find the number of students who scored at least as high as the value in cell R5. (Scroll to the right for the answer.)

The SUMIF function sums values in one range where a condition in a corresponding range is satisfied. Similarly, the AVERAGEIF function averages values where a condition is satisfied. Usually, the setup is like the example to the right, where we want to sum or average scores in one column (O), but only for rows that satisfy a condition on another column (M or N). To use the SUMIF or AVERAGEIF functions:

Enter the formula =SUMIF(criterion_range,condition,sum_range). This sums all values in sum_range where the corresponding value in criterion_range satisfies the condition. Note that the criterion_range is listed first, and the sum_range is listed last. To average instead of sum, enter the similar formula =AVERAGEIF(criterion_range,condition,average_range).
Try it! Calculate the sum of all scores, and the average of all scores, for the males; for all students who are younger than the cutoff value in cell R4; for all students who are at least as old as the cutoff value in cell R4. Enter these six formulas in the range R9:R14. (Scroll to the right for the answers.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Student 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Gender Male Female Female Female Male Female Female Male Male Male Female Female Female Female Female Male Female Male Male Female Male Female Male Female Female Male Female Male Female Female Female Female Female Female Male Female Male Male Male Male Male Male Female Male Age Exam score 18 62 21 73 18 74 18 18 77 20 57 18 67 19 90 19 77 22 83 20 71 20 75 20 72 24 82 18 68 18 86 24 77 21 68 20 86 21 20 80 18 81 20 84 19 71 18 76 21 81 18 99 20 72 18 78 21 67 21 89 19 70 19 77 18 22 83 19 74 19 87 18 75 20 86 21 77 20 73 20 74 20 79 18 80

age values, subject h as all people TIF and SUMIF. In Excel 2007: or multiple how to use them.

n condition.

is any that satisfy the

we can specify it so, if we want a But if we want it to ral part, "<", and a nd (&) symbol nts who are older

st as high as the

ding range is s satisfied. Usually, res in one column

values in ition. Note that the d of sum, enter the

es; for all students st as old as the cutoff for the answers.)

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

Male Female Male Male Female Female Female Male Male Female Female Female Male Male Female Male Female Male Female Male Male Female Female Female Male Male Male Female

20 21 19 19 23 19 24 19 18 19 21 21 19 19 20 22 19 20 19 19 18 24 18 21 23 24 20 18

77 72 77 71 70 68 79 75 80 73 61 62 68 92 85 77 79 86 83 83 76 89 72 69 66 71 80 61

Gender condition Age cutoff Exam score cutoff # of "high" scores Sum of scores for males Average of scores for males Sum of scores for "young" people Average of scores for "young" people Sum of scores for "old" people Average of scores for "old" people

Male 20 87

6 2660 78.235 2527 76.576 2733 75.917

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The "plural" functions discussed here, COUNTIFS, SUMIFS, and AVERAGEIFS, are recent additions in Excel 2007. They allow you to impose multiple conditions, such as male and younger than the value in cell R4. Their arguments, described in more detail below, include any number of pairs of ranges and criteria, such as M4:M75,"Male". The COUNTIFS function counts the number of rows that satisfy all of the conditions. To use the COUNTIFS function: Enter the function =COUNTIFS(criterion_range1,condition1,criterion_range2,condition2,...), where each criterion_range,condition pair imposes a condition on a particular range (usually a column). The "..." means that any number of conditions can be imposed. Try it! In cell R7, find the number of students with the gender in cell R3 and age younger than the age cutoff in cell R4 who scored less than or equal to the score cutoff in cell R5. (Scroll to the right

The SUMIFS and AVERAGEIFS functions are similar in concept to SUMIF and AVERAGEIF, but their syntax is different. (Microsoft evidently liked this new syntax better than the original, but they didn't want to change SUMIF and AVERAGEIF syntax because it would mess up too many existing spreadsheets.) Now the range to sum or average comes first, and the criteria ranges and conditions come last.

To use the SUMIFS (or AVERAGEIFS) function:


Enter the formula =SUMIFS(sum_range,criterion_range1,condition1,criterion_range2,condition2,...) or =AVERAGEIFS(average_range,criterion_range1,condition1,criterion_range2,condition2,...) Again, the setup is typically like the example to the right. There is a column such as exam score to sum or average. The criteria impose conditions on other columns (or even the same column). Only those rows that meet all of the conditions are part of the sum or average. Try it! In cells R9 and R10, calculate the total of all scores made by the gender in cell R4 and ages younger than the age cutoff in cell R5. (Scroll to the right for the answers.)

Note: According to Excel's online help, when using these functions, if a cell in a criterion range is blank, it is treated as 0. However, this doesn't appear to be true. For example, the second student does not currently satisfy the conditions (too old). Change her age to 0, and you will see the answers change. Then delete her age (make it blank), and the answers will revert back to their original values.

e, such as My Excel Tutorial.xlsx, and work with the copy. Student 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Gender Male Female Female Female Male Female Female Male Male Male Female Female Female Female Female Male Female Male Male Female Male Female Male Female Female Male Female Male Female Female Female Female Female Female Male Female Male Male Male Male Male Male Female Male Age Exam score 18 62 21 73 18 1 18 65 18 77 20 57 18 67 19 90 19 77 22 83 20 71 20 75 20 72 24 82 18 68 18 86 24 77 21 68 20 86 21 89 20 80 18 81 20 84 19 71 18 76 21 81 18 99 20 72 18 78 21 67 21 89 19 70 19 77 18 79 22 83 19 74 19 87 18 75 20 86 21 77 20 73 20 74 20 79 18 80

e recent additions in unger than the value of ranges

,...), where usually a column).

younger than the (Scroll to the right

ERAGEIF, but their riginal, but they didn't any existing anges and conditions

condition2,...).

h as exam score to same column). Only

n cell R4 and ages

criterion range is the second student u will see the answers o their original

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

Male Female Male Male Female Female Female Male Male Female Female Female Male Male Female Male Female Male Female Male Male Female Female Female Male Male Male Female

20 21 19 19 23 19 24 19 18 19 21 21 19 19 20 22 19 20 19 19 18 24 18 21 23 24 20 18

77 72 77 71 70 68 79 75 80 73 61 62 68 92 85 77 79 86 83 83 76 89 72 69 66 71 80 61

Gender condition Age cutoff Exam score cutoff COUNTIFS question SUMIFS question AVERAGEIFS question

Female 20 87

18 1342 70.632

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

There are many times when you need to sum products of values in two (or possibly more than two) same-size ranges. Fortunately, there is a SUMPRODUCT function that sums products quickly. To use the SUMPRODUCT function: Enter the formula =SUMPRODUCT(range1,range2), where range1 and range2 are exactly the same size. For example, they might be two column ranges with 10 cells each, or they might be two ranges with 4 rows and 10 columns each. The formula sums the products of the corresponding values from the two ranges. There can actually be more than two ranges in the SUMPRODUCT formula, separated by commas, as long as all of them have exactly the same size. This is not as common as having only two ranges, but it is sometimes useful. Try it! Sum the products of the two ranges in the example to the right to find the total shipping cost. Enter the result in cell M13. (The answer should be $1,609.50.) By the way, if you are tempted to write the formula without the SUMPRODUCT function as the sum of 9 products, as many of my students continue to do, imagine how long your formula would be if there were 10 plants and 50 cities! The SUMPRODUCT function is extremely efficient, so get used to using it!

e, such as My Excel Tutorial.xlsx, and work with the copy. Unit shipping costs Plant1 Plant2 Plant3 Units shipped Plant1 Plant2 Plant3 Total cost City1 1.25 1.15 1.35 City1 155 250 0 City2 1.35 1.45 1.45 City2 180 130 210 City3 1.55 1.25 1.15 City3 0 185 140

sibly more than two) ducts quickly.

are exactly the same might be two ranges ponding values from

arated by commas, as only two ranges, but

e total shipping cost.

function as the sum ormula would be if icient, so get used to

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Most people use Excel functions to calculate numbers. However, Excel also provides several very useful functions for manipulating text. These can be real time-savers. If you have ever been required to manipulate a list of hundreds of names or any similar mind-numbing task, you know what I mean. This section illustrates some of the most common ways to manipulate text in Excel. The next worksheet describes two handy text functions, TRIM and VALUE. Then the last two worksheets in this section discuss two common text tasks, concatenating and parsing. These are opposites. Concatenating means to put several pieces together, such as forming the name "John Smith" from the two pieces "John" and "Smith". Parsing means to separate text into several pieces, such as starting with the text "Smith, John" and separating it into the first name "John" and the last name "Smith". As you will see, concatenating is relatively easy, whereas parsing is typically more difficult.

e, such as My Excel Tutorial.xlsx, and work with the copy.

vides several very e ever been required u know what I mean.

the last two arsing. These are g the name "John into several pieces, e "John" and the last g is typically more

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Text in a cell sometimes has leading or trailing spaces. For example, you can guess from the alignment that the names to the right all have some leading spaces. (They also have some trailing spaces, although this is not obvious.) This is not necessarily a problem, but sometimes you would like to delete any leading or trailing spaces. Doing this manually could take hours, so luckily there is a function, TRIM, that does it automatically. To use the TRIM function: Enter the formula =TRIM(cell), where cell is a reference to the cell to be trimmed. Try it! In column M, apply the TRIM function to the names in column L. Then copy the formulas in column M and paste them over themselves as values. Now there is no dependence on the names in column L, so move the values in column M to column L, replacing the originals. (This should take about 5 seconds, and it wouldn't take much longer if you started with thousands of names . That's

Have you ever gotten a spreadsheet with a lot of numbers, but the numbers are left justified in their cells, like those to the right? They are probably the result of dumping data from a legacy system into Excel, with the result that the numbers are really text that only look like numbers. The tipoff is that they are left justified; numbers are almost always right justified. Try doing arithmetic on the numbers to the right, such as summing them. It won't work because Excel interprets them as text, and it can't do arithmetic on text. And unfortunately, it does no good to simply right justify them; they are still text. Luckily, there is a very useful function, VALUE, that takes text that looks like a number and makes it a number. To use the VALUE function: Enter the formula =VALUE(cell), where cell is a reference to the cell that contains the text. Try it! Use the VALUE function in column M to transform the text in column L to numbers. Then

e, such as My Excel Tutorial.xlsx, and work with the copy. Bob Jane Justin Lindsay George Sam Christine Tom Jenny Doug

ess from the have some trailing etimes you would rs, so luckily there is

py the formulas in nce on the names in (This should take of names . That's

justified in their a legacy system into rs. The tipoff is that

n't work because ely, it does no good ction, VALUE, that

19 65 36 12 57 93 45

ns the text.

o numbers. Then

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

To concatenate, we start with two or more pieces of text and string them together. For example, we might concatenate Bob and Jones into Bob Jones. There are two equivalent ways to concatenate: with the ampersand (&) symbol and with the CONCATENATE function. Both are described below. To concatenate the text in cells A1 and B1 with the ampersand symbol, enter the formula =A1&B1 cell C1. Literal text can also be included, such as =A1&, &B1. In this case, if A1 contains Jones and B1 contains Bob, then C1 will contain Jones, Bob. This concatenates the last name, a literal comma and space, and the first name. In general, separate the pieces with ampersands, and put literal text in quotes. To concatenate the text in cells A1 and B1 with the CONCATENATE function, enter the formula =CONCATENATE(A1,, ,B1). In words, you enter the pieces you want to concatenate, separated by commas. These pieces can be cell references or literal text. In the latter case, they should be enclosed in double quotes. Try it! Concatenate the first names, middle initials, and last names in columns L, M, and N so that full names of the form Jones, Bob E. appear in column O. You can use the ampersand method or the

e, such as My Excel Tutorial.xlsx, and work with the copy. Bob Stephen Andy John Kathy Karen Tom Peter Ted Jason E C T F C D T F R E Jones Davis Thompson Wilson Fredericks Williams Smith Jennings Benson Samson

ther. For example, valent ways to tion. Both are

he formula =A1&B1 in 1 contains Jones e last name, a literal ersands, and put

ter the formula atenate, separated , they should be

, M, and N so that ersand method or the

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Suppose, for example, that someone has given you a spreadsheet such as the one to the right. Each cell in column L has a persons name: last name, then a comma and a space, and then first name. Your job is to parse (that is, separate) these names as indicated for the name in cells M3 and N3. That is, column M should have all of the first names and column N should have all of the last names. If this sounds easy, imagine that there are 5000 names in column L. What would you do? If you just start typing, you will be at for a long time (and you will undoubtedly make mistakes along the way). Fortunately, there is a much better way. The key is to look for patterns. In this example, note that every name has a comma and a space. The first name comes after the comma and space, and the last name comes before it. For the name "Jones, Bob", there are 10 characters, including the comma and space, and the comma and space are characters 6 and 7. So the first name is the rightmost 3 characters and the last name is the leftmost 5 characters. In any parsing operation, this is the first and probably the most crucial step: find a pattern. Once you find a pattern, you can then exploit it with a number of useful text functions. The ones I will discuss are FIND, LEN, RIGHT, LEFT, and MID. (If you want to learn about other text functions, click on the fx button and search under the Text category.)

To use the FIND function: The FIND function has the syntax =FIND(subtext,text,n), where subtext is a piece of text to be found in text, text is the original text, and n is an optional integer argument. This function returns the position of the first occurrence of subtext, if any. If there are no occurrences, it returns an error. If the argument n is missing, the search starts at character 1; otherwise, it the search starts at character n. Here are a few examples: The formula =FIND(,,Jones, Bob) returns 6, because the comma is the 6th character in Jones, Bob. The formula =FIND(nes,Jones, Bob) returns 3, because the subtext nes begins in the 3rd character of Jones, Bob.

The formula =FIND(o,Jones, Bob) returns 2, because the first occurrence of the letter o occurs in the 2nd character of Jones, Bob. However, the formula =FIND(o, Jones,Bob,3) returns 9, because the first occurrence of o starting from character 3 is character 9.
The formula =FIND(t,Jones, Bob) returns an error, because the letter t isnt found in Jones, Bob. To use the LEN function: Enter the formula =LEN(text). This returns the number of characters in text. To use the RIGHT function:

To use the RIGHT function:

Enter the formula =RIGHT(text, n), where n is an integer. This returns the rightmost n characters in text. (If n is greater than LEN(text), it return the entire text.)
To use the LEFT function: Enter the formula =LEFT(text, n), where n is an integer. This returns the leftmost n characters in text. (If n is greater than LEN(text), it return the entire text.) To use the MID function: Enter the formula =MID(text,s,n), where s is an integer and n is an optional integer. If n is missing, this returns all of text from the sth character on. (s stands for start.) Otherwise, it returns n characters of text, starting with the sth character. Here are some examples of MID: The function =MID(Freddie,5) returns die. The function =MID(Freddie,5,2) returns di. The function =MID(Jones, Bob,FIND(,,Jones, Bob)+2,1) returns B. (See why?) With these five functionsFIND, LEN, RIGHT, LEFT, and MIDyou can do some powerful text

The above name-parsing problem can be solved in a series of steps, as indicated below.

1. In cell M71, find the length of the text in cell L71 with the LEN function. 2. In cell N71, find the position of the comma with the FIND function. 3. In cell O71, add 1 to find the position of the space after the comma. 4. In cell P71, find the first name with the RIGHT function, using the rightmost (10-7) characters. Make sure you use cell references to enable copying down. 5. In cell Q71, find the last name with the LEFT function, using the leftmost (6-1) characters. Again, use cell references to enable copying.
The beauty of this method is that we have to do it only once, in the first row. Then we can copy all of the formulas down for the rest of the names, even if there are thousands of them! Try it! Enter the formulas as indicated by the above steps and copy them down. (Scroll to the right for the correct answers.)

Here is a tougher one. The names to the right either have a middle initial, a first initial, or no initial. See if you can parse these names into four pieces: Last name, Used name, Initial, and Middle initial, where: Used name is the name (first or middle) the person goes by. Initial is the single initial character, if any, or is blank if there is no initial. Middle initial is "Yes" if the initial is a middle initial, "No" if it is a first initial, and blank if there is no initial. As in the previous exercise, you can have other "helper" columns as needed. (Hints: (1) The FIND

As in the previous exercise, you can have other "helper" columns as needed. (Hints: (1) The FIND returns an error if it can't find the requested text. (2) There is an ISERROR function that can check whether a cell contains an error. Scroll to the right for a solution. ) OK, this one is not easy, and it requires some careful planning. But it sure beats typing a long list of hundreds or thousands of names!

e, such as My Excel Tutorial.xlsx, and work with the copy. Jones, Bob Davis, Stephen Thompson, Andy Wilson, John Fredericks, Kathy Williams, Karen Smith, Tom Jennings, Peter Benson, Ted Samson, Jason Bob Jones

ne to the right. Each d then first name. cells M3 and N3. all of the last names. d you do? If you just akes along the way).

example, note that nd space, and the including the comma is the rightmost 3 ion, this is the first

nctions. The ones I her text functions,

ce of text to be found tion returns the returns an error. If arch starts at

haracter in Jones,

egins in the 3rd

the letter o occurs b,3) returns 9,

t found in Jones,

characters in

characters in

is missing, it returns n

powerful text Full name Jones, Bob Davis, Stephen Thompson, Andy Wilson, John Fredericks, Kathy Williams, Karen Smith, Tom Jennings, Peter Benson, Ted Samson, Jason Length Comma Space First name Last name

7) characters.

) characters. Again,

hen we can copy all of

to the right

t initial, or no initial. al, and Middle initial,

d blank if there is no

ints: (1) The FIND

Jones, Bob E. Davis, F. Stephen Thompson, Andy Wilson, John B. Fredericks, Kathy C. Williams, Karen R. Smith, J. Tom Jennings, Peter Benson, Ted C.

ints: (1) The FIND ion that can check

Samson, Jason A.

typing a long list of

Full name Jones, Bob Davis, Stephen Thompson, Andy Wilson, John Fredericks, Kathy Williams, Karen Smith, Tom Jennings, Peter Benson, Ted Samson, Jason

Full name Jones, Bob E. Davis, F. Stephen Thompson, Andy Wilson, John B. Fredericks, Kathy C. Williams, Karen R. Smith, J. Tom Jennings, Peter Benson, Ted C.

Samson, Jason A.

Length 10 14 14 12 17 15 10 15 11 13

Comma 6 6 9 7 11 9 6 9 7 7

Space 7 7 10 8 12 10 7 10 8 8

First name Bob Stephen Andy John Kathy Karen Tom Peter Ted Jason

Last name Jones Davis Thompson Wilson Fredericks Williams Smith Jennings Benson Samson

Length 13 17 14 15 20 18 13 15 14

Comma 6 6 9 7 11 9 6 9 7

Space1 7 7 10 8 12 10 7 10 8

Period Space2 Last name 13 11 Jones 9 10 Davis #VALUE! #VALUE! Thompson 15 13 Wilson 20 18 Fredericks 18 16 Williams 9 10 Smith #VALUE! #VALUE! Jennings 14 12 Benson

Used name Bob Stephen Andy John Kathy Karen Tom Peter Ted

Initial E F B C R J C

16

16

14 Samson

Jason

Middle initial Yes No Yes Yes Yes No Yes

Yes

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

We tend to take dates and times for granted, but they appear in many, if not most, real-world business spreadsheets. They can actually be quite tricky to work with, and a complete treatment of dates and times could fill a long chapter of a book. I cant hope to cover all of the intricacies of Excel based dates and times in this tutorial, but I will illustrate some of the most useful methods for working with them. The first thing to realize is that a date-time value that appears in a cell as something like 3/14/2004 4:30 PM is really stored as a number. Excel refers to this number as the serial value. The serial value corresponding to this particular date-time happens to be 38060.688. The value to the left of the decimal is the number of days since a base date (January 1, 1900), and the decimal part indicates the fraction of time through the day, starting right after midnight. In this example 4:30 PM is 68.8% of the way from midnight to the next midnight. If the decimal part is omitted, then it is assumed to be midnight. In this case, you usually format the value so that only the date, not the time, appears. If you happen to know the numbering system for dates (that is, you somehow know that 38060 corresponds to 3/14/2004), you could enter the number 38060 in a cell and then format it to look like a date. However, you usually enter a date like 3/14/2004 in a cell. In fact, there are several formats Excel recognizes as dates, including 3/14/2004, March 14, 2004, 3-14-04, and a few others, but underneath the hood, they are all stored as 38060. The same goes for date-times, such as 3/14/2004 4:30 PM, or just times, such as 4:30 PM. If you enter either of these in a format that Excel recognizes as a date-time or just a time, Excel will recognize that these are date-times or times, but it will store them as numbers (68030.688 or 0.688). By the way, if you enter a date-time in a format that Excel doesnt recognize, you are entirely out of luck. It will simply be stored as a label, with no inherent date-time meaning. And Excel can be fussy. For example, it doesnt understand 3/14/2004 4:30PM, simply because there is no space between 4:30 and PM! (I wish I were kidding, but Im not.) On the other hand, Excel is smart about dates. It will recognize that 9/31/1999 and 2/29/2003 are not datesregardless of how they are formatted. Try it! The cells to the right include some date-times, dates (no times specified), and times (no dates specified), formatted in several allowable ways. Format these as numbers with 3 decimals to see the serial values. Then reformat them as date-times (in any formats you prefer).

e, such as My Excel Tutorial.xlsx, and work with the copy. 3/14/04 1:30 PM 12/31/1901 3:50 12:00 PM 29-Feb-96 9/24/46 14:45

world mplete treatment of he intricacies of Excelul methods for

hing like 3/14/2004 . The serial value to the left of the cimal part indicates ple 4:30 PM is 68.8% hen it is assumed to t the time, appears.

now that 38060 it to look here are several 4, and a few others,

s 4:30 PM. If you me, Excel will (68030.688 or

ou are entirely out of And Excel can be here is no space Excel is smart about s of how they are

, and times (no dates 3 decimals to see the

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Do you remember the Y2K problem that worried everyone in late 1999? The problem was that a large number of dates, in all kinds of systems, listed 2-digit years, such as 85 instead of 1985. How would systems know whether 05 meant 1905 or 2005? Fortunately, the predicted disaster didnt happen, but there is still a Y2K problem because of the ambiguity 2-digit years can create. Excel handles it, at least for now, by interpreting a 2-digit year less than 30 as being in the 21st century, and all others as being in the 20th century. For example, it interprets 3/14/17 as March 14, 2017 and 5/20/72 as May 20, 1972. Of course, the easiest way to avoid the ambiguity is to use 4-digit years whenever you enter dates. This is the lesson of Y2K! Try it! Enter a date to the right such as 3/14/29 (the last two digits less than 30). Then enter another date such as 5/20/30 (the last two digits greater than or equal to 30). Watch how Excel transforms the year automatically. Do you see how this could be a problem if you really meant 3/14/29 to be the birthday of a person born in 1929?

e, such as My Excel Tutorial.xlsx, and work with the copy.

oblem was that a tead of 1985. How ed disaster didnt can create. Excel century, March 14, 2017 and digit years

. Then enter another w Excel transforms eant 3/14/29 to be

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Excel has two useful functions for automatically entering the current date, or the current date and time , TODAY and NOW. To use the TODAY function: Enter the formula =TODAY() in any blank cell. (The blank parentheses are necessary.) It returns the current date. If you open this spreadsheet tomorrow, it will list tomorrows date, that is, it will update each day. To use the NOW function: Enter the formula =NOW() in any blank cell. (Again, the blank parentheses are necessary.) It returns the current date and time. Try it! Enter the TODAY and NOW functions in column M. Then format result of NOW as time only no date. After you have worked a few other exercises below, come back to this spreadsheet and see whether the time has changed. (You might have to force a recalculation to see the change. You can do this by pressing the F9 key.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Today's date Current time

he current date and

ssary.) It returns the e, that is, it will

necessary.) It returns

NOW as time only spreadsheet and see the change. You can

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

If a cell contains a date, it is easy to strip off the year, month, day, and even weekday with the YEAR, MONTH, DAY, and WEEKDAY functions. In all of the following examples, datecell refers to a cell that contains a date. To use the YEAR function: Enter the formula =YEAR(datecell). This returns a 4-digit year such as 1993. To use the MONTH function: Enter the formula =MONTH(datecell). This returns a month from 1 (January) to 12 (December). If you want to get the name of the month, such as June, use a VLOOKUP function, as indicated in the following exercise. To use the DAY function: Enter the formula =DAY(datecell). This returns the day of the month, from 1 to the number of days in the month. To use the WEEKDAY function: Enter the formula =WEEKDAY(datecell). This returns a number from 1 to 7, where 1 refers to Sunday, 2 to Monday, and so on. If you want to get the name of the day, such as Thursday, use a VLOOKUP function, as indicated in the following exercise. Try it! For each date in column L, return the year, month number, month name, day, weekday number, and weekday name in columns M-R. For the month and weekday names, use the lookup tables supplied. Do you recognize these infamous dates? Try one more: your own birthdate.

e, such as My Excel Tutorial.xlsx, and work with the copy. Date 9/11/2001 1/28/1986 11/22/1963 8/6/1945 12/7/1941 4/14/1912 Year Month number Month name Day

ekday with the YEAR, refers to a cell that

12 (December). If , as indicated in the Lookup table - months 1 January 2 February 3 March 4 April 5 May 6 June 7 July 8 August 9 September 10 October 11 November 12 December Lookup table - days 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 Saturday

the number of days

ere 1 refers to s Thursday, use a

, day, weekday es, use the lookup own birthdate.

Weekday number

Weekday name

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Because dates are stored as numbers, it is possible to perform arithmetic on them. Subtraction makes special sense. If you subtract one date from another, you find the number of days between them. You can do this by simple subtraction of cells, or you can have more control with the DATEDIF function. If you use simple subtraction, you automatically get the difference in days. For example, the formula =A1-A2, where A1 contains 11/25/2004 and A2 contains 11/20/2004, returns 5. The DATEDIF function provides more options. (Evidently, DATEDIF has been in Excel for years, but its documentation in online help has been sporadic. See the interesting article at http://www.cpearson.com/excel/datedif.htm.) To use the DATEDIF function: Enter the formula =DATEDIF(earlierdate,laterdate,interval), where interval can be y, m, d, or a few other options not covered here. If interval is y (quotes required), this returns the number of years between the two dates. Similarly, if interval is m or d, it returns the number of months or number of days between the two dates. Try it! Use simple subtraction of cells to find the number of days between the two dates to the right. Then use DATEDIF with the three options described above to get the number of days, months, and years between the two dates. (Scroll to the right for the answers.) Note: When you do date subtraction, you sometimes need to reformat the answer as an integer. For some odd reason, Excel sometimes formats it as a date.

e, such as My Excel Tutorial.xlsx, and work with the copy. Dates of last two physical exams First exam Next exam Days (subtraction) Days (DATEDIF) Months (DATEDIF) Years (DATEDIF) 4/5/1999 7/15/2003

em. Subtraction between

h the DATEDIF . For example, 04, returns 5.

Excel for years, but its

n be y, m, d, or turns the number of umber of months or

wo dates to the right. f days, months, and

wer as an integer. For

1562 1562 51 4

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The last two date functions I will discuss are DATE and DATEVALUE. Each can be extremely useful. To use the DATE function: Enter the formula =DATE(year,month,day), where year is a 4-digit year, month is a number from 1 to 12, and day is a day from 1 to the number of days in the month. This function can be very useful for manipulating dates. For example, it can be used to "calculate" your next birthday, given your birthdate, as we show to the right. The formula in cell M4 is a long one, but it is just simple logic. This person's next birthday will certainly be on July 22. The only question is whether it will be in the current year or the next year. The IF function checks for this. Note that YEAR(TODAY()) returns the year corresponding to today.

Try it! Enter your birthdate in cell L17 and then calculate your current age in cell L18. (Scroll to the right for the answer.)

The DATEVALUE function can be a real life-saver. It takes a date stored as text and returns the corresponding serial value, which you can then format as a date. Why is this important? Suppose you have a lot of data stored in some type of legacy system in your business, and you are somehow able to dump it into Excel. The chances are that all dates will be imported as text. That is, a cell value will look something like 5/20/2001, but Excel wont recognize it as a date. Without the DATEVALUE function, you would have to retype all of the dates! However, DATEVALUE saves you this mind-numbing work. To use the DATEVALUE function: Enter the formula =DATEVALUE(datetext), where datetext refers to a date stored as text. Then format the result as a date. Try it! Create dates in column M corresponding to the text values in column L that happen to look like dates. (I typed an apostrophe in front of each value in column L. Thats why they are interpreted

e, such as My Excel Tutorial.xlsx, and work with the copy. Birthdate 7/22/1976 Next birthday 7/22/2012

e extremely useful.

is a number from 1

used to "calculate" n cell M4 is a long ly 22. The only n checks for this.

ll L18. (Scroll to the

Birthdate

Age

and returns the portant? Suppose nd you are somehow text. That is, a cell . Without the EVALUE saves you

Dates imported from a legacy system Nov 25, 1997 Nov 26, 1997 Nov 29, 1997 Dec 1, 1997 Dec 3, 1997

ed as text. Then

hat happen to look y they are interpreted

Birthdate 6/24/1956

Age 55

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

There are many statistical functions built into Excel. I have already discussed the simplest statistical function, the AVERAGE function. (Statisticians often call this the mean, or the sample mean, but it is simply the average of a set of numbers. And there is no Excel function named MEAN.) In this section I will discuss a few other statistical functions. Actually, there are many more. To see the possibilities, click on the fx button and look at the Statistical category.

e, such as My Excel Tutorial.xlsx, and work with the copy.

e simplest statistical ample mean, but it is

many more. To see

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The median is the middle value in a set of n numbers, in the sense that half are above it and half are below it. More precisely, when the values are sorted in increasing order, it is the middle value if n is odd, and it is the average of the two middle values if n is even. Fortunately, Excel takes care of the details with the MEDIAN function. To use the MEDIAN function: Enter the formula =MEDIAN(datarange), where datarange is any range that contains a set of values. Note that if datarange contains labels or blank cells, these are ignored when calculating the median. This is true for the other statistical functions. (Of course, it is also true for the AVERAGE function.) Try it! Find the median of the data in column L. Does it equal the average? Why or why not?

We often like to rank the values in a data set in some way. For example, if you take the SAT exam to get into college, you essentially learn your ranking by a percentile. If you are at the 85th percentile, you know that 85% of all people scored lower than you, and only 15% scored higher. Excel has two useful functions for finding this type of information: PERCENTILE and QUARTILE. The QUARTILE function is probably the easiest to understand. Imagine that you have 1000 scores. You sort them from low to high and then divide them into 4 sets of 250 scores each, where the first set contains the smallest scores, the second set contains the next smallest scores, and so on. The 1st, 2nd, and 3rd quartiles are the breakpoints between these sets. For example, 25% of the scores are below the 1st quartile, and 75% are above it. By definition, the 2nd quartile is the median. To use the QUARTILE function: Enter the formula =QUARTILE(datarange,k), where k is 1, 2, or 3. For example, if you enter 3 for you get the 3rd quartile. Try it! Find all three quartiles, Q1, Q2, and Q3, for the data in column L.

The PERCENTILE function takes any percentage, expressed as a decimal number, and returns the value such that the given percentage of all values is below this value. For example, if we use the percentage 10% (0.10) and the PERCENTILE function returns 45, we know that 10% of all values in the data set are below 45 and 90% are above it.
To use the PERCENTILE function: Enter the formula =PERCENTILE(datarange,pct), where pct is any percentage expressed as a decimal, such as 0.10 for 10%. Try it! Find the requested percentiles for the data in column L. For example, P10 indicates the 10th percentile. Do you see the relationship between the quartiles and certain percentiles?

percentile. Do you see the relationship between the quartiles and certain percentiles?

Note that the QUARTILE and PERCENTILE functions are typically used on data sets with a large number of observations. If they are used on a very small data set, you might be surprised at the results. In fact, you might even disagree with them. For example, if the data set has the 5 values 10, 20, 30, 40, and 50, Excels PERCENTILE function indicates that the 10th percentile is 14. This is certainly not a very intuitive answer, and you might disagree with it, but we question why anyone would want the 10th percentile of a 5-value data set in the first place!

e, such as My Excel Tutorial.xlsx, and work with the copy. 33 3 0 1 4 14 5 41 3 5 9 1 0 22 10 5 13 7 6 3 9 5 14 7 27 10 7 3 11 15 35 9 0 5 6 11 13 4 17 3 19 4 5 1 21 Average Median Quartiles Q1 Q2 Q3 Percentiles P01 P05 P10 P25 P50 P75 P90 P95 P99

re above it and half s the middle value if Excel takes care of

ntains a set of values.

culating the median. VERAGE function.) or why not?

ake the SAT exam to percentile, gher. Excel has two

have 1000 scores. each, where the first es, and so on. The e, 25% of the scores is the median.

if you enter 3 for k,

r, and returns the ple, if we use the 10% of all values in

xpressed as a

0 indicates the 10th

ets with a large surprised at the has the 5 values 10, e is 14. This is estion why anyone

4 16 6 18 18 2 3 17 7 9 6 4 2 7 3 0 14 2 4 24 12 1 4 36 3 0 2 4 12 7 2 1 16 5 31 15 29 12 5 4 5 22 14 7 7 19 38

15 45 1 4 14 3 16 4

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Excel has a number of other statistical functions, including those for measuring the amount of variability in a set of numbers. The most widely used measures of variability are variance and standard deviation, and Excel implements these with the VAR and STDEV functions. (These functions calculate the sample variance and standard deviation. There are similar functions, VARP and STDEVP, for calculating the population variance and standard deviation. For large data sets 100 values, saythe sample and population measures are practically the same.) The variance is essentially the average of the squared deviations from the mean, and the standard deviation is the square root of the variance. Each measures variability, but standard deviation is easier to understand because it is expressed in the same units as the datadollars, for example. In addition, many data sets have the property that about 68% of the data are within 1 standard deviation of the mean, about 95% are within 2 standard deviations of the mean, and virtually all of the data are within 3 standard deviations of the mean. (These rules of thumb typically hold when the distribution of values follows a symmetric, bell-shaped curve, that is, the normal distribution.) To use the VAR function: Enter the formula =VAR(datarange). This is equivalent to =(STDEV(datarange))^2, the square of the standard deviation. To use the STDEV function: Enter the formula =STDEV(datarange). This is equivalent to =SQRT(VAR(datarange)), the square root of the variance. Try it! Find the mean, variance, and standard deviation of the data in column L. Then use COUNTIF to find the percentage of values that are within 1 standard deviation of the mean. Is it about 68%? (Scroll to the right to see the answers.)

e, such as My Excel Tutorial.xlsx, and work with the copy. 1034.44 877.35 794.42 828.45 765.9 1088.95 786.05 1523.02 920.48 777.23 1247.63 1117.87 1157.3 641.35 520.49 586.68 952.22 878.36 1582.12 807.99 913.13 1051.65 628.44 651.86 843.55 1233.37 1036.55 543.17 866.31 883.25 1285.68 650.44 1412.4 1105.44 671.55 1077.21 1471.87 1362.55 1044.37 601.52 1256.48 1069.69 407.54 1609.11 1141.03
Mean

the amount of and ons. (These functions ns, VARP and ge data setsover

Variance Standard deviation

n, and the standard dard deviation is lars, for example. In in 1 standard , and virtually all of pically hold when ormal distribution.)

^2, the square of the

)), the square

Then use COUNTIF an. Is it about 68%?

972.54 851.91 1324.67 1061.09 809.91 655.81 1224.02 1105.52 1102.63 342.62 642.01 762.48 945.73 1431.55 695.66 871.12 827.21 1468.62 863.17 582.4 919.07 1314.83 1418.85 909.82 1086.11 620.14 668.74 598.66 1175.09 1139 1369.23 618.31 693.67 1341.85 1479.33 477.41 962.29 686.64 1495.96 1101.87 1018.6 1027.43 921.99 868.49 856.14 724.87 1345.72

1127.91 1467.66 918.88 997.56 965.11 1059.32 1157.35 1116.73 1410.39 786.62 1477.32 1328.5 753.26 905.17 821.06 1052.57 926.89 579.01 873.54 1100.79 727.32 718.17 948.09 866.89 684.5 1391.63 678.82 961.36 1023.22 851.44 1247.63 1373.37 1177.79 929.79 690.18 736.95 1293.14 1134.24 1316.3 1440.09 1249.47 787.9 1320.84 1263.38 1212.95 1081.63 1214.14

1367.41 1579.93 1405.68 965.25 1081.01 713.61 1033.28 999.4 361.42 721.3 1052.62 1094.3 937.92 1217.14 225.9 707.88 856.16 949.8 1510.56 1234.83 1147.42 820.95 1049.69 915.41 862.87 1017.05 763.08 978.67 1357.03 1279.62 1361.16 952.66 523.33 1375.14 545.6 847.12 1464.07 1113.21 1292.26 634.98 651.65 602.12 1367.6 891.63 1197.37 1355.34 904.44

1638.89 1325.24 892.26 1553.37 697.54 1127.03 854.27 810.98 902.46 623.26 952.45 853.4 1029.52 1172.72

Mean

Variance St Dev
Mean - Stdev Mean + Stdev Pct with 1 stdev of mean

999.77 83102.38 288.27 711.50 # less 1288.05 # greater 36 40 62%

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

If we have two columns of data that are matched in a particular way, such as sales of two company products in a given month, then we often like to see how they are related. If one is unusually large, does the other tend to be unusually large? Unusually small? The statistical measure for this is correlation, and it can be calculated with the CORREL function. A correlation is a number between and +1. If the correlation is positive, the two sets of numbers tend to go together. If one is small, the other tends to be small; if one is large, the other tends to be large. Exactly the opposite is true if the correlation is negative. In this case, the two sets of numbers tend to go in opposite directions. The magnitude of the correlation indicates the strength of the relationship between the two sets of numbers. There is a strong relationship (positve or negative) if the correlation is close to -1 or +1. The relationship is much weaker, or nonexistent, if the correlation is close to 0. To calculate a correlation between two sets of numbers: Enter the formula =CORREL(range1,range2), where range1 and range2 contain the two sets of numbers. Try it! The data to the right represent monthly sales of three products. Calculate the correlations in column R indicated by the labels in column Q. (Scroll to the right for the answers.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Month Jan-03 Feb-03 Mar-03 Apr-03 May-03 Jun-03 Jul-03 Aug-03 Sep-03 Oct-03 Nov-03 Dec-03 Jan-04 Feb-04 Mar-04 Apr-04 May-04 Jun-04 Jul-04 Aug-04 Sep-04 Oct-04 Nov-04 Dec-04 Jan-05 Feb-05 Mar-05 Apr-05 May-05 Jun-05 Jul-05 Aug-05 Sep-05 Oct-05 Nov-05 Dec-05 Jan-06 Feb-06 Mar-06 Apr-06 May-06 Jun-06 Jul-06 Aug-06 Sales1 800 1360 1150 940 740 1090 780 910 990 800 1200 1150 880 870 870 760 1010 820 1140 730 1150 690 1210 1080 1420 1230 1170 1140 560 910 1260 1050 1020 760 710 1000 940 1270 1370 1050 1110 1170 990 1040 Sales2 1750 2970 2370 2010 1690 2590 1640 2100 1620 1790 2320 2090 2170 1640 1980 1360 2110 1740 2040 1940 2000 890 2480 2050 2840 2490 2330 2540 1750 2490 2930 2500 2240 1630 1380 2000 2200 2510 2610 2180 2590 2160 2020 1870 Sales3 640 280 230 410 290 460 760 840 760 710 690 640 530 640 560 980 880 570 650 600 540 1130 600 660 330 710 610 840 1010 950 150 390 440 420 880 660 630 510 560 620 470 580 480 300 Correlations Sales1 vs Sales2 Sales1 vs Sales3 Sales2 vs Sales3

les of two company e is unusually large, sure for this is a number between -1 er. If one is small, the opposite is true if the site directions. The n the two sets of -1 or +1.

the two sets of

e the correlations in

Sep-06 Oct-06 Nov-06 Dec-06 Jan-07 Feb-07 Mar-07 Apr-07 May-07 Jun-07 Jul-07 Aug-07 Sep-07 Oct-07 Nov-07 Dec-07 Jan-08 Feb-08 Mar-08 Apr-08 May-08 Jun-08 Jul-08 Aug-08 Sep-08 Oct-08 Nov-08 Dec-08 Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09

1350 820 860 1190 910 950 820 770 810 1370 940 1020 930 1110 1230 1080 890 970 920 1000 1250 1280 790 940 1140 1020 1060 1130 1050 1380 770 860 1130 1350 920

2590 1440 1870 2640 1980 2290 1850 1710 1480 2820 2360 1940 1900 2520 2320 2240 1840 1940 2510 2360 2400 2490 1760 2000 2570 2760 1680 2000 2270 2350 1410 2410 1980 2960 2320

540 520 620 460 590 510 550 610 720 770 540 420 800 660 610 990 530 520 480 370 380 640 450 290 460 370 560 60 710 660 800 360 700 300 380

0.776112 -0.31274 -0.41242

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Suppose we want to rank a set of values from 1 to N, where N is the number of values. We can do this with Excel's RANK function. We can rank them from highest to lowest or vice versa. To use the RANK function: Enter the formula =RANK(value,datarange, order), where value is a single value in the datarange and order is an optional argument. If order is 0 (or missing), rank 1 corresponds to the largest value and rank N to the smallest; if order is 1 (or any other nonzero value), rank 1 corresponds to the smallest value and rank N to the largest. Typically, we start with a data set in a column. Then we use the RANK function to rank the first value and copy it down (with datarange absolute) to rank all of the others. If two or more values are tied, they share a rank. Try it! Rank the values in column L from largest to smallest in column M. Then rank them from smallest to largest in column N. How does RANK deal with the tied 55s? (Scroll to the right for answers.)

The LARGE and SMALL functions are less well-known Excel functions, but they can be useful. Lets say we have a data set with 250 values and we want the 10 largest values. Then we can find these with the LARGE function, using arguments 1 through 10. Similarly, we can use the SMALL function to find the 10 smallest values. To use the LARGE function: Enter the formula =LARGE(datarange,k), where k is any integer from 1 to the number of data values. This returns the kth largest value. To use the SMALL function: Enter the formula =SMALL(datarange,k), where k is any integer from 1 to the number of data values. This returns the kth smallest value. Typically, we would enter a sequence of values of k in some column, enter the LARGE or SMALL formula for the first of them, and then copy down. Try it! For the data set in column L, find the 10 largest values and 10 smallest values in columns O and P. Use cell references to the values of k in column N. (Scroll to the right for the answers.)

e, such as My Excel Tutorial.xlsx, and work with the copy. 55 66 76 34 55 68 75 44 38 58

values. We can do

datarange, to the largest value responds to the

to rank the first value more values are tied,

ank them from to the right for

can be useful. Lets n we can find these he SMALL function to

umber of data

umber of data

LARGE or SMALL

alues in columns O the answers.)

679.02 1208.42 1635.72 729.63 1036.08 716.62 972.92 1175.68 1271.38 1048.93 718.89 1282.89 960.55 1356.75 1257.66 902.38 1648.23 1111.56 750.54 1001.74 742.81 707.50 1080.94 1290.85 1115.66 1005.36 1243.57

1 2 3 4 5 6 7 8 9 10

1454.84 1491.96 991.85 1345.71 1098.38 584.24 1209.50 1416.73 530.54 1171.91 1354.49 989.32 788.77 1264.69 1594.35 1274.46 1023.20 1377.79 1090.11 963.47 623.22 591.33 1060.24 669.80 1260.54 1019.52 819.22 602.14 714.58 996.73 698.22 1116.06 851.37 1223.55 963.66 1114.35 1473.56 755.30 833.30 670.82 859.38 1109.96 1614.91 1035.87 927.74 681.50 953.19

1296.71 379.17 773.67 1235.87 1442.20 1332.61 1314.41 1102.07 894.25 949.84 899.89 842.80 737.26 853.25 1699.23 1084.52 753.02 1004.51 550.14 995.72 1284.55 1217.77 1527.33 937.32 523.64 672.17 1131.39 1283.45 822.97 1364.57 512.38 774.36 1105.61 946.32 730.95 759.13 1119.85 1139.42 1090.73 1446.34 866.76 800.82 1290.49 1477.84 977.47 1101.76 1101.66

1071.95 846.98 1222.82 1277.73 1129.76 1320.94 762.96 1145.85 985.63 664.06 808.46 808.69 1433.58 933.24 1059.90 1172.61 1334.85 752.82 1025.82 798.93 590.03 1362.43 581.92 921.59 1166.95 690.62 1472.74 931.17 1525.45 323.69 1388.36 668.07 1377.30 1374.89 968.95 637.91 592.42 1202.37 1188.52 1031.24 1004.71 1451.57 972.33 1172.22 828.66 914.55 543.38

489.87 988.93 1331.98 1211.72 999.51 963.75 1188.93 517.26 1234.76 953.21 1384.28 1059.93 1041.80 964.87 488.53 1398.93 1046.12 913.83 485.68 1335.03 1373.34 1208.25 1100.58 1051.50 1092.98 1166.45 941.87 1053.52 1095.11 1847.97 546.79 843.64 1306.94 1120.74 1289.04 1192.82 1132.86 1597.10 1078.35 1528.90 972.01 1206.63 1202.84 704.03 962.18 1252.00 1196.82

1279.00 757.50 846.49 855.45 561.13 1300.36 901.77 1015.09 1096.84 644.72 1372.65 579.08 647.23 478.23 1151.76 961.65 1241.79 1076.72 774.44 1149.76 846.46 927.77 1337.16 790.40 807.10 1201.21 1330.02 1100.30 1317.75 1080.59 1400.72 865.18 1383.26 997.08 380.33

6 4 1 10 6 3 2 8 9 5

4 7 10 1 4 8 9 3 2 6

1847.97 1699.23 1648.23 1635.72 1614.91 1597.1 1594.35 1528.9 1527.33 1525.45

323.69 379.17 380.33 478.23 485.68 488.53 489.87 512.38 517.26 523.64

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Excel has a wide assortment of financial functions that are used by thousands of financial analysts every day. I will illustrate only a few of the most common of these. If you are going to be a financial analyst, you will undoubtedly want to become familiar with the others. The best way to learn is to click on the fx button and scan through the Financial category.

e, such as My Excel Tutorial.xlsx, and work with the copy.

f financial analysts oing to be a financial t way to learn is to

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The PMT function is usually used to find the monthly payment for a car loan or a home mortgage loan. The inputs are typically an annual interest rate, a term (number of months financed), and the amount borrowed (the principal). The PMT function finds the amount you have to pay each month of the term. Part of this payment is principal and part is interest. At the end of the term, you will have paid just enough to pay off the entire loan. To use the PMT function: Enter the formula =PMT(interestrate,term,principal). For technical reasons, if you want PMT to return a positive value, you should enter the principal as a negative number (because it is a cash outflow, not a cash inflow). The interest rate argument should be the monthly rate (assuming you are paying monthly), which is the annual rate divided by 12. Try it! Suppose you take out a $30,000 loan for a new car when the annual interest rate is 6.75% and the term of the loan is 36 months. Calculate your monthly payment in cell M6. Then use a data table (the perfect place for one!) to see how your monthly payment varies for terms of 24, 36, 48, or 60 months. (Scroll to the right to see the answers.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Principal Annual interest Term Payment $30,000 6.75% 36 Data table for payment versus term

a home mortgage s financed), and the to pay each month he term, you will

ou want PMT to cause it is a cash ate (assuming you

rest rate is 6.75% and Then use a data table of 24, 36, 48, or 60

Payment

$922.89

Data table for payment versus term Term Payment $922.89 24 $1,339.78 36 $922.89 48 $714.91 60 $590.50

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Much of the theory of finance is about the time value of money. Basically, a dollar earned in the future is less valuable than a dollar earned today because the dollar earned today can earn interest. To account for this, we discount future cash inflows or outflows to get their present values now. If we have a future stream of cash inflows and/or outflows, then the sum of all of their present values is called the net present value, usually abbreviated NPV. If this stream is incurred at regular time intervals end of each year, saythen we can use Excels handy NPV function to calculate the NPV of the stream. To use the NPV function: Enter the formula =NPV(rate,cashstream). Here, rate is the discount rate, which is essentially the rate the company believes it can earn on its money, and cashstream is a stream of cash inflows or outflows that occur at the ends of successive years, starting at the end of year 1. Note that if there is a cash inflow or outflow right away, at the beginning of year 1, it should be entered outside the NPV function. The reason is that it doesnt need to be discounted. Try it! Assume a company pays $100,000 at the beginning of year 1 to get into an investment. It then receives the cash inflows at the ends of years 1 through 5 shown to the right. What is the NPV of this investment (inflows minus outflows) with a 12% discount rate? Does the NPV increase or decrease as the discount rate increases? (Scroll to the right to see the answer.)

If a company incurs cash inflows or outflows at irregular times, such as January 15, then May 30, then July 1, and so on, the NPV function cannot be used. You could go back to your finance book to see how to discount future payments directly, but it is easier to use the little-known XNPV function. This function is actually part of the Analysis ToolPak that ships with Excel. However, you might not have it loaded. To check, click on the Office button, then Excel Options, then Add-Ins, and then Go. If the Analysis ToolPak item isnt checked, check it (see to the right, where your list of add-ins is probably different from mine). Then you can use the XNPV function. To use the XNPV function: Enter the formula =XNPV(discountrate,cashvalues,dates), where discountrate is the same as with NPV, cashvalues is a stream of cash values, and dates is a stream of the dates when they are incurred. Typically, the first cash value will be an outflow and the rest will be inflows. In this case, the initial outflow (investment) should be included in the XNPV function, and the NPV will be discounted back to the date of this initial payment. This payment should be entered as a negative number. Try it! First make sure the Analysis ToolPak is loaded. Then find the net present value of the stream of cash inflows shown to the right, where the first is really a payment at the beginning of 2009. (Scroll to the right to see the answer.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Discount rate Initial payment 12% $100,000

lar earned in the future earn interest. To now. If we have sent values is called the time intervalsat the the NPV of the stream.

Cash inflows at ends of years Year 1 Inflow $20,000 NPV

2 $35,000

3 $50,000

4 $45,000

5 $35,000

h is essentially the rate ash inflows or outflows

r 1, it should be entered

an investment. It then What is the NPV of this ncrease or decrease as

15, then May 30, then inance book to see how PV function. This you might not have it and then Go. If the is probably

Discount rate

12%

Stream of cash flows Date 1-Jan-09 25-May-09 15-Sep-09 15-Jan-10 30-Jun-10 Cash ($85,000) $22,500 $31,000 $65,500 $55,000 NPV

is the same as with NPV, hey are incurred.

his case, the initial l be discounted back to

value of the stream of ning of 2009. (Scroll to

NPV

$29,806

NPV

$69,805

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

Companies often have investment opportunities where they pay initially and then get returns in the future. It is easy to show that the NPV of such an investment decreases as the discount rate increases. In fact, for large enough discount rates, the NPV will typically become negative, meaning that the future returns are not enough to offset the initial cost. The discount rate at which NPV changes from positive to negative is called the internal rate of return, or IRR. Specifically, the IRR is the discount rate at which NPV equals 0. Companies are interested in IRR for the following reason. Typically, they have a "hurdle rate" that they use to discount potential investments. If the NPV of an investment is positive, discounted at the hurdle rate, it is worth pursuing. If it is negative, it is not worth pursuing. Stated equivalently, the investment is worth pursuing only if its IRR is greater than the companys hurdle rate. Fortunately, Excel has an IRR function that calculates an investments IRR. Otherwise, this would be a difficult calculation. As with the NPV function, we assume the investment is structured so that there is an initial cash payment at the beginning of year 1 and then regular cash returns at the ends of years 1, 2, and so on. To use the IRR function: Enter the formula =IRR(cashstream,rateguess), where cashstream is a stream of cash flows, where the first (the initial payment) should be negative, and rateguess is an initial guess for the IRR. This seems strange. Why should you have to guess at the answer? It is because Excel calculates the IRR iteratively, starting with your guess. Your actual guess shouldnt make any difference in the final answer except in unusual cases. Try it! Find the IRR for the following investment, using an initial guess of 15%. What does this IRR say about the attractiveness of the investment? (Scroll to the right to see the answer.) By the way, I mentioned that there is an XNPV function (in the Analysis Toolpak) for cash flows that don't occur on regularly spaced dates. There is also an XIRR function. Look it up!

e, such as My Excel Tutorial.xlsx, and work with the copy. Cash flows (initial value is a payment) ($100,000) $35,000 $45,000 $40,000 IRR

en get returns in the iscount rate e negative, meaning te at which NPV ecifically, the IRR is

$25,000

$10,000

"hurdle rate" that ive, discounted at the d equivalently, the

rwise, this would be a uctured so that there ns at the ends of

of cash flows, where ss for the IRR.

Excel calculates the difference in the final

What does this IRR say

) for cash flows that

IRR

19.81%

The company will find this investment attractive only if its hurdle rate is below 19.81%.

ment attractive only

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

I have heard an Excel expert make the claim that the VLOOKUP function, discussed earlier, is the most useful Excel function of all. Whether or not you believe this claim, the VLOOKUP and HLOOKUP functions are just two of some very useful lookup and reference functions in Excels arsenal. If you click on the fx button for online help on Excel functions, you will see a Lookup and Reference category of functions that includes VLOOKUP, HLOOKUP, and several others. I will illustrate a few of these others here, specifically INDEX, MATCH, and OFFSET. Although they are arguably not as useful as VLOOKUP, they can definitely come in handy in certain situations.

e, such as My Excel Tutorial.xlsx, and work with the copy.

sed earlier, is the OOKUP and HLOOKUP cels arsenal. If you nd Reference will illustrate a few of rguably not as useful

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The INDEX function is useful for finding the value in a particular cell of a rectangular range. You access this value by the indexes of the cell you want. Specifically, you specify a row index and a column index. For example, if the range has 10 rows and 20 columns, the index 4,8 indicates the 4th row and 8th column of the range. To use the INDEX function: Enter the formula =INDEX(range,r_index,c_index), where r_index is an integer (for row) and is an integer (for column). For example, the formula =INDEX(D11:F20,4,2) refers to the value in cell E14, the cell in the 4th row and 2nd column of the range. If range is a single-column range, then the c_index argument can be omitted. In that case, =INDEX(range,r_index) returns the value in row r_index of the range. For example, the formula =INDEX(A11:A20,3) refers to the value in cell A13, the 3rd cell in the range. Similarly, if range is a single-row range, only c_index needs to be included. For example, the formula =INDEX(B10:E10,3) refers to the value in cell D10, the 3rd cell in the range. Try it! Find the unit shipping cost from Plant2 to City3 with a formula in cell M8. Then enter a formula in cell M12 that finds the unit shipping cost from the plant to the city specified in cells M10 and M11. This formula should respond appropriately to whatever plant and city indexes are entered

e, such as My Excel Tutorial.xlsx, and work with the copy. Unit shipping costs Plant1 Plant2 Plant3 Unit shipping from Plant2 to City3 Plant City Unit shipping cost 1 2 City1 1.25 1.15 1.35 City2 1.35 1.45 1.45 City3 1.55 1.25 1.15

gular range. You row index and a 4,8 indicates the 4th

(for row) and c_index

he cell in the 4th row

that case, ple, the formula

example, the formula

. Then enter a pecified in cells M10 y indexes are entered

1.25

1.35

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The MATCH function is handy for finding a cell in a range that matches a given value. It is often used in the following situation. Suppose you have decision variable such as order quantity that needs to be chosen to maximize profit. You enter some formulas that link order quantity to profit. Then you create a data table that finds the profit for a number of possible order quantities. The MATCH function lets you locate the cell in the data table with the largest profit. To use the MATCH function: Enter the formula =MATCH(value,range,0). This returns the index of the cell in range that matches value. For example, if the match occurs in the 3rd cell of the range, this returns 3. The last argument, 0, indicates that we want an exact match. If there is no exact match, the formula returns an error. The MATCH function can also look for an inexact match by using a +1 or -1 for the 3rd argument. You can look up the details in online help. The example to the right indicates how MATCH can be used in conjunction with INDEX. Imagine that a profit model has led to the table shown, where each order quantity listed leads to the corresponding profit. For this small example, it is obvious that the largest profit is $5,640, which corresponds to an order quantity of 300. However, if inputs (not shown) that drive the profit model change, the best order quantity and the corresponding profit could change. We want formulas in cells M11 and M12 to show the best profit and best order quantity regardless of where they appear in the table. The formula in cell M12 is =INDEX(L5:L9,MATCH(M11,M5:M9,0)). The whole purpose of the MATCH function here is to provide the row index for the INDEX function. That is, we know the best order quantity is one of the values in the range L5:L9, and we need to know which one. So we find a match for the maximum profit to the profits in M5:M9. In this case, the maximum is the 3rd profit, so the formula is equivalent to =INDEX(L5:L9,3).

Try it! The table to the right shows the profit for each order quantity (along the side) and each unit stockout cost (along the top). Enter formulas in the range M39:P39 to find the best order quantity for each unit stockout cost. (Scroll to the right to see the answer.)

e, such as My Excel Tutorial.xlsx, and work with the copy. Table of profit versus order quantity Order quantity Profit 200 $5,325 250 $5,430 300 $5,640 350 $5,565 400 $5,235 Best profit Best order quantity $5,640 300

value. It is often used antity that needs to to profit. Then you es. The MATCH

that matches

t match, the formula ng a +1 or -1 for the

INDEX. Imagine that

is $5,640, which ive the profit model want formulas in f where they appear

urpose of the MATCH ow the best order e. So we find a match he 3rd profit, so the

and each unit best order quantity

Profit for various order quantities (column L) and unit stockout costs (row 32) $2 $3 $4 $5 200 $5,235 $5,175 $5,025 $4,935 250 $5,465 $5,285 $5,190 $5,085 300 $5,355 $5,325 $5,265 $5,100 350 $5,215 $5,195 $5,130 $5,125 400 $5,145 $5,085 $5,015 $5,005 Best order quantities

250

300

300

350

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

The OFFSET function allows us to reference a range (or single cell) relative to another cell. It is hard to appreciate unless you see some examples, so I will present some below. To use the OFFSET function: Enter the formula =OFFSET(cell,r_offset,c_offset,height,width). Here, r_offset and c_offset are integers that can be positive, negative, or zero, and height and width are optional positive integers. If either height and width are missing, they default to 1. This formula returns a reference to a range that has as many rows as height and as many columns as width. To find its upper left cell, start at cell, move r_offset rows down (if positive) or up (if negative), and move c_offset columns to the right (if positive) or the left (if negative). For example the formula =OFFSET(A1,2,3,4,1) returns a reference to the range D3:D6. It is a range with 4 rows and 1 column, and its upper left cell, D3, is offset from cell A1 by going 2 rows down and 3 columns to the right. As another example, the formula =OFFSET(F4,0,-3) refers to a single cell (because the last two

A good example of the OFFSET function appears in the example to the right. A company sells to a retailer, and the retailer pays a certain number of months later, as indicated by the payment delay (in months) in cell M20. The sales occur as indicated in row 23, but the receipts from the retailer occur 2 months later, as indicated in row 24. Without the OFFSET function, we could simply put links in the Receipts row that point to sales 2 months earlier. For example, the formula for receipts in January would be =N23. But what if the retailer decides to delay payments by 3 months instead of 2? Then we would need to fix the links in the Receipts row. However, a clever use of OFFSET avoids this updating of links. We use the formula =OFFSET(P6,0,-$M$20) in cell P24 for January and then copy it across row 24 for the other months. This formula says to start in the January sales cell and go a certain number of cells to the left (because of the minus sign), where this number is specified in cell M20. To see how it works, try

Try it! Suppose that a manufacturing company buys raw materials from a supplier. If the cost in any month is $x, the company pays 40% of this cost 1 month from now and the other 60% 2 months from now. Use the OFFSET function to calculate the payments made in January through August, based on the costs through July. These calculated payments should change automatically if you change the inputs in cells M33, M34, O33, and O34. For example, make sure your formulas react correctly if you enter 2 and 3 in cells O33 and O34. (Scroll to the right to see the answer.)

Another great use of the OFFSET function is to create a dynamic range name, one that expands or contracts depending on the number of data values in a range. Consider the example to the right, where monthly sales values are entered in column M, and the total of all sales values is calculated in cell P41. Every month, an extra sales value and its month label are appended to the list in columns L and M. We can make the formula in cell P41 automatically adjust to the appended values by using a dynamic range name. To do this, I selected the Define Name dropdown in the Formulas ribbon. In the Name box at the top

To do this, I selected the Define Name dropdown in the Formulas ribbon. In the Name box at the top of the resulting dialog box, I entered Sales as the range name. In the Refers To box at the bottom, I entered the formula =OFFSET($M$42,0,0,COUNTA($M:$M)-COUNTA($M$1:$M$41),1). Then I clicked on OK. Finally, I entered the formula =SUM(Sales) in cell P41. Note that COUNTA($M:$M) refers to the count of all nonblank cells in column M, and COUNTA($M$1:$M$41) refers to all the nonblank in column M above the first sales figure. So the difference is the number of sales values in column M. Therefore, this OFFSET function refers to a range that starts in cell M42 and has as many rows as there are sales values in column M. To see how it adjusts, enter a sales value for June in cell M47 and watch how the total changes automatically. Again, that COUNTA($M:$M) counts all of the nonblank values in column M, so if there were some other numbers down below sales, they would mess up the logic in the OFFSET function. For example, suppose there were a numeric value in cell M200. Then the fourth argument in the OFFSET function would return 6, not 5, so at that point, the Sales range name would refer to the range M42:M47, that is, 6 cells starting with M42. The moral is that if you want to use dynamic range names, you have to be careful about junk in the affected columns or rows.

Try it! The data way out to the right has sales by month and by salesperson. We want to sum sales over all months and salespeople in cell AL65. Create a dynamic range name that updates when new months are added and when salesperson columns are added or deleted. Then use this range name to sum sales in cell AL65. (Scroll across to see answer. Note that I placed this example way out to the right so that no "junk" from the previous examples on this worksheet would be above it.)

e, such as My Excel Tutorial.xlsx, and work with the copy.

nother cell. It is hard

c_offset are nal positive integers. reference to a range er left cell, start at columns to the right

D3:D6. It is a range oing 2 rows down and

se the last two

ompany sells to a the payment delay from the retailer

Payment delay Month Sales Receipts

2 Oct 3200 Nov 4600 Dec 5500 Jan 2500 4600 Feb 3300 5500 Mar 4200 2500

t point to sales 2 3. But what if the eed to fix the links in We use the formula r the other months. ells to the left how it works, try Percent paid 40% 60% Oct $1,950 when: 1 month from now 2 months from now Dec $4,150 Jan $2,500 Feb $3,350 Mar $2,850

ier. If the cost in any er 60% 2 months through August, omatically if you ur formulas react

Month Cost Payment

Nov $2,900

ne that expands or mple to the right, values is calculated in o the list in columns L ded values by using a

Month Jan-09 Feb-09 Mar-09 Apr-09 May-09

Sales $2,450 $3,140 $3,250 $4,510 $3,680

Total

$17,030

Name box at the top

Name box at the top box at the bottom, I . Then I COUNTA($M:$M) 41) refers to all the ber of sales values in M42 and has as many value for June in cell

if there were some unction. For gument in the OFFSET fer to the range e dynamic range

e want to sum sales t updates when new use this range name ample way out to the

Apr 2900 3300

May 4500 4200

Jun 2750 2900

Jul 4500

Aug 2750

Apr $3,550

May $1,850

Jun $4,200

Jul $2,300

Aug

Jan $3,400

Feb $3,490

Mar $2,840

Apr $3,150

May $3,130

Jun $2,870

Jul $2,790

Aug $3,440

Total sales

Total sales Jan-05 Feb-05 Mar-05 Apr-05 May-05 Jun-05 Jul-05 Smith $6,700 $5,800 $5,000 $6,700 $9,400 $6,200 $8,700 Jones $7,400 $8,900 $7,900 $5,800 $7,800 $5,800 $5,300 Wilson $5,800 $5,500 $5,900 $6,000 $6,700 $9,400 $6,900 Donalds $9,000 $7,900 $8,300 $9,700 $8,400 $8,500 $7,500

Answer: Open the name manager and look at the definition of the Sales1 range name.

Return to table of contents

Save this file under another name, such as My Excel Tutorial.xlsx, a

If you want even more power in Excel, you can automate just about any task with a macro. Macros are written in the programming language for Excel and the rest of Office, Visual Basic for Applications (VBA). VBA is a relatively easy programming language to learn, but it does take some study and a lot of practice. (If you are interested, check out my VBA for Modelers book at http://www.kelley.iu.edu/albrightbooks.) Even if you know nothing about programming, you can still record macros to perform some simple tasks. You can then create buttons to run these macros and place them on the QAT so that they are always available to you. There are several things you should know before you start working with macros: 1. There is a Developer tab and ribbon you should make visible (see to the right). This has various buttons for working with macros. To make it visible, click on the Office button and then Excel Options. Under the Popular group, check the third option: Show Developer tab in the Ribbon. Once you check this option, the Developer tab will always be visible. 2. Files in Excel 2007 that contain macros must have the .xlsm extension ("m" for macro). If you try to save such a file as a regular .xlsx file, you won't be allowed to do so. 3. There is a special file, Personal.xlsb, that you will probably want to record your macros to. This file opens automatically as a hidden file whenever you open Excel. Therefore, all of its macros are always available, regardless of what other Excel files are open. 4. If you want to write your own macros, or if you want to look at recorded macros, you should go to the VB Editor. You can do this from the Visual Basic button on the Developer tab, or more easily, with the Alt-F11 keyboard shortcut. Try it now. Press Alt-F11. This opens a new window. When you are finished looking around, you can close this window. Excel will still be open.

Now let's record a macro and then try it out. This will be a very simple macro that formats the selected cell(s) as integers, that is, as Number with zero decimals. 1. Make the Developer ribbon visible (see above), if necessary. Highlight any range such as the numbers to the right in column L, and click on the Record Macro button on the Developer ribbon. This turns the recorder on. It will record everything you do until you turn the recorder off.

2. When you click on the Record Macro button, you will see the dialog box to the right. Fill it out as shown and click on OK. You can give it a meaningful name (no spaces), and you can specify where it should be stored. I have specified the Personal Macro Workbook, which is the same as the Personal.xlsb file mentioned above. This will make the macro available at all times.
3. Now perform the task you want to record. In this case, format the selected range as Number with zero decimals. 4. From the Developer ribbon, click on the Stop Recording button. 5. Although this is not necessary, if you want to see the recorded mcaro, press Alt-F11 and look at the module(s) under Personal on the left side of the VB Editor. (Modules are where macros are stored.) Even if you know nothing about programming or VBA, the recorded code probably makes

the module(s) under Personal on the left side of the VB Editor. (Modules are where macros are stored.) Even if you know nothing about programming or VBA, the recorded code probably makes sense. With some experience, you can modify this code to suit your exact needs. For now, though, you can leave it as is; it works fine. 6. Now you have a nice macro, but you need a button to run it. To create such a button, click on the dropdown arrow next to the QAT, and then on More Commands to bring up the Customize dialog box. Under the "Choose commands from" dropdown, choose Macros. Select your IntegerFormat macro, and click on the Add>> button to create a button for it on the QAT. The button will have a generic icon, but if you click on the Modify button, you can choose a more meaningful icon. 7. Now that you have a nice button on your QAT, try it out. Select the above two numeric cells in column N and click on your button. They should be reformatted. Note that I asked you to select a range before recording the macro. The reason is that the macro will then apply to whatever range is selected. If you began recording and then selected a range such as L30:L32, your macro would apply only to this specific range.

e, such as My Excel Tutorial.xlsx, and work with the copy.

th a macro. Macros it does take some book at

rform some simple QAT so that they are tart working with

). This has various nd then Excel in the Ribbon. Once

or macro). If you try

ur macros to. This file its macros are

cros, you should go to b, or more easily, window. When you

at formats the

2.0001 30.9999 -3.0002

50.0001 0.9999

nge such as the Developer ribbon. corder off.

he right. Fill it out as can specify where it ame as the

ange as Number with

F11 and look at here macros are de probably makes

here macros are de probably makes s. For now, though,

a button, click on the e Customize dialog ur IntegerFormat button will have a ningful icon.

o numeric cells in

is that the macro will ted a range such as

Vous aimerez peut-être aussi