my excel tutorial.xlsx

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

Upload: arijit-chakraborty

Post on 16-Jan-2016

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Introduction Basic Excel functionsChanges in Excel 2007

Tabs and ribbonsOffice buttonQuick Access Toolbar (QAT)Excel OptionsFile extensionsRight-clicking

Basic Spreadsheet Tasks ChartsDocumenting with cell comments and text boxesMoving to the top of the sheetUndoing actionsUsing End-arrow key combinations HyperlinksSplitting the screen Goal SeekSelecting a range Data tablesSelecting multiple rangesCopying and pastingCopying and pasting special TablesCutting and pasting Pivot tablesInserting, deleting, hiding, unhiding rows or columns Conditional formattingManipulating worksheets Data validationSorting Protecting worksheets and workbooksFilling a series Common counting, summing, and averaging functionsGo To optionsAbsolute and relative addressesShowing formulas in R1C1 notationAuditing formulas Working with textSummation buttonTransposing a rangeRange namesPrinting

Page 2: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Basic Excel functions Working with datesfx button (function wizard) Y2K problemSUM and AVERAGE functions NOW and TODAY functionsCOUNT, COUNTA, and COUNTBLANK functions YEAR, MONTH, DAY, and WEEKDAY functionsMAX and MIN functions DATEDIF functionIF function DATE and DATEVALUE functionsVLOOKUP and HLOOKUP functions Statistical functionsCommon math functions MEDIAN, PERCENTILE, and QUARTILE functions

Charts STDEV and VAR functionsCreating a chart CORREL and COVAR functionsLocating a chart RANK, LARGE, and SMALL functionsModifying a chart Financial functions

Hyperlinks PMT functionGoal Seek NPV and XNPV functionsData tables IRR function

One-way data tables Reference functionsTwo-way data tables INDEX function

Tables MATCH functionPivot tables OFFSET functionConditional formatting Recording a macroData validationProtecting worksheets and workbooksCommon counting, summing, and averaging functions

COUNTIF, SUMIF, and AVERAGEIF functionsCOUNTIFS, SUMIFS, and AVERAGEIFS functionsSUMPRODUCT function

Working with textTRIM and VALUE functionsConcatenating textParsing text with common text functions

Click on any of the hyperlinks below to learn about a topic.

Page 3: My Excel Tutorial.xlsx

YEAR, MONTH, DAY, and WEEKDAY functions

MEDIAN, PERCENTILE, and QUARTILE functions

Page 4: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 file–RIGHT NOW–as 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!

Page 5: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 file–RIGHT NOW–as 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!

Page 6: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 it’s available. Read the next few worksheets for other significant changes.

Page 7: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 it’s available. Read the next few worksheets for other significant changes.

Page 8: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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. Each 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 can’t find something, but you can be assured that they are more logically organized than the old versions.

You can’t change the new ribbons; they are built in and fixed. Well, that isn't quite true. If you don’t 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-s to 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.

Page 9: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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. Each 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 can’t find something, but you can be assured that they are more logically organized than the old versions.

You can’t change the new ribbons; they are built in and fixed. Well, that isn't quite true. If you don’t 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-s to 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.

Page 10: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 11: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.)

Page 12: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

Although you can’t 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.

Page 13: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Although you can’t 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.

Page 14: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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. You 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.

Page 15: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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. You 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.

Page 16: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Return to table of contents

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 won’t 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 a 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.

Page 17: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 won’t 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 a 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.

Page 18: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Return to table of contents

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 mini-toolbar when 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.

Page 19: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Month SalesJan-09 3108Feb-09 3993Mar-09 1644Apr-09 3078

May-09 1830Jun-09 3279Jul-09 3413

Aug-09 1197

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?

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09

Jul/09

Aug/09

0

1000

2000

3000

4000

Sales

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 mini-toolbar when 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.

Page 20: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 on—you might just pick up a few new tricks.

Page 21: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 on—you might just pick up a few new tricks.

Page 22: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 23: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Sales15.314.7

9.612.114.2

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.

Page 24: My Excel Tutorial.xlsx
Page 25: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

Page 26: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Page 27: My Excel Tutorial.xlsx

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).

Page 28: My Excel Tutorial.xlsx

Down in the midst of the worksheet

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).

Page 29: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 30: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

46 3646 425 1726 3942 47

1 491 9

13 1414 14

9 4619 3421 3246 10

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.

Page 31: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 aren’t any nonblank cells in that direction, it takes you to the far edge of the sheet.) If you start in a blank cell, it takes you to the first nonblank cell.

Try it! Move around the range to the right, where there are some blank cells.

Page 32: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

8 1 1 15 5 7 6

10 5 3 1010 10 5 9

5 4 3 47 4 5 12 8 9 10

8 1 1 15 5 7 6

10 5 3 1010 10 5 9

5 4 3 47 4 5 12 8 9 10

8 1 15 5 7

10 5 3 1010 10 9

4 3 47 4 5 12 9 10

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 aren’t any nonblank cells in that direction, it takes you to the far edge of the sheet.) If you start in a blank cell, it takes you to the first nonblank cell.

Try it! Move around the range to the right, where there are some blank cells.

Page 33: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 34: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

61 91 84 8 3 62 11 33 8395 8 14 68 33 23 13 12 333 93 80 5 60 30 13 34 2349 47 37 41 56 38 46 50 10010 65 46 42 52 90 37 31 5614 69 15 73 11 75 77 36 6621 80 46 93 35 95 35 95 27

8 74 24 77 9 92 46 28 10094 33 56 88 51 73 22 39 9384 17 60 87 32 46 100 61 8362 79 43 80 11 9 24 52 2216 29 76 6 90 32 40 62 9493 54 2 11 82 33 18 31 42

6 39 52 66 33 2 23 49 8728 91 57 78 29 82 24 88 4566 28 57 51 87 44 99 18 3256 100 36 48 46 60 71 33 30

3 34 87 45 45 76 85 86 2833 13 50 83 53 20 83 13 734 55 3 9 67 99 25 33 9380 45 89 83 23 31 12 14 2753 96 54 41 100 1 28 21 2977 57 38 52 44 94 46 72 5064 86 26 30 35 69 52 28 4839 28 43 41 27 86 76 44 1275 97 99 71 66 63 42 63 1558 14 66 95 35 18 41 32 2956 58 57 81 48 63 27 54 97

5 99 11 59 7 8 84 56 7680 67 47 99 77 50 42 90 92

6 22 30 3 40 19 67 32 5752 100 67 91 27 59 11 72 1283 32 19 90 44 22 100 11 18

8 51 93 30 28 55 97 60 4655 21 30 49 5 26 1 16 8651 88 93 61 96 88 59 68 4439 97 37 14 25 17 44 69 9250 80 41 96 76 49 43 27 7342 73 4 25 21 30 74 44 6848 60 26 34 87 79 62 96 3954 12 31 66 87 68 48 34 4615 63 54 42 15 32 73 11 9128 41 18 72 18 36 54 96 328 15 100 28 4 9 94 43 5699 3 52 27 39 60 4 18 6324 32 55 62 100 30 82 17 79

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.

Page 35: My Excel Tutorial.xlsx

19 28 46 73 83 78 96 39 3221 31 14 78 87 14 49 85 7530 76 53 91 46 94 2 64 3493 98 84 86 97 9 98 94 4432 54 80 51 59 62 6 8 2935 32 25 34 37 83 51 54 4582 86 46 28 54 56 26 57 323 94 71 95 56 37 97 84 759 62 88 21 2 57 19 66 6517 19 95 63 4 99 93 50 100

4 62 36 55 37 49 11 62 767 58 54 91 39 76 25 22 5517 41 21 18 24 6 65 10 8371 8 45 90 1 34 11 60 2148 41 36 7 69 54 5 9 4629 97 30 76 59 85 39 96 3058 15 37 56 25 71 3 78 8364 66 57 26 39 63 17 46 7614 48 78 6 72 26 1 84 2667 56 76 7 97 89 44 99 1990 97 41 63 79 20 90 95 8783 17 24 75 31 11 98 72 9121 32 27 46 59 22 82 12 6514 27 3 62 48 39 43 8 8138 87 57 5 39 100 56 61 564 15 57 23 94 63 96 6 5410 24 39 52 80 100 28 88 2153 10 66 31 7 99 48 21 8579 70 94 39 66 37 7 78 5790 19 84 3 4 48 34 91 4160 59 36 83 90 42 45 17 6467 9 71 3 84 2 95 44 6722 53 52 45 50 20 39 23 6880 17 94 59 82 93 50 47 6786 16 44 67 60 14 38 99 5741 46 51 42 50 52 38 16 49

8 66 13 63 76 23 58 1 7058 52 88 11 35 21 57 6 14

9 10 80 57 97 49 89 1 521 23 18 11 83 7 50 96 364 79 96 60 21 49 80 80 8059 93 64 38 26 71 1 66 3918 54 3 25 10 80 46 49 2617 49 70 22 71 98 81 44 2322 24 96 90 79 26 13 63 6072 62 35 54 98 13 94 56 2856 81 96 90 42 44 88 33 3710 95 47 39 40 74 48 72 44

Page 36: My Excel Tutorial.xlsx

72 77 68 43 75 89 23 27 5372 46 33 91 76 68 54 82 7494 62 70 62 1 71 46 49 9044 16 63 96 93 42 98 36 32

4 78 4 57 89 63 14 63 1144 53 42 63 53 73 15 21 3880 8 23 12 57 71 55 48 7741 77 13 57 84 1 92 13 1921 28 20 14 34 77 12 47 3035 79 17 53 48 31 52 29 1644 19 27 44 81 54 47 8 2438 82 78 93 9 49 1 20 7645 91 77 37 45 46 5 71 4747 24 39 50 25 65 52 71 1464 36 57 8 7 85 97 6 1679 62 44 21 75 43 58 44 8425 11 56 79 80 68 68 25 2147 1 96 34 33 30 92 70 17

2 65 45 17 6 16 19 61 973 21 96 87 87 33 95 99 1997 29 26 8 25 35 27 30 6962 31 48 1 100 11 71 77 8722 42 23 87 55 73 89 22 7348 12 99 78 21 25 58 88 463 62 60 7 95 7 9 20 3759 83 41 52 33 77 59 28 7823 53 55 94 79 73 53 45 9373 85 62 26 65 82 48 55 587 76 44 15 5 76 8 73 5425 36 61 5 95 95 55 44 8187 49 6 24 96 32 90 43 43

1 65 3 98 88 93 52 26 7625 7 5 62 60 41 36 43 94

3 15 36 21 81 37 48 67 8721 88 92 53 26 82 74 30 7146 8 27 24 80 66 74 33 7641 32 70 57 7 68 37 55 8474 5 50 73 14 35 70 87 65

8 52 77 79 18 82 17 29 5664 28 1 99 41 63 89 69 9760 75 59 23 50 98 8 91 8424 32 42 22 45 40 78 92 966 100 97 47 89 46 89 73 33

5 21 61 56 43 59 39 19 4151 11 13 49 60 16 15 94 6780 38 15 55 84 4 68 40 8569 59 95 21 59 78 9 59 3644 43 36 99 84 57 72 11 93

Page 37: My Excel Tutorial.xlsx

36 96 63 2 69 5 56 70 6690 35 33 45 100 95 30 23 9229 11 97 85 100 17 81 87 587 99 83 90 96 54 33 56 5980 41 1 99 56 87 85 74 8567 86 89 90 17 97 64 6 4378 98 73 2 43 55 81 46 659 7 61 27 45 25 32 47 6650 65 6 73 62 5 96 69 6591 58 44 11 100 82 50 28 2636 92 28 37 38 4 30 99 1793 31 27 55 85 54 65 94 9031 42 27 37 83 42 5 43 2432 76 74 40 8 61 46 73 3136 13 30 44 71 60 83 68 7610 72 34 68 46 1 35 84 3251 41 64 66 64 25 66 21 3854 51 44 70 39 66 38 21 7418 22 68 19 62 49 31 98 7620 36 76 29 14 36 22 14 6884 81 83 45 67 76 65 53 76

2 32 35 35 77 100 51 81 6780 80 49 44 55 44 25 53 58

6 73 48 54 20 12 73 27 8255 88 39 92 91 88 70 97 86

6 14 68 28 42 87 68 86 166 85 2 88 9 46 3 68 30

48 82 90 87 29 56 68 54 4949 16 70 33 38 89 89 38 2289 65 76 38 66 65 90 52 6782 96 81 70 57 16 56 37 5029 39 13 40 71 72 68 55 2111 49 96 18 36 30 71 10 5143 21 73 40 37 28 24 4 1417 77 29 50 77 10 53 30 55

100 87 58 88 19 44 54 82 6265 56 63 89 78 60 49 39 3426 50 7 90 32 25 80 80 985 4 11 95 8 72 16 30 3627 34 52 95 58 72 88 48 9274 50 36 79 4 91 62 30 7990 4 53 74 9 37 100 77 2281 67 18 3 36 41 24 51 8987 10 62 20 81 35 2 71 2685 30 97 86 13 26 91 11 8063 71 10 68 99 9 92 4 75

8 18 40 81 20 19 21 59 1214 23 86 50 65 69 52 75 28

Page 38: My Excel Tutorial.xlsx

70 68 65 22 38 67 79 97 1335 20 39 36 60 83 62 69 1124 42 69 77 10 87 33 4 5566 34 71 48 48 54 45 82 3575 35 7 53 28 9 82 61 8247 61 39 77 63 54 89 92 5675 83 38 56 55 5 96 90 7562 32 49 76 59 48 40 29 3390 2 31 1 86 96 41 11 89

9 4 60 71 6 49 33 19 3158 47 83 28 10 39 15 71 8487 29 30 76 72 11 91 2 71

5 37 65 32 8 44 42 90 8471 55 13 82 26 58 53 81 3940 27 2 33 73 3 87 10 5877 90 32 82 40 62 49 32 6062 31 22 48 69 66 28 54 375 7 75 57 36 24 65 72 2168 54 34 43 18 89 25 1 9468 17 81 73 51 24 99 49 9960 53 39 63 39 49 52 66 3738 44 18 1 14 6 88 7 813 2 66 24 33 64 9 73 5065 78 33 93 61 75 81 47 2411 74 100 95 33 87 58 14 10

100 79 1 30 38 38 2 52 1093 77 58 4 76 71 79 10 799 39 52 60 13 65 16 90 1247 15 65 34 2 49 3 68 4662 100 64 94 41 79 3 11 936 37 100 34 96 54 46 34 5850 30 8 81 33 75 76 68 271 63 57 70 12 93 83 29 9633 54 72 49 3 68 38 97 8168 32 91 5 34 66 31 25 6980 89 86 36 50 78 81 78 882 22 53 19 14 39 86 50 1370 43 74 72 45 41 13 42 8795 33 7 76 39 88 55 64 1624 70 27 78 78 36 85 79 50

1 42 24 11 41 78 58 7 5191 26 84 65 71 15 32 95 79

100 79 78 99 41 89 12 77 9058 12 65 57 60 52 37 25 7145 98 2 43 82 3 26 52 8621 50 29 23 18 59 79 48 6353 25 43 25 98 79 6 30 89

5 51 1 1 36 34 51 17 93

Page 39: My Excel Tutorial.xlsx

35 83 10 62 46 46 82 47 9753 25 29 1 97 7 45 16 6251 24 71 78 75 40 97 97 6935 4 69 90 27 70 16 15 5622 80 64 22 36 66 3 14 81

4 54 13 100 97 23 71 46 638 88 74 93 53 84 2 55 10

75 28 66 58 48 87 30 12 835 35 40 86 85 56 79 20 7

13 5 86 97 42 43 21 71 8631 64 50 32 28 86 46 98 298 67 43 64 41 72 95 83 92

6 64 79 7 7 94 92 40 2597 55 34 5 19 89 58 38 8267 43 50 69 37 11 16 79 9216 79 76 21 85 12 67 18 3249 82 70 80 13 44 70 57 27

6 83 5 79 15 91 92 29 5081 84 67 96 65 88 82 98 1255 13 37 12 100 57 68 80 2779 51 75 17 89 44 22 34 62

7 60 8 51 74 41 84 1 3897 29 35 1 37 65 88 99 4568 29 86 53 36 26 23 83 1926 43 93 34 93 35 17 6 99

Page 40: My Excel Tutorial.xlsx

70 84 94 30 49 86 7 18 39 54100 42 23 85 57 84 89 53 25 57

57 56 82 3 62 89 17 6 28 9940 59 34 22 37 39 24 64 31 529 78 88 67 62 23 32 72 65 3232 97 51 41 90 79 49 16 49 7525 39 33 93 81 44 4 88 50 1922 31 97 78 79 17 62 1 69 2677 39 51 75 63 6 63 31 7 5571 93 74 34 52 4 26 55 60 2758 80 41 93 77 33 8 38 89 9534 34 91 57 9 49 93 62 45 758 13 20 20 58 23 16 69 51 1546 75 58 95 64 9 8 100 60 65

3 30 36 90 61 40 12 19 89 3934 71 54 65 39 72 94 59 47 2426 38 78 44 4 59 90 43 100 9

100 70 72 45 7 49 10 21 27 5427 92 43 19 59 8 91 55 42 2318 92 16 9 95 61 27 11 5 3675 89 99 9 46 3 51 38 24 3368 76 44 97 68 7 19 6 5 5883 56 12 29 60 65 93 60 21 827 67 62 52 39 46 20 82 66 5847 79 46 32 58 36 71 83 52 4091 40 1 68 95 2 61 97 54 3935 46 96 80 77 31 34 12 49 7081 34 12 85 9 66 69 72 40 8354 23 33 77 7 2 2 19 80 2386 59 59 94 24 17 90 11 46 6249 8 63 64 10 34 41 80 87 4579 9 27 31 20 25 54 5 13 9168 91 99 41 92 91 19 30 18 8659 77 45 7 12 6 57 47 28 8385 86 100 90 83 1 63 61 64 8495 13 18 81 23 31 28 35 80 7016 86 68 83 22 89 64 80 60 1288 11 79 6 16 40 73 91 36 436 69 98 35 16 18 54 88 24 5745 13 91 85 3 47 50 2 16 6129 50 88 14 43 47 47 90 15 4696 14 29 64 78 57 91 27 89 6550 58 89 69 40 42 5 10 90 9798 80 86 71 40 15 90 70 18 6156 22 66 36 51 18 29 14 33 5311 41 86 87 71 67 93 38 54 44

Page 41: My Excel Tutorial.xlsx

42 45 66 2 7 87 67 4 45 6984 43 63 48 88 61 71 20 71 5841 41 26 17 44 46 100 63 29 2461 47 37 24 28 75 84 24 96 11

4 30 63 63 77 3 11 68 60 6052 57 4 41 22 37 31 48 24 5367 91 83 73 74 6 54 46 32 1968 8 51 24 19 55 32 8 2 6732 89 11 58 49 47 38 28 49 39

2 28 34 92 64 34 58 32 14 2770 31 11 67 64 54 37 90 40 8123 23 66 74 49 57 66 3 23 1745 42 84 57 73 25 58 52 26 9193 63 88 93 15 18 40 35 16 9846 60 90 18 3 10 84 79 47 6740 26 36 82 50 80 68 96 82 1765 98 46 78 59 25 9 28 74 199 14 37 30 96 5 76 49 65 5248 29 43 21 16 65 24 16 82 9973 67 47 34 84 85 42 95 78 9192 71 50 68 16 50 17 53 37 33

5 65 100 75 83 59 92 40 73 1948 24 83 93 88 84 64 85 41 6319 36 76 57 69 70 52 39 10 1662 84 84 11 3 80 49 5 24 3727 1 58 23 46 28 58 84 17 8015 62 70 91 48 36 56 15 88 3920 63 37 20 86 24 81 78 89 6992 31 47 61 93 13 91 62 70 4111 41 40 59 2 100 33 74 81 8183 9 66 92 37 83 58 31 4 6618 14 12 31 77 11 53 7 56 4748 12 5 79 51 73 41 45 37 1546 19 28 23 33 4 62 29 27 4437 53 48 92 63 14 15 52 50 9260 66 4 10 61 75 62 89 19 4747 15 11 25 50 14 88 49 16 1482 3 30 59 11 72 82 26 50 6383 24 65 32 94 90 63 6 76 1533 46 95 22 99 54 46 36 63 3852 4 6 2 96 16 42 51 15 3849 58 11 42 23 50 40 57 84 6252 92 36 2 14 22 82 9 61 7294 46 84 7 72 88 46 64 51 6859 38 35 22 25 50 83 60 85 9485 44 97 88 39 57 66 70 97 3061 67 11 88 12 51 21 40 12 1083 30 93 97 12 78 55 78 89 6

Page 42: My Excel Tutorial.xlsx

55 59 36 73 89 67 83 56 62 8773 26 66 95 46 21 56 46 19 8097 12 61 50 100 58 92 31 3 3731 92 30 61 73 2 83 83 55 4140 87 10 30 39 51 55 34 74 7247 62 23 62 19 5 96 95 80 4

6 80 63 34 38 75 73 65 62 5073 93 13 72 10 45 43 66 64 6832 43 59 89 24 56 64 44 26 4742 32 29 99 56 63 14 30 28 9467 7 84 28 77 28 76 27 96 8463 63 77 16 95 82 15 8 4 4115 18 46 36 8 63 8 15 28 3224 94 59 63 65 31 93 16 71 8811 84 28 95 38 72 50 5 84 1564 99 80 70 84 97 90 3 93 9663 85 79 37 69 82 95 100 71 26

3 22 59 5 36 3 39 52 1 4523 37 48 20 20 40 75 65 42 1792 88 4 57 79 9 84 2 41 928 63 84 25 27 3 4 44 79 5538 88 82 92 100 100 32 59 7 127 67 74 73 32 35 100 22 60 3739 15 5 10 51 64 23 93 67 363 33 60 25 59 91 15 76 44 2849 16 17 13 92 8 77 38 83 4169 6 55 98 4 99 58 5 92 2382 50 68 83 6 32 7 84 77 7618 3 40 51 87 91 87 50 92 6251 39 13 30 54 49 1 31 100 1636 37 56 47 79 51 14 2 55 9397 51 42 54 3 84 69 53 19 9566 60 24 100 23 72 92 42 63 9979 56 50 52 6 49 61 93 86 7037 57 38 79 52 81 29 93 50 4670 91 60 83 26 92 63 37 72 3829 57 5 82 48 26 40 20 7 8456 85 51 54 75 88 27 35 13 2056 56 43 30 82 39 9 11 36 5026 50 30 9 44 38 9 19 25 6425 59 21 50 94 4 32 36 13 7176 58 32 44 50 57 98 55 18 1829 43 46 41 83 59 75 66 65 8882 2 73 84 3 11 36 69 53 1091 32 65 21 89 53 90 23 79 75

2 68 46 3 49 96 43 66 16 6868 21 98 28 28 43 75 15 15 4684 75 56 15 80 83 32 36 100 78

Page 43: My Excel Tutorial.xlsx

65 75 10 97 100 60 1 52 42 815 64 41 25 55 7 30 61 71 571 57 87 40 30 39 55 79 98 8532 34 56 17 12 94 57 99 20 3529 6 73 40 42 65 73 22 7 723 3 74 60 9 26 83 36 58 6658 18 96 91 86 93 2 100 15 5495 22 31 61 93 26 3 67 9 321 72 10 27 58 29 28 35 27 6893 81 15 33 49 62 75 50 5 4588 37 90 1 77 59 61 73 66 3256 4 3 84 8 56 20 9 91 7268 57 97 67 13 41 20 38 39 1192 79 87 18 8 70 43 40 74 9820 8 48 25 58 33 53 72 18 1234 98 27 52 51 8 16 61 6 6845 31 34 17 4 83 1 60 22 7464 99 18 98 18 51 87 36 70 1984 89 100 96 9 25 81 17 67 3487 89 5 42 37 65 87 48 98 10

100 39 47 28 59 9 22 39 98 6546 93 8 83 32 57 16 16 71 2786 24 87 48 65 79 38 7 90 647 50 73 76 6 98 65 19 51 7853 95 13 61 27 56 89 25 88 7368 5 12 97 43 44 78 72 71 8279 3 77 14 12 10 13 29 6 30

100 34 93 31 39 85 87 70 67 3256 2 22 71 10 74 95 96 34 9974 77 95 88 25 10 67 89 69 42

6 73 11 82 8 78 66 30 97 8365 45 30 73 36 83 50 28 39 5732 27 8 26 2 45 59 81 53 156 65 78 7 74 71 47 1 30 2777 79 48 25 70 87 64 15 15 7218 84 10 61 51 76 97 63 47 5392 15 100 19 90 16 86 11 76 8177 47 84 5 91 13 8 39 81 4

6 38 31 51 87 63 27 45 49 5013 86 93 91 28 46 23 88 85 3544 2 18 39 47 58 8 15 90 1519 16 51 66 27 68 38 35 85 43

8 90 100 27 59 4 52 3 43 5727 50 100 5 12 62 10 44 48 7160 98 27 76 20 63 11 98 3 10099 24 10 49 30 29 55 16 28 9

4 72 22 93 40 35 2 82 85 9771 32 60 39 88 93 51 32 82 69

Page 44: My Excel Tutorial.xlsx

88 93 51 51 17 89 70 63 68 7342 51 34 36 50 48 7 7 34 3291 52 15 62 12 7 66 38 41 8714 54 11 40 58 23 97 30 5 8466 43 90 67 21 39 41 13 30 7591 73 69 83 17 19 16 84 43 3165 80 18 42 64 31 92 65 83 160 20 82 56 87 70 7 74 16 9562 22 57 67 77 13 42 76 76 8956 25 22 19 1 2 64 87 74 4684 65 78 72 3 68 36 88 8 3260 9 16 94 72 12 82 42 65 9368 76 14 79 7 33 35 21 24 85

6 99 49 77 14 10 50 64 21 8882 100 91 83 14 45 6 43 87 6

4 72 55 97 83 7 32 75 92 6558 56 21 100 94 12 94 24 6 1469 79 23 10 34 14 47 66 30 9764 86 86 25 92 19 34 22 52 5195 22 32 5 74 4 19 3 26 6669 88 3 86 44 78 43 88 5 3887 51 54 35 92 35 1 72 78 79

100 33 9 90 16 28 65 6 91 2910 8 54 21 94 85 70 86 71 141 85 63 5 14 72 9 39 98 5676 34 28 82 89 37 68 86 9 9740 73 26 6 95 19 27 41 83 9057 57 35 80 19 43 13 70 22 7442 32 76 41 47 40 73 65 63 9823 40 63 60 39 27 18 16 6 1961 7 51 55 90 20 49 94 56 5339 38 25 64 36 1 18 78 31 9051 85 77 22 5 57 15 39 90 19

6 37 35 11 65 31 14 52 19 4289 35 56 39 15 59 88 100 9 38

4 51 20 88 51 91 14 81 34 2762 91 8 63 47 72 79 86 48 3734 42 99 84 81 23 29 16 2 9637 35 31 4 32 63 94 50 10 9515 27 71 66 93 74 40 99 13 8127 59 88 8 78 17 63 6 20 6931 75 46 39 87 34 73 95 48 4448 41 19 5 95 71 17 1 90 4026 11 31 70 14 88 34 26 41 7328 100 2 10 75 78 3 73 5 2597 17 61 39 85 83 56 27 95 5848 13 79 80 1 15 35 94 85 4473 53 95 53 51 21 88 93 34 27

Page 45: My Excel Tutorial.xlsx

46 92 22 63 28 60 26 91 1 4883 26 37 36 79 93 56 75 94 8739 89 5 79 8 35 38 75 6 9496 48 1 24 33 27 52 25 19 1369 35 5 9 64 2 45 80 64 4752 11 60 47 59 76 77 10 81 3

2 22 35 39 48 4 93 9 84 7427 91 53 26 36 10 46 67 80 8486 34 2 63 86 81 17 8 33 7970 58 29 73 6 5 10 92 65 3936 54 95 100 81 98 51 36 17 7744 61 62 3 12 77 12 62 23 9088 51 22 59 50 50 36 14 35 5266 35 48 59 87 55 93 88 7 8217 18 56 13 51 45 14 71 53 3168 90 19 28 49 60 12 52 46 4870 26 14 67 63 24 34 94 30 3179 67 74 10 13 15 92 27 19 1930 63 87 90 22 41 37 46 25 8871 32 38 95 69 58 74 11 81 9995 25 66 66 59 30 19 86 51 682 80 95 64 35 84 26 90 96 8

100 96 58 5 46 37 11 18 32 6363 68 88 10 83 19 26 36 84 7855 7 42 29 55 37 95 65 59 47

Page 46: My Excel Tutorial.xlsx

49726869878

1742451206270683486704311

4636647

139619690273258

1008

986759268641947324

7100

5571

Page 47: My Excel Tutorial.xlsx

9032

74

523680193114977648264197625056979470493967

493

63

4440

744154348944156

75914777124773720

Page 48: My Excel Tutorial.xlsx

85146320585641

93159

65030

32

4758

7701361726284709145568140389596675366342833746088323337859796

Page 49: My Excel Tutorial.xlsx

9068239299355438

22039194673414333467182193723924928356953

2689175763229396165403224177516728751

Page 50: My Excel Tutorial.xlsx

4216415920273360489171

916

1007

488391

86894694155946216

91528175114127221832874496854222337165924

Page 51: My Excel Tutorial.xlsx

62586379742263423120228334968954

143445044

6714895

Page 52: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 it’s a bit trickier if you can’t see the whole range. In the latter case the effect of dragging (the method most users try) can be frustrating–things 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 doesn’t 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.

Page 53: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

9 2 101 3 88 1 107 5 45 1 15 10 7

63 61 4 36 45 85 91 23 1752 95 40 75 28 67 79 75 4918 98 47 28 65 17 86 23 6325 21 7 68 16 12 80 87 5926 76 55 60 55 19 82 61 4242 52 72 79 16 14 85 49 8114 29 75 36 52 75 17 33 6687 41 48 22 25 77 3 57 32

100 71 10 11 90 15 62 24 8359 51 90 35 94 83 77 26 7943 72 53 21 60 22 33 67 2919 73 49 38 33 42 49 84 886 58 55 59 41 63 75 19 34

7 62 41 62 26 17 95 97 7952 78 37 18 45 98 35 40 7318 32 62 79 86 31 58 3 14

1 89 92 86 88 94 12 49 3871 71 58 14 37 27 73 31 8375 18 70 77 52 6 45 8 57

2 5 21 95 16 8 66 82 7264 89 38 32 8 51 63 86 164 67 81 11 34 16 30 16 39

6 30 42 3 68 27 12 86 7787 78 33 53 48 86 17 4 6164 64 15 28 44 65 29 10 5758 33 81 90 48 26 55 49 3476 54 84 66 65 78 3 88 1715 79 47 71 19 74 58 63 5773 85 20 100 6 46 17 24 86

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 it’s a bit trickier if you can’t see the whole range. In the latter case the effect of dragging (the method most users try) can be frustrating–things 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 doesn’t 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.

Page 54: My Excel Tutorial.xlsx

43 40 26 30 59 98 46 85 2383 54 38 91 59 27 82 98 3941 85 63 28 29 59 47 76 8155 72 42 24 59 41 78 1 5323 22 17 76 50 67 17 6 9754 74 23 86 88 85 98 79 8381 54 24 61 41 43 13 44 9116 86 24 58 99 49 50 93 6531 38 91 46 44 15 23 12 3247 67 39 26 54 85 65 52 469 4 10 56 89 66 13 99 2282 28 25 20 88 92 28 97 4266 69 81 19 78 100 57 27 5219 85 32 47 1 69 68 16 1958 30 88 16 44 90 9 91 68

8 98 6 1 74 2 53 35 854 22 18 11 61 5 100 43 49

22 89 29 84 88 18 67 12 265 81 48 65 9 67 13 78 55

33 95 12 21 18 73 31 17 8557 32 94 59 15 22 18 77 467 55 5 66 36 26 34 82 59

4 10 12 86 91 11 73 14 2852 69 35 8 38 63 20 68 1646 25 70 45 99 56 34 4 9879 71 61 38 37 66 24 97 9128 51 23 75 42 89 79 42 2295 41 44 60 83 57 61 59 3940 76 54 4 46 23 28 66 2996 61 55 1 59 67 37 96 52

3 7 17 28 87 5 98 31 6296 37 82 70 8 56 25 41 1639 33 1 82 35 51 71 55 6646 15 81 86 74 69 22 85 6423 24 3 40 30 27 73 16 85

6 64 5 95 11 15 90 36 4472 36 24 58 23 89 45 83 68

8 34 69 26 14 77 15 8 2148 91 81 13 94 87 18 48 6370 29 30 5 18 75 97 27 6257 78 44 99 59 65 31 91 3898 92 39 60 45 75 30 34 5345 23 30 91 89 36 9 64 1169 70 86 55 70 5 78 71 5150 56 42 18 47 2 85 49 5317 20 19 68 2 10 2 12 7955 56 25 28 1 71 64 8 764 68 99 77 20 38 29 96 6

Page 55: My Excel Tutorial.xlsx

87 77 77 13 85 62 4 66 1196 72 80 61 73 72 86 49 79

Page 56: My Excel Tutorial.xlsx

76 49 49 44 70 31 67 78 20 9876 61 77 11 51 34 31 56 61 8373 21 16 58 34 98 16 16 3 7629 27 56 14 91 25 91 6 63 3544 69 9 80 23 78 100 6 96 47

7 25 30 92 61 71 26 85 93 7150 33 13 51 65 39 29 26 41 17

3 57 3 79 32 66 4 18 40 6266 47 88 15 53 21 64 70 1 7861 84 100 79 8 5 42 12 28 9571 56 28 72 4 48 24 95 93 6149 97 11 80 93 63 95 86 51 1937 84 29 81 94 78 9 7 89 7398 6 20 53 54 18 4 82 59 4872 63 10 72 6 36 30 88 50 526 15 87 60 88 86 45 36 76 9852 54 16 18 26 17 24 26 34 9428 3 11 85 63 41 71 15 42 8778 24 41 43 29 67 82 62 63 1487 85 64 24 24 49 30 78 73 4491 68 20 2 43 85 42 58 20 4365 51 49 14 73 98 20 67 33 8424 87 38 25 46 61 68 17 26 43

4 59 86 33 25 95 28 55 17 692 91 96 93 29 54 7 56 2 3823 15 74 17 57 89 12 64 28 10097 53 7 40 45 83 35 76 57 8

4 83 8 31 50 96 96 33 80 2049 11 52 3 58 61 34 51 43 90

Page 57: My Excel Tutorial.xlsx

75 83 37 53 99 90 65 91 21 9591 77 31 75 6 72 36 39 51 2524 49 12 36 47 54 76 39 22 5

7 65 34 60 47 82 72 33 20 7474 84 32 10 84 74 22 10 26 3951 6 88 15 60 13 17 92 71 4518 59 20 62 17 80 12 17 78 9688 8 30 73 2 52 71 29 21 4170 22 27 1 50 3 15 13 41 7157 1 79 98 30 14 12 63 11 5410 18 90 45 74 53 80 71 3 3565 45 72 47 25 73 82 45 29 3980 9 78 17 35 52 54 93 74 7728 71 63 73 18 49 41 19 11 4287 24 38 39 66 100 74 73 12 8780 71 49 91 9 29 46 57 47 1034 10 76 40 93 79 81 33 7 9734 18 86 17 49 63 39 11 36 2336 53 17 97 64 53 44 53 28 8597 86 25 77 59 36 86 43 73 2384 63 99 36 53 34 59 36 36 61

8 48 60 41 33 53 1 99 83 1567 95 47 63 73 89 94 98 4 3364 58 75 86 75 87 12 86 60 977 70 92 42 91 29 47 1 6 6144 29 57 83 93 81 40 15 68 4158 99 92 40 22 35 2 22 16 75

9 7 62 71 50 62 16 12 49 2876 37 22 59 66 40 58 66 14 7795 10 74 12 13 94 72 74 86 7172 52 32 71 18 55 72 48 65 8472 94 49 11 94 84 79 37 61 4843 20 5 77 86 5 19 71 53 9469 17 99 90 76 84 14 2 41 63

2 20 44 68 34 47 77 75 8 1597 99 41 50 82 67 13 72 40 9965 48 77 13 71 63 5 32 53 1471 64 93 34 51 48 55 4 36 2829 16 6 60 50 91 58 50 74 2776 3 18 66 54 58 74 33 95 8413 35 9 85 46 78 100 79 62 8695 70 8 93 88 42 64 8 96 5154 8 68 10 100 42 10 42 28 5270 48 77 78 55 91 47 41 83 9417 51 67 58 70 51 87 24 24 8667 93 73 40 50 46 24 40 58 8323 15 42 28 56 33 99 10 30 7392 60 90 85 83 53 39 66 37 79

Page 58: My Excel Tutorial.xlsx

95 99 57 13 74 28 33 70 22 9089 52 100 9 74 100 64 46 37 32

Page 59: My Excel Tutorial.xlsx

47 8833 24

5 2598 6741 5055 6765 9345 481 1625 6392 70

2 5042 3762 7657 2759 6559 1385 5559 9170 9973 71

7 7120 4992 4588 8776 4224 7614 5673 25

Page 60: My Excel Tutorial.xlsx

48 6172 9730 9852 164 4145 2555 7959 6913 7841 4374 24

100 7566 5049 342 3098 8243 4463 3729 868 2584 3765 5690 5193 653 3145 6716 873 5

3 5433 3687 2632 3565 7323 3798 595 2540 6963 10069 563 6036 4512 1374 9591 4636 5453 9451 16

6 95

Page 61: My Excel Tutorial.xlsx

29 7898 10

Page 62: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 isn’t as dark as in previous versions of Excel, so you might be fooled into thinking you haven’t really highlighted multiple ranges. But the above method definitely works, exactly as it always has.

Page 63: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

10 13 7 91 9 12 75 4 1 1

6 1215 2

13 4 10

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 isn’t as dark as in previous versions of Excel, so you might be fooled into thinking you haven’t really highlighted multiple ranges. But the above method definitely works, exactly as it always has.

Page 64: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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-c (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.

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

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 left.

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:

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.

Try it! Copy the formula in N44 down through N50 with the autofill handle.

Page 65: My Excel Tutorial.xlsx

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:

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.

Try it! Copy the formula in N44 down through N50 with the autofill handle.

The second way to copy down is to double-click on the autofill handle.

Note that this method uses Excel’s built-in intelligence, but it works only in certain situations. Let’s say you have numbers in the range A3:B100. You want to enter a formula in cell C3 and copy it down to cell C100. 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 wouldn’t work.

Try it! Copy the formula in N56 down through N62 by double-clicking on the autofill handle.

Page 66: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

3 3 94 12 32 15 14 23 5

6 29 14 97 62 38 53 9

10 7 706 94 95 12 8

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-c (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.

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

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 left.

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:

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.

Try it! Copy the formula in N44 down through N50 with the autofill handle.

Page 67: My Excel Tutorial.xlsx

8 1010 7

7 8 562 1

10 24 14 53 87 8

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:

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.

Try it! Copy the formula in N44 down through N50 with the autofill handle.

The second way to copy down is to double-click on the autofill handle.

Note that this method uses Excel’s built-in intelligence, but it works only in certain situations. Let’s say you have numbers in the range A3:B100. You want to enter a formula in cell C3 and copy it down to cell C100. 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 wouldn’t work.

Try it! Copy the formula in N56 down through N62 by double-clicking on the autofill handle.

Page 68: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 to 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 paste special options as well.

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.

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 values by dividing each value by 1000.

Page 69: My Excel Tutorial.xlsx

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.

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 values by dividing each value by 1000.

Page 70: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

1 1 12 3 69 5 457 4 288 8 648 10 807 6 42

10 2 206 7 421 8 8

$47.65$44.20$37.68$31.34$89.36$68.15$28.57

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 to 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 paste special options as well.

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.

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 values by dividing each value by 1000.

Page 71: My Excel Tutorial.xlsx

147173217178120203137217153

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.

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 values by dividing each value by 1000.

Page 72: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 73: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

2 3 67 4 283 6 183 9 276 7 426 6 361 4 4

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.)

Page 74: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Month Price Units sold RevenueJan $3.00 100 $300.00Mar $3.25 50 $162.50Jun $3.50 200 $700.00

Return to table of contents

Often you want to insert or delete rows or columns. Note that deleting a row or column is not the same as clearing the contents of a row or column—making 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.

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 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.

Page 75: My Excel Tutorial.xlsx

Person Age1 362 333 494 255 216 467 278 359 22

10 2711 3712 3613 2114 3515 3916 4817 3518 3819 3620 4421 3422 5023 4424 4125 4326 4827 2928 3429 2230 28

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 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.

Page 76: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Often you want to insert or delete rows or columns. Note that deleting a row or column is not the same as clearing the contents of a row or column—making 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.

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 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.

Page 77: My Excel Tutorial.xlsx

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 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.

Page 78: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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--a 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 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.

Page 79: My Excel Tutorial.xlsx

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 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!

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.

Page 80: My Excel Tutorial.xlsx

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!

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.

Page 81: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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--a 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 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.

Page 82: My Excel Tutorial.xlsx

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 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!

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.

Page 83: My Excel Tutorial.xlsx

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!

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.

Page 84: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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. (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.

Page 85: My Excel Tutorial.xlsx

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. (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.

Page 86: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Person Age Gender State Children Salary1 35 Male Ohio 1 $65,4002 61 Female Illinois 2 $62,0003 35 Male Illinois 0 $63,2004 37 Male Indiana 2 $52,0005 32 Female Ohio 3 $81,4006 33 Female Illinois 3 $46,3007 65 Female Illinois 2 $49,6008 45 Male Ohio 1 $45,9009 40 Male Illinois 3 $47,700

10 32 Female Ohio 1 $59,90011 57 Male Illinois 1 $48,10012 38 Female Indiana 0 $58,10013 37 Female Indiana 2 $56,00014 42 Female Ohio 2 $53,40015 38 Female Ohio 2 $39,00016 48 Male Ohio 1 $61,50017 40 Male Indiana 0 $37,70018 57 Female Indiana 2 $36,70019 44 Male Illinois 2 $45,20020 40 Male Ohio 0 $59,00021 21 Female Indiana 2 $54,30022 49 Male Ohio 1 $62,100

Grade NameA+ FREDA TOMA- jennyB+ dougB MARYB- sam

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. (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.

Page 87: My Excel Tutorial.xlsx

C+ charlieC BOBC- CHRISD+DD-F

Order Time Day1 Morning Saturday2 Evening Wednesday3 Evening Saturday4 Afternoon Friday5 Evening Tuesday6 Morning Tuesday7 Afternoon Monday8 Afternoon Saturday9 Afternoon Monday

10 Morning Tuesday11 Evening Sunday12 Morning Monday13 Afternoon Wednesday14 Morning Friday15 Afternoon Saturday16 Morning Tuesday17 Afternoon Thursday18 Afternoon Friday19 Afternoon Friday20 Evening Thursday21 Morning Sunday22 Morning Monday23 Morning Sunday24 Morning Sunday25 Morning Saturday

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. (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.

Page 88: My Excel Tutorial.xlsx
Page 89: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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. Don’t 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.

Page 90: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Day Sales Day Sales$227 $167$157 $107$143 $255$129 $113$102 $186$116 $124$269 $271$111 $288$210 $273$117 $285$214 $231$150 $272$229 $169$241 $269$270 $274$224 $133$127 $280$246 $289$203 $254$207 $114$190 $181$256 $259$297 $185$175 $117$169 $224

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. Don’t 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.

Page 91: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 92: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Jan Q1 2009

Feb

Mar

Apr Q2

May

Jun

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.

Page 93: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 94: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Fixed cost $50Variable cost $2

Month Jan Feb Mar AprUnits produced 224 194 228 258Total cost

Table of revenues for various unit prices and units sold

Units sold50 100 150 200

Unit price $3.25$3.50$3.75$4.00$4.25

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.

Page 95: My Excel Tutorial.xlsx

Fixed cost $50Variable cost $2

Month Jan Feb Mar AprUnits produced 224 194 228 258Total cost $498 $438 $506 $566

Units sold50 100 150 200

Unit price $3.25 $162.50 $325.00 $487.50 $650.00$3.50 $175.00 $350.00 $525.00 $700.00$3.75 $187.50 $375.00 $562.50 $750.00$4.00 $200.00 $400.00 $600.00 $800.00$4.25 $212.50 $425.00 $637.50 $850.00

Page 96: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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!

Page 97: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Multiplication table1 2 3 4

1 1 2 3 42 2 4 6 83 3 6 9 124 4 8 12 16

Total 10 20 30 40

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!

Page 98: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 99: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Unit printing cost $0.10Unit mailing cost $0.15Variable cost of printing and mailing $0.25Number mailed 100000

Average revenue per order $60Order fulfillment cost (% of revenue) 60%Variable cost per order fulfillment $36.00

Response rate 3%Number of responses 3000

Total Revenue $180,000Fixed cost of printing $20,000Total variable cost of printing and mailing $25,000Total variable cost of order fulfillment $108,000Total cost $153,000Profit $27,000

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.

Page 100: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 101: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

51 94 15 7 16737 6 2 41 8613 83 29 88 21373 64 46 32 21538 11 3 80 132

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.

Page 102: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 Excel’s 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.

Page 103: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Sales figures

Jan Feb MarNorth 2300 3200 4500West 4300 3500 4200East 5500 6500 6000

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 Excel’s 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.

Page 104: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Try it! Name the rectangular range containing the numbers Data.

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 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.

Page 105: My Excel Tutorial.xlsx

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.

Page 106: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

71 31 9 69 515 74 46 84 2714 49 25 38 8340 43 20 75 8328 72 30 92 7541 56 90 89 7328 81 43 81 61

Month UnitsSold UnitPrice RevenueJan 100 $1.25 $125.00Feb 150 $1.25 $187.50Mar 200 $1.40 $280.00Apr 230 $1.40 $322.00May 200 $1.50 $300.00Jun 300 $1.50 $450.00Totals 1180 $1,664.50

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.

Try it! Name the rectangular range containing the numbers Data.

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 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.

Page 107: My Excel Tutorial.xlsx

Range names used in this sheet:

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.

Page 108: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 109: My Excel Tutorial.xlsx
Page 110: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.

Page 111: My Excel Tutorial.xlsx
Page 112: My Excel Tutorial.xlsx

Payment #NUM!

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

Page 113: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 case 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.

Page 114: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Bob Mary Jack10 6 5

5 11 713 10 6

2 15 199 5 20

18 16 1918 15 1

2 19 1018 14 6

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 case 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.

Page 115: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

If you haven’t 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.)

Page 116: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Payments for Mr. Jones, who just bought a new car

Amount financed $15,000 Annual interest rate 8.90%Term (number of months financed) 36Monthly payment

If you haven’t 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.)

Page 117: My Excel Tutorial.xlsx

Payment $476.30

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

Page 118: My Excel Tutorial.xlsx

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

Page 119: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 haven’t 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 didn’t 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.)

Page 120: My Excel Tutorial.xlsx

Save this file under another name, 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 Mar Apr MayJan $3,200 $3,900 $6,000 $6,600Feb $6,600 $5,700 $3,600Mar $4,800 $3,200Apr $4,900

Total cost

Student ID Exam score Average (for students who took the exam)1533 688031 749859 80 Average (giving 0s to students who were absent)9106 633535 728192 Absent6102 856774 707558 64

314 729082 812397 752517 802432 736016 635269 804847 886537 719922 734525 711491 717897 684088 82

166 767925 756405 81

802 762931 83

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 haven’t 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 didn’t 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.)

Page 121: My Excel Tutorial.xlsx

7625 672628 675417 927804 723994 69

394 858847 787855 818668 Absent3738 775534 706965 718863 698762 736466 606100 761878 745970 679691 628666 774865 916198 818554 876753 769574 773891 818186 Absent1306 736835 833136 594938 744807 744421 78

Page 122: My Excel Tutorial.xlsx

Average (giving 0s to students who were absent)

Page 123: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 124: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Student Exam score Number enrolled1 622 733 74 Number who took exam45 776 57 Number who were absent7 678 909 77

10 8311 7112 7513 7214 8215 6816 8617 7718 6819 862021 8022 8123 8424 7125 7626 8127 9928 7229 7830 6731 8932 7033 773435 8336 7437 8738 7539 8640 7741 7342 7443 7944 8045 77

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.

Page 125: My Excel Tutorial.xlsx

46 7247 7748 7149 7050 6851 7952 7553 8054 7355 6156 6257 6858 9259 8560 7761 7962 8663 8364 8365 7666 8967 7268 6969 6670 7171 8072 61

Page 126: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 127: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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

Min sales Max salesJanFeb

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.)

Page 128: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 is 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 answer.)

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.)

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.)

Page 129: My Excel Tutorial.xlsx

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.)

Page 130: My Excel Tutorial.xlsx

Save this file under another name, 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, nounits of that product are ordered

Product End inventory Order placed (yes or no)? # of units ordered1 1002 403 204 70

Each student gets an A (if score is 90 or above), S for satisfactory (if scoreif 60 or above but less than 90) or U for unsatisfactory if score is below 60

Student Score Grade1 702 953 554 805 606 90

Investor sells stock only if its price has gone up three consecutive days(including the current day)

Day Price change Sell (yes or no)?1 Up2 Down3 Up4 Up5 Up6 Down

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 is 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 answer.)

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.)

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.)

Page 131: My Excel Tutorial.xlsx

which is 1% of their total score.

Student Exam 1 Exam 2 Exam 3 Exam 4 Bonus1 87 83 83 802 77 72 74 973 80 95 79 754 82 87 96 885 78 94 81 796 75 83 80 72

Any student who scores at least 95 on any of the exams gets a bonusTo 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.)

Page 132: My Excel Tutorial.xlsx

Order placed? # orderedno 0

yes 160yes 180no 0

GradeSAUSSA

Sell?

NoNoYesNo

Page 133: My Excel Tutorial.xlsx

Bonus0

3.23.293.53

00

Page 134: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.) Let’s say you want to assign letter grades to students based on a straight scale: below 60, an F: at least 60 but below 70, a D; at least 70 but below 80, a C; at least 80 but below 90, a B; and 90 or above, an A. The 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 doesn’t find 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 Excel’s A-Z sort order. Therefore, FALSE must be entered as the fourth argument in the VLOOKUP function.

Page 135: My Excel Tutorial.xlsx

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 doesn’t find 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 Excel’s A-Z sort order. Therefore, FALSE must be entered as the fourth argument in the VLOOKUP function.

Page 136: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Student Score Grade Lookup table1 67 D 0 F2 72 C 60 D3 77 C 70 C4 70 C 80 B5 66 D 90 A6 81 B7 93 A8 59 F9 90 A

Order # Units sold Total cost1 3732 4753 4594 4415 2386 3497 3448 203

Student Grade Gradepoints Grade GradepointsAdams B A 4Davis A- A- 3.7Edwards C+ B+ 3.3Johnson B- B 3

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.) Let’s say you want to assign letter grades to students based on a straight scale: below 60, an F: at least 60 but below 70, a D; at least 70 but below 80, a C; at least 80 but below 90, a B; and 90 or above, an A. The 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 doesn’t find 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 Excel’s A-Z sort order. Therefore, FALSE must be entered as the fourth argument in the VLOOKUP function.

Page 137: My Excel Tutorial.xlsx

Myers B+ B- 2.7Smith A C+ 2.3Thomson C C 2

C- 1.7

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 doesn’t find 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 Excel’s A-Z sort order. Therefore, FALSE must be entered as the fourth argument in the VLOOKUP function.

Page 138: My Excel Tutorial.xlsx

Total cost Lookup table$932.50 0 $3.00$950.00 300 $2.50$918.00 400 $2.00$882.00$714.00$872.50$860.00$609.00

Page 139: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 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 be used in most real applications.

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 row 17.

Page 140: My Excel Tutorial.xlsx

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 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 less 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 see how they change randomly.

Page 141: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

1.7 -3.2 14 -7

100.35 14325 16.3467 154432 0.35690 -2 2 -3 1

6 -50 0

64 0.5 -20 0

1023 0.7 1 0 -40

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 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 be used in most real applications.

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 row 17.

Page 142: My Excel Tutorial.xlsx

1 -4 2.3 0 15

21 43 4 21 35

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 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 less 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 see how they change randomly.

Page 143: My Excel Tutorial.xlsx

Payment $0.00

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

Page 144: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 145: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.

Page 146: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 147: My Excel Tutorial.xlsx

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 are 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 corresponds to a product.

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.

Page 148: My Excel Tutorial.xlsx

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.)

Page 149: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Month SalesJan-09 $8,627 Feb-09 $5,343 Mar-09 $6,244 Apr-09 $9,451

May-09 $6,698 Jun-09 $6,752 Jul-09 $5,985

Aug-09 $5,586 Sep-09 $8,476 Oct-09 $9,191 Nov-09 $7,242 Dec-09 $8,277

Month Sales1 Sales2Jan-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 Jul-09 $5,985 $6,386

Aug-09 $5,586 $5,047 Sep-09 $8,476 $8,641 Oct-09 $9,191 $10,696 Nov-09 $7,242 $6,914 Dec-09 $8,277 $9,004

Month Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09 Jul-09 Aug-09Sales1 $8,627 $5,343 $6,244 $9,451 $6,698 $6,752 $5,985 $5,586 Sales2 $8,452 $6,801 $5,497 $10,329 $5,995 $8,103 $6,386 $5,047

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.

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09Jul/0

9

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

$0

$2,000

$4,000

$6,000

$8,000

$10,000

$12,000

Monthly Sales of Two Products

Sales1Sales2

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09

Jul/09

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

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

$10,000

Sales

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.

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09Jul/0

9

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

$0

$2,000

$4,000

$6,000

$8,000

$10,000

$12,000

Monthly Sales of Two Products

Sales1Sales2

Page 150: My Excel Tutorial.xlsx

Product1 Product2 Product3 Product4Region1 $4,948 $3,526 $2,869 $3,588Region2 $4,215 $2,620 $2,797 $3,359Region3 $3,289 $1,546 $2,507 $1,221Region4 $2,683 $1,555 $4,989 $3,257Region5 $1,909 $1,705 $2,378 $4,262Region6 $4,071 $3,804 $2,482 $1,500

Jan-09 Feb-09 Mar-09 Apr-09 May-09 Jun-09Product1 $4,249 $2,410 $1,739 $4,786 $2,875 $1,978Product2 $3,394 $2,284 $2,076 $2,260 $4,947 $4,954Product3 $3,071 $3,468 $4,118 $4,014 $2,363 $3,099Product4 $1,450 $1,510 $2,156 $1,904 $4,384 $4,719Product5 $2,832 $4,021 $3,151 $2,559 $4,633 $4,814Product6 $3,614 $2,384 $3,654 $2,176 $2,376 $3,902

Month Junk1 Junk2 Sales1 Sales2Jan-09 46 92 $2,954 $1,127Feb-09 6 3 $2,163 $1,193Mar-09 61 37 $2,056 $1,730Apr-09 99 18 $4,466 $3,046

May-09 62 53 $1,185 $3,540Jun-09 98 44 $3,241 $3,922

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09Jul/0

9

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

$0

$2,000

$4,000

$6,000

$8,000

$10,000

$12,000

Monthly Sales of Two Products

Sales1Sales2

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 are 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.

Region1 Region2 Region3 Region4 Region5 Region6$0

$1,000

$2,000

$3,000

$4,000

$5,000

$6,000

Product1Product2Product3Product4

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 corresponds to a product.

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.

1 2 3 4 5 60

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

Column NColumn OColumn PColumn Q

Page 151: My Excel Tutorial.xlsx

Person Height Weight1 60 1552 61 1623 62 1624 63 1625 63 1646 65 1687 70 1758 72 1999 72 215

10 76 241

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.

1 2 3 4 5 60

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

Column NColumn OColumn PColumn Q

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.) 58 60 62 64 66 68 70 72 74 76 78

0

50

100

150

200

250

300

Height versus weight

Height

Wei

ght

Page 152: My Excel Tutorial.xlsx

Sep-09 Oct-09 Nov-09 Dec-09$8,476 $9,191 $7,242 $8,277 $8,641 $10,696 $6,914 $9,004

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09Jul/0

9

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

$0

$2,000

$4,000

$6,000

$8,000

$10,000

$12,000

Monthly Sales of Two Products

Sales1Sales2

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09

Jul/09

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

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

$10,000

Sales

Page 153: My Excel Tutorial.xlsx

Region1 Region2 Region3 Region4 Region5 Region6$0

$1,000

$2,000

$3,000

$4,000

$5,000

$6,000

Product1Product2Product3Product4

1 2 3 4 5 60

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

Column NColumn OColumn PColumn Q

Page 154: My Excel Tutorial.xlsx

1 2 3 4 5 60

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

Column NColumn OColumn PColumn Q

58 60 62 64 66 68 70 72 74 76 780

50

100

150

200

250

300

Height versus weight

Height

Wei

ght

Page 155: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 156: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Month SalesJan-09 $8,627 Feb-09 $5,343 Mar-09 $6,244 Apr-09 $9,451

May-09 $6,698 Jun-09 $6,752 Jul-09 $5,985

Aug-09 $5,586 Sep-09 $8,476 Oct-09 $9,191 Nov-09 $7,242 Dec-09 $8,277

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.

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09

Jul/09

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

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

$10,000

Sales

Page 157: My Excel Tutorial.xlsx

Jan/0

9

Feb/0

9

Mar/09

Apr/09

May/0

9

Jun/09

Jul/09

Aug/09

Sep/0

9

Oct/09

Nov/09

Dec/09

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

$10,000

Sales

Page 158: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 159: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Person Sales1 Sales2Jan-09 $8,627 $23,919 Feb-09 $5,343 $19,507 Mar-09 $6,244 $34,377 Apr-09 $9,451 $30,285

May-09 $6,698 $19,673 Jun-09 $6,752 $21,007 Jul-09 $5,985 $16,644

Aug-09 $5,586 $21,022 Sep-09 $8,476 $23,928 Oct-09 $9,191 $31,403 Nov-09 $7,242 $25,333 Dec-09 $8,277 $28,071

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.

$5,000 $6,000 $7,000 $8,000 $9,000 $10,000 $0

$5,000

$10,000

$15,000

$20,000

$25,000

$30,000

$35,000

$40,000

Sales2

Sales2

5,000 6,000 7,000 8,000 9,000 10,00015,000.0

17,500.0

20,000.0

22,500.0

25,000.0

27,500.0

30,000.0

32,500.0

35,000.0

Sale of product 2 versus sales of product 1

Product 1 ($1000s)

Prod

uct 2

($10

00s)

March

Page 160: My Excel Tutorial.xlsx

$5,000 $6,000 $7,000 $8,000 $9,000 $10,000 $0

$5,000

$10,000

$15,000

$20,000

$25,000

$30,000

$35,000

$40,000

Sales2

Sales2

5,000 6,000 7,000 8,000 9,000 10,00015,000.0

17,500.0

20,000.0

22,500.0

25,000.0

27,500.0

30,000.0

32,500.0

35,000.0

Sale of product 2 versus sales of product 1

Product 1 ($1000s)

Prod

uct 2

($10

00s)

Page 161: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 [email protected], 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.

Page 162: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 [email protected], 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.

Page 163: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 (more decimals).

Page 164: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Unit cost 50Unit price 60

Demand curve (linear)Intercept 2000Slope -20

Demand 800

Profit 8000

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 (more decimals).

Page 165: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 sure you learn it!

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, except maybe to mess with your colleagues's minds!

Page 166: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 sure you learn it!

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, except maybe to mess with your colleagues's minds!

Page 167: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Let’s 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 table—the 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 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.

Page 168: My Excel Tutorial.xlsx

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.

Page 169: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Price of car $20,000 Data table Down payment $5,000 Interest rate Monthly paymentAmount financed $15,000 $459.74 Annual interest rate 6.50% 6.00%Number of payments 36 6.25%

6.50%Monthly payment $459.74 6.75%Total interest paid $1,550.46 7.00%

Price of car $20,000 Data tableDown payment $5,000 Interest Monthly payment Total interestAmount financed $15,000 $459.74 $1,550.46 Annual interest rate 6.50% 6.00%Number of payments 36 6.25%

6.50%Monthly payment $459.74 6.75%Total interest paid $1,550.46 7.00%

Price of car $20,000 Down payment $5,000

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.

Let’s 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 table—the 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 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.

Page 170: My Excel Tutorial.xlsx

Amount financed $15,000 Annual interest rate 6.50%Number of payments 36

Monthly payment $459.74 Total interest paid $1,550.46

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.

Page 171: My Excel Tutorial.xlsx

Data tableTerm Monthly payment Total interest

Page 172: My Excel Tutorial.xlsx

$459.74 $1,550.46 12243648

Page 173: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 174: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Price of car $20,000 Data table of monthly paymentDown payment $5,000 $459.74 $4,000 $5,000 $6,000 Amount financed $15,000 6.00%Annual interest rate 6.50% 6.25%Number of payments 36 6.50%

6.75%Monthly payment $459.74 7.00%Total interest paid $1,550.46

Price of car $20,000 Data table of total interest paidDown payment $5,000 Amount financed $15,000 Annual interest rate 6.50%Number of payments 36

Monthly payment $459.74 Total interest paid $1,550.46

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.)

Page 175: My Excel Tutorial.xlsx

Data table of total interest paid$1,550.46 $4,000

1224364860

Page 176: My Excel Tutorial.xlsx

Data table of total interest paid$5,000 $6,000

Page 177: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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, or2. 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.

Page 178: My Excel Tutorial.xlsx

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!

Page 179: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Person Birthdate Gender State Children Salary1 8/5/1959 Male Illinois 1 $65,4002 10/15/1977 Female Wisconsin 2 $62,0003 1/3/1981 Male Ohio 0 $63,2004 5/5/1949 Male Indiana 2 $52,0005 4/4/1987 Female Michigan 3 $81,4006 6/30/1949 Female Indiana 3 $46,3007 5/22/1949 Female Illinois 2 $49,6008 10/30/1952 Male Michigan 1 $45,9009 1/17/1957 Male Michigan 3 $47,700

10 9/18/1985 Female Indiana 1 $59,90011 7/19/1953 Male Ohio 1 $48,10012 12/10/1946 Female Wisconsin 0 $58,10013 3/29/1986 Female Michigan 2 $56,00014 12/12/1952 Female Indiana 2 $53,40015 6/12/1977 Female Indiana 2 $39,00016 11/19/1989 Male Wisconsin 1 $61,50017 9/6/1957 Male Ohio 0 $37,70018 9/30/1970 Female Michigan 2 $36,70019 10/24/1973 Male Wisconsin 2 $45,20020 6/8/1978 Male Illinois 0 $59,00021 8/27/1990 Female Ohio 2 $54,30022 2/9/1947 Male Indiana 1 $62,10023 4/1/1989 Male Michigan 0 $78,00024 3/12/1970 Male Wisconsin 0 $43,20025 3/28/1970 Male Ohio 1 $44,50026 5/6/1963 Male Michigan 1 $43,30027 5/7/1959 Male Indiana 3 $45,40028 3/6/1987 Male Michigan 2 $53,90029 2/9/1958 Male Illinois 1 $44,10030 8/4/1955 Female Ohio 2 $31,00031 11/9/1984 Male Indiana 2 $67,40032 2/10/1961 Female Ohio 1 $59,30033 4/1/1961 Female Ohio 1 $48,60034 10/20/1961 Male Illinois 0 $58,40035 4/25/1970 Male Michigan 2 $65,50036 2/17/1977 Male Michigan 0 $46,90037 4/13/1985 Male Michigan 2 $41,00038 5/16/1966 Male Ohio 0 $89,30039 10/28/1969 Female Indiana 3 $71,80040 11/30/1958 Male Illinois 1 $95,00041 9/27/1962 Male Illinois 1 $49,70042 1/25/1968 Male Ohio 2 $71,700

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, or2. 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.

Page 180: My Excel Tutorial.xlsx

43 10/15/1988 Female Wisconsin 0 $52,90044 2/11/1978 Female Michigan 0 $58,30045 6/19/1974 Male Indiana 2 $82,00046 9/22/1989 Male Wisconsin 0 $41,30047 7/25/1983 Female Wisconsin 1 $72,00048 4/9/1956 Female Indiana 2 $73,50049 2/9/1989 Male Ohio 2 $55,20050 12/10/1960 Female Michigan 1 $57,00051 8/6/1956 Male Michigan 2 $84,30052 9/20/1981 Male Indiana 2 $68,90053 1/31/1963 Male Wisconsin 2 $59,00054 12/7/1973 Female Ohio 0 $83,20055 12/3/1988 Male Wisconsin 0 $52,400

Month Product1 Product2Jan-08 $2,508 $2,244Feb-08 $3,094 $2,729Mar-08 $1,934 $4,558Apr-08 $2,752 $2,485

May-08 $4,580 $4,006Jun-08 $4,088 $1,493Jul-08 $1,291 $3,827

Aug-08 $4,938 $1,549Sep-08 $4,776 $4,962Oct-08 $2,879 $3,413Nov-08 $1,619 $1,165Dec-08 $4,609 $4,434Jan-09 $4,184 $1,018Feb-09 $3,301 $4,003Mar-09 $1,437 $3,383Apr-09 $2,273 $4,730

May-09 $1,766 $3,529Jun-09 $4,872 $3,845Jul-09 $3,638 $3,407

Aug-09 $4,938 $1,199Sep-09 $2,136 $1,739Oct-09 $3,747 $1,034

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!

Page 181: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 possibilities.

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:

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!

Page 182: My Excel Tutorial.xlsx

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.

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."

Page 183: My Excel Tutorial.xlsx

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.

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.

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 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.

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!

Page 184: My Excel Tutorial.xlsx

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 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.

Page 185: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Date Day Time Region Paid With Gender Items Ordered10-Mar Mon Morning West VISA Female 410-Mar Mon Morning West Mastercard Female 110-Mar Mon Afternoon West VISA Female 510-Mar Mon Afternoon NorthEast VISA Female 110-Mar Mon Afternoon West Mastercard Male 410-Mar Mon Afternoon NorthEast VISA Female 511-Mar Tues Evening West Mastercard Male 111-Mar Tues Evening South VISA Male 411-Mar Tues Evening West Cash Male 212-Mar Wed Morning MidWest Mastercard Female 112-Mar Wed Morning NorthEast Mastercard Female 212-Mar Wed Afternoon South VISA Male 213-Mar Thurs Morning NorthEast VISA Male 313-Mar Thurs Afternoon NorthEast Mastercard Male 114-Mar Fri Morning West Mastercard Female 314-Mar Fri Afternoon West VISA Male 514-Mar Fri Afternoon South Cash Female 614-Mar Fri Afternoon West VISA Female 415-Mar Sat Morning South Mastercard Male 115-Mar Sat Afternoon South Cash Male 116-Mar Sun Morning West VISA Male 416-Mar Sun Afternoon West VISA Male 216-Mar Sun Evening West Mastercard Female 917-Mar Mon Afternoon South VISA Female 117-Mar Mon Evening West VISA Male 318-Mar Tues Morning NorthEast Mastercard Female 518-Mar Tues Afternoon South Mastercard Male 318-Mar Tues Evening MidWest Mastercard Male 319-Mar Wed Afternoon MidWest VISA Male 119-Mar Wed Afternoon South Cash Female 220-Mar Thurs Morning West Mastercard Female 320-Mar Thurs Afternoon NorthEast VISA Male 420-Mar Thurs Afternoon NorthEast VISA Female 220-Mar Thurs Evening West VISA Female 221-Mar Fri Morning West VISA Female 721-Mar Fri Afternoon South Mastercard Female 221-Mar Fri Evening NorthEast VISA Male 422-Mar Sat Morning NorthEast Mastercard Female 222-Mar Sat Morning MidWest Mastercard Male 222-Mar Sat Morning NorthEast Cash Female 822-Mar Sat Evening West VISA Male 422-Mar Sat Evening West Mastercard Male 622-Mar Sat Evening West Cash Female 122-Mar Sat Evening West VISA Male 223-Mar Sun Afternoon MidWest VISA Female 1

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 possibilities.

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:

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!

Page 186: My Excel Tutorial.xlsx

24-Mar Mon Morning South Mastercard Female 324-Mar Mon Morning NorthEast Mastercard Female 624-Mar Mon Afternoon South Mastercard Female 124-Mar Mon Afternoon West Mastercard Female 324-Mar Mon Afternoon South Cash Female 225-Mar Tues Morning West Mastercard Female 225-Mar Tues Afternoon South Mastercard Female 525-Mar Tues Evening West Cash Male 426-Mar Wed Morning West VISA Female 227-Mar Thurs Morning West Mastercard Female 427-Mar Thurs Afternoon West Cash Female 828-Mar Fri Morning NorthEast Mastercard Female 128-Mar Fri Afternoon South Mastercard Female 128-Mar Fri Afternoon West Mastercard Male 328-Mar Fri Evening NorthEast VISA Male 229-Mar Sat Morning NorthEast VISA Female 229-Mar Sat Morning NorthEast Cash Male 429-Mar Sat Morning MidWest Mastercard Male 329-Mar Sat Morning NorthEast Mastercard Female 329-Mar Sat Afternoon NorthEast Cash Female 329-Mar Sat Afternoon MidWest Cash Male 229-Mar Sat Afternoon South VISA Female 129-Mar Sat Afternoon MidWest VISA Male 429-Mar Sat Evening NorthEast Cash Male 429-Mar Sat Evening South VISA Female 230-Mar Mon Afternoon South Mastercard Female 230-Mar Mon Evening West VISA Female 231-Mar Wed Afternoon South VISA Female 731-Mar Wed Afternoon MidWest Mastercard Male 531-Mar Wed Evening West Mastercard Male 631-Mar Wed Evening NorthEast Cash Male 2

1-Apr Thurs Morning NorthEast Cash Male 41-Apr Thurs Afternoon West Mastercard Female 91-Apr Thurs Afternoon NorthEast Cash Female 61-Apr Thurs Afternoon West Mastercard Female 12-Apr Fri Morning MidWest Mastercard Female 32-Apr Fri Afternoon MidWest Mastercard Female 22-Apr Fri Afternoon NorthEast VISA Female 62-Apr Fri Afternoon NorthEast Mastercard Female 33-Apr Sat Morning South VISA Female 43-Apr Sat Afternoon South Mastercard Male 33-Apr Sat Afternoon West VISA Female 23-Apr Sat Evening NorthEast Mastercard Male 34-Apr Sun Morning MidWest VISA Female 14-Apr Sun Afternoon South Cash Male 35-Apr Mon Morning NorthEast VISA Male Low5-Apr Mon Afternoon MidWest VISA Male Low5-Apr Mon Afternoon MidWest Mastercard Female Low

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.

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."

Page 187: My Excel Tutorial.xlsx

5-Apr Mon Afternoon NorthEast Mastercard Female Low5-Apr Mon Evening NorthEast VISA Female Low6-Apr Tues Morning NorthEast Cash Female Low6-Apr Tues Afternoon NorthEast VISA Female Low6-Apr Tues Afternoon South Mastercard Female Medium6-Apr Tues Evening MidWest Mastercard Female High7-Apr Wed Evening West VISA Male Low8-Apr Thurs Morning NorthEast VISA Male Low8-Apr Thurs Morning West Cash Female High8-Apr Thurs Morning West Mastercard Female Low8-Apr Thurs Evening MidWest Cash Male Low9-Apr Fri Morning West VISA Male Medium9-Apr Fri Morning NorthEast Mastercard Male Low9-Apr Fri Morning West Mastercard Male Low9-Apr Fri Morning NorthEast Mastercard Female High9-Apr Fri Morning West Cash Male High

10-Apr Sat Morning South Mastercard Female Low10-Apr Sat Morning MidWest Cash Female Low10-Apr Sat Afternoon MidWest Mastercard Male Medium10-Apr Sat Afternoon South Mastercard Female High10-Apr Sat Evening NorthEast Cash Male Low10-Apr Sat Evening MidWest VISA Male Low11-Apr Sun Afternoon West VISA Female High12-Apr Tues Morning MidWest Mastercard Female High12-Apr Tues Morning NorthEast Mastercard Female High12-Apr Tues Afternoon South Mastercard Female High12-Apr Tues Afternoon NorthEast Mastercard Female High13-Apr Wed Afternoon South Mastercard Female High14-Apr Fri Morning South Cash Female Medium14-Apr Fri Afternoon MidWest Mastercard Male Medium14-Apr Fri Afternoon West VISA Female High15-Apr Sat Morning South Cash Male Low15-Apr Sat Morning MidWest VISA Female Medium15-Apr Sat Morning MidWest VISA Female Low15-Apr Sat Afternoon West VISA Male Medium15-Apr Sat Afternoon NorthEast Cash Female Low15-Apr Sat Evening MidWest Cash Female High15-Apr Sat Evening West Mastercard Female High16-Apr Sun Afternoon West Cash Male High16-Apr Sun Afternoon NorthEast Cash Female Low16-Apr Sun Evening South Mastercard Female Low17-Apr Mon Morning MidWest VISA Female Low17-Apr Mon Afternoon West VISA Female Low17-Apr Mon Evening West Cash Male High18-Apr Tues Morning South VISA Female Medium18-Apr Tues Afternoon NorthEast VISA Female Medium18-Apr Tues Evening NorthEast Mastercard Male Medium19-Apr Wed Morning MidWest Mastercard Female Medium

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.

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.

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 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.

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!

Page 188: My Excel Tutorial.xlsx

19-Apr Wed Afternoon MidWest Mastercard Female Low19-Apr Wed Evening NorthEast Mastercard Male Low20-Apr Thurs Afternoon NorthEast Cash Male Medium20-Apr Thurs Evening South VISA Male High20-Apr Thurs Evening West VISA Male Low21-Apr Fri Morning West VISA Female Medium21-Apr Fri Afternoon NorthEast Mastercard Female High21-Apr Fri Afternoon NorthEast Cash Female Low21-Apr Fri Afternoon NorthEast VISA Female High22-Apr Sat Morning South Cash Male Medium22-Apr Sat Afternoon MidWest Mastercard Female Medium22-Apr Sat Evening NorthEast Mastercard Male High23-Apr Sun Morning South VISA Female Medium23-Apr Sun Afternoon South Cash Female Low24-Apr Mon Morning South Mastercard Female High24-Apr Mon Morning West Mastercard Female High24-Apr Mon Afternoon NorthEast VISA Female High24-Apr Mon Afternoon South VISA Female High24-Apr Mon Evening South Cash Male High24-Apr Mon Evening South VISA Female High25-Apr Tues Morning West Mastercard Female Medium25-Apr Tues Evening NorthEast Mastercard Male High26-Apr Wed Morning West VISA Female Medium26-Apr Wed Morning South Cash Male High26-Apr Wed Afternoon MidWest Cash Female High27-Apr Thurs Morning MidWest VISA Female High27-Apr Thurs Evening South VISA Male High27-Apr Thurs Evening NorthEast Mastercard Male Medium28-Apr Fri Afternoon West Mastercard Female High28-Apr Fri Afternoon South Mastercard Female Low28-Apr Fri Evening NorthEast VISA Male Low28-Apr Fri Evening NorthEast VISA Female Low29-Apr Sat Morning NorthEast VISA Male Low29-Apr Sat Morning MidWest Mastercard Male High29-Apr Sat Afternoon West Mastercard Male Low29-Apr Sat Evening South VISA Male High29-Apr Sat Evening MidWest Mastercard Male Medium29-Apr Sat Evening MidWest Mastercard Female Medium29-Apr Sat Evening West VISA Male Low30-Apr Sun Morning West Mastercard Female High30-Apr Sun Afternoon South Mastercard Female High30-Apr Sun Evening NorthEast Mastercard Male High1-May Mon Afternoon NorthEast VISA Female Medium2-May Tues Evening NorthEast Cash Male Medium3-May Wed Afternoon West Mastercard Female Low3-May Wed Afternoon South VISA Female High4-May Thurs Evening West VISA Female High5-May Fri Morning NorthEast VISA Female Medium

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 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.

Page 189: My Excel Tutorial.xlsx

5-May Fri Afternoon NorthEast VISA Female Low6-May Sat Morning West VISA Female Low6-May Sat Morning MidWest Mastercard Male Low6-May Sat Morning West Cash Female Low6-May Sat Morning South VISA Female Low6-May Sat Morning West Mastercard Male Medium6-May Sat Afternoon MidWest Mastercard Female Low6-May Sat Afternoon NorthEast Cash Female Medium6-May Sat Evening NorthEast Mastercard Male Low6-May Sat Evening West VISA Male Low6-May Sat Evening West Mastercard Female Low7-May Sun Evening NorthEast Mastercard Female Medium7-May Sun Evening MidWest Cash Female Low8-May Mon Morning West VISA Female Low8-May Mon Afternoon South VISA Female Medium8-May Mon Evening South Cash Male Medium8-May Mon Evening South Mastercard Male Medium8-May Mon Evening West VISA Male Medium8-May Mon Evening West Mastercard Male Low9-May Tues Morning West Cash Male High9-May Tues Afternoon South Mastercard Female High9-May Tues Evening West VISA Male High9-May Tues Evening South Mastercard Female Medium

10-May Wed Morning MidWest Mastercard Female High10-May Wed Afternoon MidWest VISA Female Low11-May Thurs Afternoon West Mastercard Female High11-May Thurs Evening MidWest Cash Male Medium12-May Fri Morning West Mastercard Female Medium12-May Fri Evening NorthEast VISA Male High13-May Sat Morning South Cash Male Low13-May Sat Afternoon West VISA Male Low13-May Sat Evening South Mastercard Female High13-May Sat Evening NorthEast Cash Male High14-May Sun Evening NorthEast VISA Female Low15-May Mon Morning West Mastercard Female Low15-May Mon Morning NorthEast VISA Female Low15-May Mon Afternoon South VISA Female Low15-May Mon Afternoon NorthEast Mastercard Female Low15-May Mon Afternoon South Mastercard Female High15-May Mon Afternoon South VISA Female Medium15-May Mon Evening West VISA Male Low16-May Tues Morning West VISA Male Medium16-May Tues Afternoon MidWest Mastercard Female Medium16-May Tues Evening NorthEast Mastercard Female High16-May Tues Evening South Mastercard Male High17-May Thurs Morning South Mastercard Female High17-May Thurs Morning NorthEast Mastercard Female High17-May Thurs Evening South VISA Male High

Page 190: My Excel Tutorial.xlsx

17-May Thurs Evening MidWest Mastercard Female Low18-May Fri Morning South Mastercard Male Low18-May Fri Afternoon MidWest VISA Male High18-May Fri Evening South VISA Male Medium19-May Sat Morning MidWest Mastercard Male Medium19-May Sat Morning MidWest Cash Female High19-May Sat Morning West Mastercard Male Medium19-May Sat Morning South Mastercard Male Low19-May Sat Afternoon West Cash Female Low19-May Sat Afternoon MidWest Cash Female Medium19-May Sat Afternoon South Cash Female High19-May Sat Afternoon South VISA Female High19-May Sat Afternoon NorthEast Mastercard Male Low19-May Sat Evening MidWest Cash Female Medium20-May Sun Afternoon West Cash Female Medium21-May Mon Afternoon West VISA Female Low21-May Mon Afternoon West VISA Male Low21-May Mon Evening NorthEast VISA Male Medium21-May Mon Evening West Cash Male Medium22-May Tues Morning West Mastercard Male Low22-May Tues Afternoon South Cash Female Medium22-May Tues Afternoon South Mastercard Female Low22-May Tues Afternoon NorthEast VISA Female High22-May Tues Afternoon NorthEast VISA Female High22-May Tues Evening West Cash Male Low23-May Wed Evening West Mastercard Male Medium24-May Thurs Morning South VISA Female Low24-May Thurs Afternoon West Mastercard Male Low24-May Thurs Afternoon NorthEast Cash Female High25-May Fri Morning South VISA Female Medium25-May Fri Afternoon NorthEast Mastercard Male High25-May Fri Afternoon West VISA Female High26-May Sat Morning NorthEast Mastercard Male High26-May Sat Afternoon MidWest Mastercard Female High26-May Sat Evening West VISA Female Medium26-May Sat Evening MidWest VISA Male Medium27-May Mon Afternoon South Mastercard Female Medium27-May Mon Evening West VISA Male High28-May Tues Morning MidWest VISA Female Medium28-May Tues Evening South VISA Male Medium29-May Wed Evening South Mastercard Male High29-May Wed Evening MidWest Mastercard Male Low30-May Thurs Morning NorthEast VISA Female High30-May Thurs Morning West Mastercard Female Medium30-May Thurs Afternoon NorthEast VISA Female Medium30-May Thurs Evening South Mastercard Female Low31-May Fri Morning NorthEast Mastercard Female Medium31-May Fri Morning MidWest Mastercard Female High

Page 191: My Excel Tutorial.xlsx

31-May Fri Morning South Mastercard Female Low31-May Fri Afternoon South VISA Female High31-May Fri Evening NorthEast VISA Male Low

1-Jun Sat Afternoon NorthEast Mastercard Female High1-Jun Sat Afternoon West VISA Female High1-Jun Sat Afternoon NorthEast VISA Male Low1-Jun Sat Evening MidWest Mastercard Male Medium1-Jun Sat Evening South Mastercard Female Medium1-Jun Sat Evening NorthEast Mastercard Male Medium1-Jun Sat Evening MidWest VISA Female Medium1-Jun Sat Evening South VISA Female Low2-Jun Sun Morning MidWest Cash Female Low2-Jun Sun Evening South VISA Female Low3-Jun Mon Afternoon NorthEast Cash Female Low3-Jun Mon Evening South Mastercard Female Low4-Jun Tues Morning NorthEast Mastercard Male Low4-Jun Tues Morning NorthEast Mastercard Female Medium4-Jun Tues Evening West VISA Female High4-Jun Tues Evening West Cash Male Low4-Jun Tues Evening West VISA Female Medium5-Jun Wed Evening NorthEast VISA Male Medium6-Jun Thurs Morning NorthEast Mastercard Female Medium6-Jun Thurs Evening West VISA Male Low7-Jun Fri Morning West VISA Female Low7-Jun Fri Afternoon MidWest VISA Female Low7-Jun Fri Afternoon West VISA Female Low7-Jun Fri Evening NorthEast Cash Male High8-Jun Sat Morning NorthEast Mastercard Male High8-Jun Sat Evening MidWest Mastercard Female High8-Jun Sat Evening West Cash Male Low8-Jun Sat Evening NorthEast Mastercard Male Low9-Jun Sun Afternoon NorthEast Cash Male Medium

10-Jun Mon Afternoon West VISA Female Medium10-Jun Mon Afternoon West Cash Female High10-Jun Mon Afternoon NorthEast Cash Female High10-Jun Mon Evening MidWest Cash Male High10-Jun Mon Evening West VISA Male Low10-Jun Mon Evening NorthEast VISA Male High11-Jun Tues Afternoon MidWest Mastercard Female Low11-Jun Tues Afternoon NorthEast VISA Male Low11-Jun Tues Afternoon MidWest Cash Female Medium11-Jun Tues Evening MidWest Mastercard Male Low11-Jun Tues Evening South Mastercard Male Medium12-Jun Wed Morning South Mastercard Female High12-Jun Wed Evening NorthEast Cash Male Low12-Jun Wed Evening West Mastercard Male High12-Jun Wed Evening West Cash Male Low13-Jun Thurs Morning South VISA Male Low

Page 192: My Excel Tutorial.xlsx

13-Jun Thurs Morning MidWest VISA Female High13-Jun Thurs Afternoon West VISA Male Medium14-Jun Fri Afternoon NorthEast VISA Female Low14-Jun Fri Afternoon South Mastercard Male Low14-Jun Fri Afternoon West Mastercard Female Low14-Jun Fri Afternoon MidWest VISA Male Low14-Jun Fri Evening West Mastercard Female Low15-Jun Sat Morning South Cash Female Medium15-Jun Sat Morning West VISA Male Medium15-Jun Sat Morning NorthEast VISA Male Medium15-Jun Sat Afternoon NorthEast VISA Male High15-Jun Sat Afternoon MidWest Cash Female Low16-Jun Sun Morning MidWest Mastercard Male Low17-Jun Mon Morning West VISA Female High17-Jun Mon Afternoon South VISA Female High18-Jun Tues Afternoon NorthEast Mastercard Female Low18-Jun Tues Evening West Mastercard Male Low19-Jun Wed Evening South Cash Female Medium19-Jun Wed Evening South VISA Male Low19-Jun Wed Evening MidWest Cash Male Low20-Jun Thurs Morning West VISA Female Low21-Jun Fri Morning MidWest VISA Female Low21-Jun Fri Morning South Mastercard Female High21-Jun Fri Afternoon West Mastercard Male Low21-Jun Fri Afternoon NorthEast Mastercard Female High21-Jun Fri Afternoon West Mastercard Female Low21-Jun Fri Evening South Mastercard Male Low21-Jun Fri Evening West Cash Male Medium22-Jun Sat Morning West Mastercard Female High22-Jun Sat Morning NorthEast Mastercard Male Low22-Jun Sat Afternoon NorthEast VISA Male Low22-Jun Sat Evening NorthEast VISA Female High23-Jun Sun Morning NorthEast Mastercard Male Medium23-Jun Sun Morning South Cash Female Medium23-Jun Sun Afternoon West Mastercard Male Medium23-Jun Sun Evening NorthEast VISA Male Medium23-Jun Sun Evening NorthEast Mastercard Male High23-Jun Sun Evening West Mastercard Male Low23-Jun Sun Evening South Mastercard Male High24-Jun Mon Morning NorthEast VISA Female Low24-Jun Mon Afternoon MidWest VISA Female Medium24-Jun Mon Afternoon NorthEast Mastercard Female Low25-Jun Tues Morning NorthEast Mastercard Female Low25-Jun Tues Afternoon West Cash Female High25-Jun Tues Afternoon South VISA Female High26-Jun Wed Morning MidWest Mastercard Female High26-Jun Wed Morning South Mastercard Female Low26-Jun Wed Morning South Cash Female Low

Page 193: My Excel Tutorial.xlsx

26-Jun Wed Afternoon NorthEast VISA Female Low26-Jun Wed Afternoon West Mastercard Female Medium26-Jun Wed Afternoon West Mastercard Female Low26-Jun Wed Evening NorthEast Mastercard Male High27-Jun Thurs Morning West VISA Female Medium27-Jun Thurs Morning South Mastercard Female Medium27-Jun Thurs Evening West Cash Male High28-Jun Fri Morning West Cash Female Low28-Jun Fri Morning West VISA Female Medium28-Jun Fri Morning MidWest Mastercard Male Medium28-Jun Fri Afternoon West Mastercard Female Medium28-Jun Fri Afternoon MidWest Mastercard Female Medium28-Jun Fri Afternoon NorthEast VISA Female High29-Jun Sat Morning MidWest VISA Male Low29-Jun Sat Afternoon NorthEast VISA Male Medium29-Jun Sat Afternoon NorthEast Cash Female Medium29-Jun Sat Afternoon West Mastercard Male Medium29-Jun Sat Afternoon NorthEast VISA Male Medium29-Jun Sat Afternoon NorthEast VISA Female Low

Page 194: My Excel Tutorial.xlsx

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 $47.86

Page 195: My Excel Tutorial.xlsx

$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 2 $54.96 1 $65.11

Page 196: My Excel Tutorial.xlsx

3 $76.69 2 $48.38 5 $76.64 2 $54.08 3 $130.00 4 $218.29 1 $38.10 4 $100.02 4 $248.73 2 $25.80 1 $52.83 3 $131.89 3 $82.69 1 $70.03 1 $102.86 4 $174.13 2 $49.80 2 $29.97 2 $82.53 4 $142.76 2 $72.58 2 $55.39 4 $206.39 4 $245.67 5 $265.69 3 $124.46 6 $206.26 7 $306.23 1 $48.12 4 $113.95 6 $261.44 2 $59.90 2 $49.73 3 $65.06 4 $97.71 1 $49.84 6 $233.94 9 $370.26 6 $313.11 6 $141.77 1 $27.99 3 $81.34 2 $97.15 7 $352.49 3 $88.75 4 $107.95 5 $186.22 4 $159.23

Page 197: My Excel Tutorial.xlsx

2 $82.43 4 $99.42 3 $79.32 3 $160.01 2 $51.99 8 $267.67 9 $429.22 1 $46.20 5 $240.02 4 $157.14 5 $140.40 5 $204.93 2 $88.18 3 $95.47 5 $224.73 8 $344.73 4 $185.32 6 $297.31 4 $223.32 3 $164.40 2 $123.57 5 $236.97 2 $82.75 6 $307.75 4 $200.73 4 $242.06 4 $215.09 3 $162.90 5 $214.31 1 $42.07 2 $69.05 4 $148.90 4 $105.74 3 $138.32 2 $61.71 3 $120.11 1 $72.80 2 $134.86 4 $89.75 4 $220.04 3 $168.39 6 $277.80 3 $130.49 2 $94.39 4 $120.48 6 $304.95 9 $389.79 4 $161.08

Page 198: My Excel Tutorial.xlsx

2 $69.61 3 $59.99 2 $120.78 3 $82.30 2 $91.88 1 $87.10 2 $70.10 2 $106.67 1 $34.31 3 $77.69 2 $85.31 1 $65.92 1 $89.98 3 $102.07 4 $199.83 3 $134.21 4 $188.41 4 $102.72 2 $85.63 4 $206.87 2 $141.22

10 $463.40 5 $166.54 6 $260.62 1 $79.16 6 $320.40 2 $79.01 2 $126.22 5 $263.45 3 $135.86 1 $98.74 1 $101.05 7 $361.60 3 $120.56 1 $52.68 3 $99.51 1 $85.29 3 $143.59 3 $197.13 3 $190.74 3 $111.44 3 $153.39 2 $65.40 9 $448.20 2 $123.19 5 $210.28 7 $349.46 4 $290.63

Page 199: My Excel Tutorial.xlsx

3 $103.03 2 $112.54 8 $399.36 2 $68.18 3 $146.58 6 $309.50 5 $177.96 2 $119.46 3 $119.66 4 $168.87 4 $192.39 2 $101.73 2 $74.94 8 $291.30 3 $161.00 3 $116.01 2 $74.39 4 $226.25 3 $135.19 4 $126.16 4 $156.30 3 $73.42 7 $310.74 6 $296.26 2 $115.29 4 $212.94 2 $85.93 2 $80.02 5 $286.17 4 $190.27 5 $265.24 7 $353.93 5 $314.77 2 $169.23 3 $149.71 2 $105.35 2 $111.47 9 $441.16 5 $179.56 2 $83.15 4 $262.86 2 $82.51 5 $290.27 5 $223.08 3 $165.77 2 $99.81 3 $158.95 5 $280.99

Page 200: My Excel Tutorial.xlsx

4 $149.89 7 $363.52 2 $93.97 8 $391.97 5 $275.54 1 $115.55 3 $125.00 1 $103.15 9 $256.70 1 $117.99 2 $98.55 2 $112.93 2 $76.30 2 $129.80 3 $140.25 3 $149.79 4 $172.20 3 $139.85 1 $96.46 3 $127.83 6 $215.88 2 $133.49 2 $117.33 2 $107.98 6 $203.11 5 $193.33 7 $343.26

11 $485.01 4 $221.93 2 $94.04 1 $113.37 5 $188.26 4 $170.19 4 $224.15 7 $352.32 4 $257.18 2 $122.06 4 $239.95 3 $124.44 4 $116.58 2 $154.46 1 $76.92 4 $194.85 6 $367.70 1 $119.50 7 $270.94 2 $94.71 4 $154.01

Page 201: My Excel Tutorial.xlsx

5 $313.30 7 $217.99 3 $127.22 1 $135.97 1 $87.14 2 $96.77 1 $74.74 1 $117.48 2 $132.89 5 $230.26

10 $451.03 3 $153.31 3 $117.79 7 $357.32 7 $374.17 3 $122.28 2 $122.57 2 $134.59 1 $134.98 1 $109.45 3 $131.52 1 $88.76 2 $174.28 1 $100.70 7 $387.43 3 $160.71 1 $105.91 1 $101.46 5 $271.67 1 $112.74 1 $96.42 6 $271.48 2 $156.79 5 $249.63 6 $278.62 2 $84.46 3 $221.17 4 $194.79 4 $199.22 2 $141.70 4 $191.15 2 $142.41 3 $134.53 7 $374.37 3 $241.73 4 $278.58 1 $106.25 3 $115.71

Page 202: My Excel Tutorial.xlsx

1 $78.34 4 $216.03 2 $140.01 8 $458.51 4 $210.60 4 $189.49 7 $359.42 3 $132.06 5 $252.33 2 $172.05 4 $206.19 2 $143.98 4 $276.67 1 $111.67 6 $268.39 3 $169.11 6 $242.46 4 $168.64 1 $107.59

Page 203: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 on Manage Rules.

As you can see when you click on the Conditional Formatting dropdown, there are a lot of "built-in" 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.

Page 204: My Excel Tutorial.xlsx

As you can see when you click on the Conditional Formatting dropdown, there are a lot of "built-in" 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.

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 rows in the MAX function are made absolute because the maximum is always over these rows.

Page 205: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Exam score Cutoffs for extremes62 High 9488 Low 667762946873619994888287658270948096

Person Birthdate Gender State Children Salary1 8/5/1959 Male Indiana 1 $65,4002 10/15/1977 Female Michigan 2 $62,0003 1/3/1981 Male Illinois 0 $63,2004 5/5/1949 Male Wisconsin 2 $52,0005 4/4/1987 Female Michigan 3 $81,4006 6/30/1949 Female Wisconsin 3 $46,3007 5/22/1949 Female Ohio 2 $49,6008 10/30/1952 Male Ohio 1 $45,9009 1/17/1957 Male Illinois 3 $47,700

10 9/18/1985 Female Indiana 1 $59,90011 7/19/1953 Male Illinois 1 $48,10012 12/10/1946 Female Michigan 0 $58,10013 3/29/1986 Female Wisconsin 2 $56,00014 12/12/1952 Female Illinois 2 $53,40015 6/12/1977 Female Illinois 2 $39,00016 11/19/1989 Male Ohio 1 $61,50017 9/6/1957 Male Ohio 0 $37,70018 9/30/1970 Female Michigan 2 $36,70019 10/24/1973 Male Illinois 2 $45,20020 6/8/1978 Male Ohio 0 $59,00021 8/27/1990 Female Ohio 2 $54,30022 2/9/1947 Male Illinois 1 $62,10023 4/1/1989 Male Wisconsin 0 $78,00024 3/12/1970 Male Ohio 0 $43,200

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 on Manage Rules.

As you can see when you click on the Conditional Formatting dropdown, there are a lot of "built-in" 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.

Page 206: My Excel Tutorial.xlsx

25 3/28/1970 Male Indiana 1 $44,50026 5/6/1963 Male Michigan 1 $43,30027 5/7/1959 Male Ohio 3 $45,40028 3/6/1987 Male Indiana 2 $53,90029 2/9/1958 Male Michigan 1 $44,10030 8/4/1955 Female Indiana 2 $31,000

Month Region1 Region2 Region3 Region4 Region5 Region6Jan-09 $4,656 $2,708 $2,760 $3,347 $1,237 $3,313Feb-09 $1,687 $1,404 $4,064 $1,278 $3,354 $1,051Mar-09 $2,527 $4,610 $4,667 $3,520 $1,390 $1,259Apr-09 $3,950 $1,788 $1,140 $4,215 $1,061 $2,622

May-09 $1,974 $4,509 $1,757 $4,440 $1,487 $1,069Jun-09 $3,109 $2,408 $1,492 $4,581 $1,340 $2,654Jul-09 $1,891 $1,667 $2,539 $1,854 $1,273 $1,148

Aug-09 $2,480 $1,875 $1,630 $2,088 $2,628 $2,599Sep-09 $3,914 $3,290 $2,066 $3,896 $1,633 $4,048Oct-09 $3,856 $4,450 $3,428 $2,873 $2,138 $4,455Nov-09 $3,730 $1,026 $2,733 $4,254 $3,355 $4,898Dec-09 $2,823 $2,539 $4,908 $4,019 $1,148 $3,620

As you can see when you click on the Conditional Formatting dropdown, there are a lot of "built-in" 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.

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 rows in the MAX function are made absolute because the maximum is always over these rows.

Page 207: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 inappropriate values in the gray cells.

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.

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.)

Page 208: My Excel Tutorial.xlsx

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.

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.)

Page 209: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

any integer between 1 and 10any decimal number between 1 and 10any positive integerany negative decimal numberany integer between the values in cells N25 and O25

30 40

Amount financed $25,000Interest rate 6.25%TermMonthy payment #NUM!

Date of loan

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 inappropriate values in the gray cells.

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.

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.)

Page 210: My Excel Tutorial.xlsx

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.

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.)

Page 211: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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!

Page 212: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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!

Page 213: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 214: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.

Page 215: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 216: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Student Gender Age Exam score1 Male 18 622 Female 21 733 Female 18 744 Female 185 Male 18 776 Female 20 577 Female 18 678 Male 19 909 Male 19 77

10 Male 22 8311 Female 20 7112 Female 20 7513 Female 20 7214 Female 24 8215 Female 18 6816 Male 18 8617 Female 24 7718 Male 21 6819 Male 20 8620 Female 2121 Male 20 8022 Female 18 8123 Male 20 8424 Female 19 7125 Female 18 7626 Male 21 8127 Female 18 9928 Male 20 7229 Female 18 7830 Female 21 6731 Female 21 8932 Female 19 7033 Female 19 7734 Female 1835 Male 22 8336 Female 19 7437 Male 19 8738 Male 18 7539 Male 20 8640 Male 21 7741 Male 20 7342 Male 20 7443 Female 20 7944 Male 18 8045 Male 20 77

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.)

Page 217: My Excel Tutorial.xlsx

46 Female 21 7247 Male 19 7748 Male 19 7149 Female 23 7050 Female 19 6851 Female 24 7952 Male 19 7553 Male 18 8054 Female 19 7355 Female 21 6156 Female 21 6257 Male 19 6858 Male 19 9259 Female 20 8560 Male 22 7761 Female 19 7962 Male 20 8663 Female 19 8364 Male 19 8365 Male 18 7666 Female 24 8967 Female 18 7268 Female 21 6969 Male 23 6670 Male 24 7171 Male 20 8072 Female 18 61

Page 218: My Excel Tutorial.xlsx

Gender condition MaleAge cutoff 20Exam score cutoff 87

# of "high" scores

Sum of scores for malesAverage of scores for malesSum of scores for "young" peopleAverage of scores for "young" peopleSum of scores for "old" peopleAverage of scores for "old" people

Page 219: My Excel Tutorial.xlsx

6

266078.235

252776.576

273375.917

Page 220: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 for the answer.)

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.

Page 221: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Student Gender Age Exam score Gender condition1 Male 18 62 Age cutoff2 Female 21 73 Exam score cutoff3 Female 18 14 Female 18 65 COUNTIFS question5 Male 18 776 Female 20 57 SUMIFS question7 Female 18 67 AVERAGEIFS question8 Male 19 909 Male 19 77

10 Male 22 8311 Female 20 7112 Female 20 7513 Female 20 7214 Female 24 8215 Female 18 6816 Male 18 8617 Female 24 7718 Male 21 6819 Male 20 8620 Female 21 8921 Male 20 8022 Female 18 8123 Male 20 8424 Female 19 7125 Female 18 7626 Male 21 8127 Female 18 9928 Male 20 7229 Female 18 7830 Female 21 6731 Female 21 8932 Female 19 7033 Female 19 7734 Female 18 7935 Male 22 8336 Female 19 7437 Male 19 8738 Male 18 7539 Male 20 8640 Male 21 7741 Male 20 7342 Male 20 7443 Female 20 7944 Male 18 8045 Male 20 77

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 for the answer.)

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.

Page 222: My Excel Tutorial.xlsx

46 Female 21 7247 Male 19 7748 Male 19 7149 Female 23 7050 Female 19 6851 Female 24 7952 Male 19 7553 Male 18 8054 Female 19 7355 Female 21 6156 Female 21 6257 Male 19 6858 Male 19 9259 Female 20 8560 Male 22 7761 Female 19 7962 Male 20 8663 Female 19 8364 Male 19 8365 Male 18 7666 Female 24 8967 Female 18 7268 Female 21 6969 Male 23 6670 Male 24 7171 Male 20 8072 Female 18 61

Page 223: My Excel Tutorial.xlsx

Female2087

Page 224: My Excel Tutorial.xlsx

18

134270.632

Page 225: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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!

Page 226: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Unit shipping costs City1 City2 City3Plant1 1.25 1.35 1.55Plant2 1.15 1.45 1.25Plant3 1.35 1.45 1.15

Units shipped City1 City2 City3Plant1 155 180 0Plant2 250 130 185Plant3 0 210 140

Total cost

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!

Page 227: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 228: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.

Page 229: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 efficiency!)

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 check that you can do arithmetic on the values in column M.

Page 230: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Bob Jane Justin Lindsay George Sam Christine Tom Jenny Doug

19653612579345

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 efficiency!)

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 check that you can do arithmetic on the values in column M.

Page 231: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 in 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 CONCATENATE function.

Page 232: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Bob E JonesStephen C DavisAndy T ThompsonJohn F WilsonKathy C FredericksKaren D WilliamsTom T SmithPeter F JenningsTed R BensonJason E Samson

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 in 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 CONCATENATE function.

Page 233: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

Suppose, for example, that someone has given you a spreadsheet such as the one to the right. Each cell in column L has a person’s 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” isn’t 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:

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 functions—FIND, LEN, RIGHT, LEFT, and MID—you can do some powerful text manipulation in Excel, and this can save hours of tedious typing. You will be the hero at your office!

Page 234: My Excel Tutorial.xlsx

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” isn’t 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:

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 functions—FIND, LEN, RIGHT, LEFT, and MID—you can do some powerful text manipulation in Excel, and this can save hours of tedious typing. You will be the hero at your office!

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 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!

Page 235: My Excel Tutorial.xlsx

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 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!

Page 236: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Jones, Bob Bob JonesDavis, StephenThompson, AndyWilson, JohnFredericks, KathyWilliams, KarenSmith, TomJennings, PeterBenson, TedSamson, Jason

Suppose, for example, that someone has given you a spreadsheet such as the one to the right. Each cell in column L has a person’s 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” isn’t 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:

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 functions—FIND, LEN, RIGHT, LEFT, and MID—you can do some powerful text manipulation in Excel, and this can save hours of tedious typing. You will be the hero at your office!

Page 237: My Excel Tutorial.xlsx

Full name Length Comma Space First name Last nameJones, BobDavis, StephenThompson, AndyWilson, JohnFredericks, KathyWilliams, KarenSmith, TomJennings, PeterBenson, TedSamson, Jason

Jones, Bob E.Davis, F. StephenThompson, AndyWilson, John B.Fredericks, Kathy C.Williams, Karen R.Smith, J. TomJennings, PeterBenson, Ted C.Samson, Jason A.

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” isn’t 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:

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 functions—FIND, LEN, RIGHT, LEFT, and MID—you can do some powerful text manipulation in Excel, and this can save hours of tedious typing. You will be the hero at your office!

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 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!

Page 238: My Excel Tutorial.xlsx

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 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!

Page 239: My Excel Tutorial.xlsx

Full name Length CommaJones, Bob 10 6Davis, Stephen 14 6Thompson, Andy 14 9Wilson, John 12 7Fredericks, Kathy 17 11Williams, Karen 15 9Smith, Tom 10 6Jennings, Peter 15 9Benson, Ted 11 7Samson, Jason 13 7

Full name Length CommaJones, Bob E. 13 6Davis, F. Stephen 17 6Thompson, Andy 14 9Wilson, John B. 15 7Fredericks, Kathy C. 20 11Williams, Karen R. 18 9Smith, J. Tom 13 6Jennings, Peter 15 9Benson, Ted C. 14 7Samson, Jason A. 16 7

Page 240: My Excel Tutorial.xlsx

Space First name Last name7 Bob Jones7 Stephen Davis

10 Andy Thompson8 John Wilson

12 Kathy Fredericks10 Karen Williams

7 Tom Smith10 Peter Jennings

8 Ted Benson8 Jason Samson

Space1 Period Space2 Last name Used name Initial Middle initial7 13 11 Jones Bob E Yes7 9 10 Davis Stephen F No

10 #VALUE! #VALUE! Thompson Andy8 15 13 Wilson John B Yes

12 20 18 Fredericks Kathy C Yes10 18 16 Williams Karen R Yes

7 9 10 Smith Tom J No10 #VALUE! #VALUE! Jennings Peter

8 14 12 Benson Ted C Yes8 16 14 Samson Jason A Yes

Page 241: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 can’t 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 doesn’t 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 doesn’t understand 3/14/2004 4:30PM, simply because there is no space between 4:30 and PM! (I wish I were kidding, but I’m not.) On the other hand, Excel is smart about dates. It will recognize that 9/31/1999 and 2/29/2003 are not dates—regardless 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).

Page 242: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

3/14/04 1:30 PM12/31/1901

3:5012:00 PM

29-Feb-969/24/46 14:45

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 can’t 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 doesn’t 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 doesn’t understand 3/14/2004 4:30PM, simply because there is no space between 4:30 and PM! (I wish I were kidding, but I’m not.) On the other hand, Excel is smart about dates. It will recognize that 9/31/1999 and 2/29/2003 are not dates—regardless 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).

Page 243: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 didn’t 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?

Page 244: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 didn’t 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?

Page 245: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 tomorrow’s 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.)

Page 246: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Today's dateCurrent time

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 tomorrow’s 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.)

Page 247: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 248: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Date Year Month number Month name Day Weekday number9/11/20011/28/1986

11/22/19638/6/1945

12/7/19414/14/1912

Lookup table - months Lookup table - days1 January 1 Sunday2 February 2 Monday3 March 3 Tuesday4 April 4 Wednesday5 May 5 Thursday6 June 6 Friday7 July 7 Saturday8 August9 September

10 October11 November12 December

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.

Page 249: My Excel Tutorial.xlsx

Weekday name

Page 250: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 251: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Dates of last two physical exams

First exam 4/5/1999Next exam 7/15/2003

Days (subtraction)Days (DATEDIF)Months (DATEDIF)Years (DATEDIF)

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.

Page 252: My Excel Tutorial.xlsx

15621562

514

Page 253: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

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 won’t 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. That’s why they are interpreted as text, not as dates.)

Try it! Enter your birthdate in cell L17 and then calculate your current age in cell L18. (Scroll to the right for the answer.)

Page 254: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Birthdate Next birthday7/22/1976 7/22/2023

Birthdate Age

Dates imported from a legacy system

Nov 25, 1997Nov 26, 1997Nov 29, 1997Dec 1, 1997Dec 3, 1997

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.

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 won’t 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. That’s why they are interpreted as text, not as dates.)

Try it! Enter your birthdate in cell L17 and then calculate your current age in cell L18. (Scroll to the right for the answer.)

Page 255: My Excel Tutorial.xlsx

Birthdate Age6/24/1956 66

V17
Chris Albright: No, this isn't my real birthdate!
Page 256: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 257: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.

Page 258: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 k, 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?

Page 259: My Excel Tutorial.xlsx

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?

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, Excel’s 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!

Page 260: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

33 Average3 Median01 Quartiles4 Q1

14 Q25 Q3

413 Percentiles5 P019 P051 P100 P25

22 P5010 P75

5 P9013 P95

7 P996395

147

2710

73

111535

9056

1113

417

319

451

214

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 k, 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?

Page 261: My Excel Tutorial.xlsx

166

1818

23

1779642730

1424

2412

14

363024

12721

165

31152912

545

2214

77

19381545

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?

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, Excel’s 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!

Page 262: My Excel Tutorial.xlsx

14

143

164

Page 263: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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—over 100 values, say—the 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 data—dollars, 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.)

Page 264: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

1034.44 Mean

877.35 Variance794.42 Standard deviation828.45

765.91088.95

786.051523.02

920.48777.23

1247.631117.87

1157.3641.35520.49586.68952.22878.36

1582.12807.99913.13

1051.65628.44651.86843.55

1233.371036.55

543.17866.31883.25

1285.68650.441412.4

1105.44671.55

1077.211471.871362.551044.37

601.521256.481069.69

407.541609.111141.03

972.54

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—over 100 values, say—the 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 data—dollars, 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.)

Page 265: My Excel Tutorial.xlsx

851.911324.671061.09

809.91655.81

1224.021105.521102.63

342.62642.01762.48945.73

1431.55695.66871.12827.21

1468.62863.17

582.4919.07

1314.831418.85

909.821086.11

620.14668.74598.66

1175.091139

1369.23618.31693.67

1341.851479.33

477.41962.29686.64

1495.961101.87

1018.61027.43

921.99868.49856.14724.87

1345.721127.911467.66

Page 266: My Excel Tutorial.xlsx

918.88997.56965.11

1059.321157.351116.731410.39

786.621477.32

1328.5753.26905.17821.06

1052.57926.89579.01873.54

1100.79727.32718.17948.09866.89

684.51391.63

678.82961.36

1023.22851.44

1247.631373.371177.79

929.79690.18736.95

1293.141134.24

1316.31440.091249.47

787.91320.841263.381212.951081.631214.141367.411579.931405.68

Page 267: My Excel Tutorial.xlsx

965.251081.01

713.611033.28

999.4361.42

721.31052.62

1094.3937.92

1217.14225.9

707.88856.16

949.81510.561234.831147.42

820.951049.69

915.41862.87

1017.05763.08978.67

1357.031279.621361.16

952.66523.33

1375.14545.6

847.121464.071113.211292.26

634.98651.65602.121367.6891.63

1197.371355.34

904.441638.891325.24

892.261553.37

Page 268: My Excel Tutorial.xlsx

697.541127.03

854.27810.98902.46623.26952.45

853.41029.521172.72

Page 269: My Excel Tutorial.xlsx

Mean 999.77Variance 83102.38St Dev 288.27

Mean - Stdev 711.50 # lessMean + Stdev 1288.05 # greaterPct with 1 stdev of mean

Page 270: My Excel Tutorial.xlsx

3640

62%

Page 271: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 -1 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.)

Page 272: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Month Sales1 Sales2 Sales3 CorrelationsJan-03 800 1750 640 Sales1 vs Sales2Feb-03 1360 2970 280 Sales1 vs Sales3Mar-03 1150 2370 230 Sales2 vs Sales3Apr-03 940 2010 410

May-03 740 1690 290Jun-03 1090 2590 460Jul-03 780 1640 760

Aug-03 910 2100 840Sep-03 990 1620 760Oct-03 800 1790 710Nov-03 1200 2320 690Dec-03 1150 2090 640Jan-04 880 2170 530Feb-04 870 1640 640Mar-04 870 1980 560Apr-04 760 1360 980

May-04 1010 2110 880Jun-04 820 1740 570Jul-04 1140 2040 650

Aug-04 730 1940 600Sep-04 1150 2000 540Oct-04 690 890 1130Nov-04 1210 2480 600Dec-04 1080 2050 660Jan-05 1420 2840 330Feb-05 1230 2490 710Mar-05 1170 2330 610Apr-05 1140 2540 840

May-05 560 1750 1010Jun-05 910 2490 950Jul-05 1260 2930 150

Aug-05 1050 2500 390Sep-05 1020 2240 440Oct-05 760 1630 420Nov-05 710 1380 880Dec-05 1000 2000 660Jan-06 940 2200 630Feb-06 1270 2510 510Mar-06 1370 2610 560Apr-06 1050 2180 620

May-06 1110 2590 470Jun-06 1170 2160 580Jul-06 990 2020 480

Aug-06 1040 1870 300Sep-06 1350 2590 540

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 -1 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.)

Page 273: My Excel Tutorial.xlsx

Oct-06 820 1440 520Nov-06 860 1870 620Dec-06 1190 2640 460Jan-07 910 1980 590Feb-07 950 2290 510Mar-07 820 1850 550Apr-07 770 1710 610

May-07 810 1480 720Jun-07 1370 2820 770Jul-07 940 2360 540

Aug-07 1020 1940 420Sep-07 930 1900 800Oct-07 1110 2520 660Nov-07 1230 2320 610Dec-07 1080 2240 990Jan-08 890 1840 530Feb-08 970 1940 520Mar-08 920 2510 480Apr-08 1000 2360 370

May-08 1250 2400 380Jun-08 1280 2490 640Jul-08 790 1760 450

Aug-08 940 2000 290Sep-08 1140 2570 460Oct-08 1020 2760 370Nov-08 1060 1680 560Dec-08 1130 2000 60Jan-09 1050 2270 710Feb-09 1380 2350 660Mar-09 770 1410 800Apr-09 860 2410 360

May-09 1130 1980 700Jun-09 1350 2960 300Jul-09 920 2320 380

Page 274: My Excel Tutorial.xlsx

0.776112-0.312739-0.412421

Page 275: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 55’s? (Scroll to the right for answers.)

The LARGE and SMALL functions are less well-known Excel functions, but they can be useful. Let’s 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.)

Page 276: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

55667634556875443858

679.02 11208.42 21635.72 3

729.63 41036.08 5

716.62 6972.92 7

1175.68 81271.38 91048.93 10

718.891282.89

960.551356.751257.66

902.381648.231111.56

750.541001.74

742.81707.50

1080.941290.851115.661005.361243.571454.84

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 55’s? (Scroll to the right for answers.)

The LARGE and SMALL functions are less well-known Excel functions, but they can be useful. Let’s 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.)

Page 277: My Excel Tutorial.xlsx

1491.96991.85

1345.711098.38

584.241209.501416.73

530.541171.911354.49

989.32788.77

1264.691594.351274.461023.201377.791090.11

963.47623.22591.33

1060.24669.80

1260.541019.52

819.22602.14714.58996.73698.22

1116.06851.37

1223.55963.66

1114.351473.56

755.30833.30670.82859.38

1109.961614.911035.87

927.74681.50953.19

1296.71379.17

Page 278: My Excel Tutorial.xlsx

773.671235.871442.201332.611314.411102.07

894.25949.84899.89842.80737.26853.25

1699.231084.52

753.021004.51

550.14995.72

1284.551217.771527.33

937.32523.64672.17

1131.391283.45

822.971364.57

512.38774.36

1105.61946.32730.95759.13

1119.851139.421090.731446.34

866.76800.82

1290.491477.84

977.471101.761101.661071.95

846.981222.82

Page 279: My Excel Tutorial.xlsx

1277.731129.761320.94

762.961145.85

985.63664.06808.46808.69

1433.58933.24

1059.901172.611334.85

752.821025.82

798.93590.03

1362.43581.92921.59

1166.95690.62

1472.74931.17

1525.45323.69

1388.36668.07

1377.301374.89

968.95637.91592.42

1202.371188.521031.241004.711451.57

972.331172.22

828.66914.55543.38489.87988.93

1331.981211.72

Page 280: My Excel Tutorial.xlsx

999.51963.75

1188.93517.26

1234.76953.21

1384.281059.931041.80

964.87488.53

1398.931046.12

913.83485.68

1335.031373.341208.251100.581051.501092.981166.45

941.871053.521095.111847.97

546.79843.64

1306.941120.741289.041192.821132.861597.101078.351528.90

972.011206.631202.84

704.03962.18

1252.001196.821279.00

757.50846.49855.45561.13

Page 281: My Excel Tutorial.xlsx

1300.36901.77

1015.091096.84

644.721372.65

579.08647.23478.23

1151.76961.65

1241.791076.72

774.441149.76

846.46927.77

1337.16790.40807.10

1201.211330.021100.301317.751080.591400.72

865.181383.26

997.08380.33

Page 282: My Excel Tutorial.xlsx

6 44 71 10

10 16 43 82 98 39 25 6

1847.97 323.691699.23 379.171648.23 380.331635.72 478.231614.91 485.68

1597.1 488.531594.35 489.87

1528.9 512.381527.33 517.261525.45 523.64

Page 283: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.

Page 284: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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.

Page 285: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 286: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Principal $30,000 Data table for payment versus termAnnual interest 6.75%Term 36Payment

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.)

Page 287: My Excel Tutorial.xlsx

Data table for payment versus termTerm Payment

$922.89 Payment $922.89 24

364860

Page 288: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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—at the end of each year, say—then we can use Excel’s 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 doesn’t 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 isn’t 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.)

Page 289: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Discount rate 12%Initial payment $100,000

Cash inflows at ends of yearsYear 1 2 3 4 5Inflow $20,000 $35,000 $50,000 $45,000 $35,000

NPV

Discount rate 12%

Stream of cash flowsDate 1-Jan-09 25-May-09 15-Sep-09 15-Jan-10 30-Jun-10Cash ($85,000) $22,500 $31,000 $65,500 $55,000

NPV

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—at the end of each year, say—then we can use Excel’s 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 doesn’t 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 isn’t 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.)

Page 290: My Excel Tutorial.xlsx

NPV $29,806

NPV $69,805

Page 291: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 company’s hurdle rate.

Fortunately, Excel has an IRR function that calculates an investment’s 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 shouldn’t 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!

Page 292: My Excel Tutorial.xlsx

Save this file under another name, 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 $25,000 $10,000

IRR

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 company’s hurdle rate.

Fortunately, Excel has an IRR function that calculates an investment’s 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 shouldn’t 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!

Page 293: My Excel Tutorial.xlsx

IRR 19.81%

The company will find this investment attractive only if its hurdle rate is below 19.81%.

Page 294: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 Excel’s 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.

Page 295: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

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 Excel’s 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.

Page 296: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 c_index 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 in cells M10 and M11. (Scroll to the right for the answers.)

Page 297: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Unit shipping costs City1 City2 City3Plant1 1.25 1.35 1.55Plant2 1.15 1.45 1.25Plant3 1.35 1.45 1.15

Unit shipping from Plant2 to City3

Plant 1City 2Unit shipping cost

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 c_index 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 in cells M10 and M11. (Scroll to the right for the answers.)

Page 298: My Excel Tutorial.xlsx

1.25

1.35

Page 299: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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.)

Page 300: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Table of profit versus order quantityOrder quantity Profit

200 $5,325 250 $5,430 300 $5,640 350 $5,565 400 $5,235

Best profit $5,640 Best order quantity 300

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

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.)

Page 301: My Excel Tutorial.xlsx

250 300 300 350

Page 302: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 arguments are missing), and this single cell is 3 columns to the left of F4, namely, C4.

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 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.

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 changing the value in cell M20 to 3 or 1.

Page 303: My Excel Tutorial.xlsx

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 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.)

Page 304: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

Payment delay 2

Month Oct Nov Dec Jan Feb Mar AprSales 3200 4600 5500 2500 3300 4200 2900Receipts 4600 5500 2500 3300

Percent paid 40% when: 1 month from now60% 2 months from now

Month Oct Nov Dec Jan Feb Mar AprCost $1,950 $2,900 $4,150 $2,500 $3,350 $2,850 $3,550 Payment

Month Sales Total $17,030 Jan-09 $2,450 Feb-09 $3,140 Mar-09 $3,250 Apr-09 $4,510

May-09 $3,680

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 arguments are missing), and this single cell is 3 columns to the left of F4, namely, C4.

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 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.

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 changing the value in cell M20 to 3 or 1.

Page 305: My Excel Tutorial.xlsx

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 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.)

Page 306: My Excel Tutorial.xlsx

May Jun Jul Aug4500 27504200 2900 4500 2750

May Jun Jul Aug Jan Feb$1,850 $4,200 $2,300

$3,400 $3,490

Page 307: My Excel Tutorial.xlsx

Mar Apr May Jun Jul Aug

$2,840 $3,150 $3,130 $2,870 $2,790 $3,440

Page 308: My Excel Tutorial.xlsx

Total sales

Jan-05Feb-05Mar-05Apr-05

May-05Jun-05Jul-05

Page 309: My Excel Tutorial.xlsx

Smith Jones Wilson Donalds$6,700 $7,400 $5,800 $9,000$5,800 $8,900 $5,500 $7,900$5,000 $7,900 $5,900 $8,300$6,700 $5,800 $6,000 $9,700$9,400 $7,800 $6,700 $8,400$6,200 $5,800 $9,400 $8,500$8,700 $5,300 $6,900 $7,500

Answer: Open the name manager and look at the definition of the Sales1 range name.

Page 310: My Excel Tutorial.xlsx

Answer: Open the name manager and look at the definition of the Sales1 range name.

Page 311: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.Return to table of contents

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 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.

Page 312: My Excel Tutorial.xlsx

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 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.

Page 313: My Excel Tutorial.xlsx

Save this file under another name, such as My Excel Tutorial.xlsx, and work with the copy.

2.0001 50.000130.9999 0.9999-3.0002

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 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.

Page 314: My Excel Tutorial.xlsx

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 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.