Vous êtes sur la page 1sur 159

Excel 2007 with Excel Master

Spreadsheeting for Accountants and Business People ... from the Beginning Duncan Williamson September 2009

This special edition of Part 1 of my book Excel 2007 with Excel Master is being presented to you in electronic format on the understanding that it is for your own personal use and that you will neither copy it nor forward it in any way to anyone else.

Additionally, this is a draft edition and there may be errors and omissions in the text. Of course, I apologise for any errors and omissions and would be grateful for any advice and guidance you have to offer me in this respect.

You can find a full listing of the entire book online at http://excelmaster.co.uk/thebook.htm

Enjoy this extract and I look forward to working with you.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 1 of 159

Table of Contents This file contains chapters 1, 2 and 3

Contents
Chapter1: Basics ........................................................................................................................ 5 Introduction ........................................................................................................................... 5 Pencil and Paper .................................................................................................................... 5 Basic Functionality .................................................................................................................. 6 The Ribbon ............................................................................................................................ 6 The Quick Access Toolbar: the QAT ......................................................................................... 8 Basic Rules .......................................................................................................................... 11 Add Subtract Multiply Divide ................................................................................................. 11 More Complex Calculations ................................................................................................... 14 Built in Functions: SUM ... AVERAGE ... MIN ... MAX ............................................................... 14 IF Statements ...................................................................................................................... 16 Auto Fill ............................................................................................................................... 20 Auto Fill Menu ...................................................................................................................... 23 Creating your own Custom Lists ............................................................................................ 23 Formatting Cells ................................................................................................................... 24 Moving Around your Workbook ............................................................................................. 27 Splitting the Screen .............................................................................................................. 27 Changing Column and Row Sizes ........................................................................................... 31 Moving a Column or Row ...................................................................................................... 33 Formatting Text ................................................................................................................... 33 Cell Borders ......................................................................................................................... 34 How to find a new function ................................................................................................... 36 Consolidation Exercise .......................................................................................................... 38 CONCATENATION ................................................................................................................ 39 Selecting non Contiguous Ranges .......................................................................................... 41 Why Select Non contiguous Ranges? ..................................................................................... 42 Print Areas ........................................................................................................................... 43 The Camera Tool: Printing Non Contiguous Ranges ... and more ............................................. 46 Transposing Data ................................................................................................................. 50 Cell and Range Addressing .................................................................................................... 51 Range Names....................................................................................................................... 54 Text box .............................................................................................................................. 56 CHAR() ................................................................................................................................ 58 Conditional Formatting ......................................................................................................... 60 Data Bars dont start at Zero ................................................................................................. 66 Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 2 of 159

Data Bars Start at the Smallest Value but ... .......................................................................... 66 Chapter 2: Charting..................................................................................................................... 70 Introduction ............................................................................................................................ 70 The Rules of Charting .............................................................................................................. 70 Setting up a Chart the Easy Way: the F11 key ........................................................................... 70 Default Chart Change ........................................................................................................... 73 Creating a Template Chart .................................................................................................... 74 Embedding a Chart with the Chart Wizard ................................................................................. 78 Embedding by Moving .......................................................................................................... 81 Titles and Axes Labels .............................................................................................................. 82 Other Charts ........................................................................................................................... 83 Category Axis Contains Labels from Three Columns ................................................................ 83 Conditional Colours............................................................................................................... 85 Waterfall Chart ..................................................................................................................... 88 Radar Chart ......................................................................................................................... 92 Self Expanding Chart ............................................................................................................ 93 Selecting Data from a Combo Box ......................................................................................... 94 Spreadsheet Allowing the User to Highlight Alternative Scenarios ............................................ 96 Table and Chart Selection Including a Combobox ................................................................... 96 Charts with Scroll Bars .......................................................................................................... 97 Basic Chart and Rates of Change Chart .................................................................................. 98 Additional Charting Exercises .................................................................................................. 100 Deriving Values from Published Charts ................................................................................. 102 Dashboards........................................................................................................................ 104 Chapter 3 Introduction to Pivot Tables .................................................................................... 107 Introduction ....................................................................................................................... 107 Definition of a Pivot Table ................................................................................................... 107 Why you need a Pivot Table................................................................................................ 107 Example PTs ...................................................................................................................... 109 COUNT of instead of SUM of ............................................................................................... 113 Editing a Column Heading ................................................................................................... 113 Pivot Table Layout .............................................................................................................. 114 Copying a Pivot Table ......................................................................................................... 116 Changing Sum of to Average of to Count of ... ..................................................................... 117 Moving a Field from Row to Column .................................................................................... 118 Drag and Move Within the PT ............................................................................................. 119 Drag and move the chosen field within the Task Pane .......................................................... 120 Filtering a Field .................................................................................................................. 121 Sorting a Pivot Table .......................................................................................................... 123 Formatting Fields ............................................................................................................... 124 Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 3 of 159

Calculated Fields ................................................................................................................ 127 Drilling Down ..................................................................................................................... 128 Calculated Item .................................................................................................................. 129 Other Calculated Item Features ........................................................................................... 131 Values ............................................................................................................................... 132 Show Values As .................................................................................................................. 134 Grouping PT Data ............................................................................................................... 136 When Grouping is a Problem ............................................................................................... 139 Pivot Chart ......................................................................................................................... 139 Formatting a Pivot Chart ..................................................................................................... 141 A Pivot Chart with a Data Table ........................................................................................... 142 Formatting ......................................................................................................................... 144 Page Fields ........................................................................................................................ 146 Multiple Page Fields ............................................................................................................ 148 Reporting with Page Fields .................................................................................................. 148 Pivot Table from an External Source .................................................................................... 150

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 4 of 159

Chapter1: Basics Introduction Pencil and Paper Here is the starting point for virtually any Excel spreadsheet: It is well known that as many as 95% of all spreadsheets begin their lives with at least one fundamental error. One key reason why we all make so many mistakes is that we are not prepared to spend time preparing our work properly. The graphic on the left, then, shows the starting point of many of the examples in this book: a writing pad and pencil. It really is a good habit to get into. Especially with any spreadsheet file that has more than a dozen or so formulas, using a variety of functions and relationships. If you are preparing a spreadsheet for other people to use, youd be silly not to plan the thing properly. If you are going to prepare anything other than the most basic and personal spreadsheets, you need to read and understand the kinds of materials included in books, files and sources like this: European Spreadsheet Risks Interest Group (EUSPRIG) at www.eusprig.org is an excellent source of ideas, best practice and horror stories of the outrageous and sometimes expensive things that people do with their spreadsheets! Best Practice Spreadsheet Modelling Standards published by the Spreadsheet Standards Review Board with the latest version available at www.ssrb.org Nick Read and Jonathan Batson (1999) Spreadsheet Modelling Best Practice BUSINESS DYNAMICS April Philip L Bewig (2005) How do you know your spreadsheet is right? Principles, Techniques and Practice of Spreadsheet Style July

Source: Nick Read and Jonathan Batson (1999) Spreadsheet Modelling Best Practice BUSINESS DYNAMICS April page 2-3 Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 5 of 159

Basic Functionality There are various basic rules that we need to appreciate as we build a spreadsheet file. We will look at each rule the first time we use it. This is what a brand new, blank Excel 2007 spreadsheet file looks like:

We will look at the various parts of the screen as we go along but for now, a spreadsheet is just a grid of what are called cells. Every cell has an address. In the screenshot of a blank spreadsheet file above, the cursor is currently in cell A1 ... there are letters at the top of each column, beginning with A at the top of the first column, then B, then C all the way to Column XFD. Each row is numbered beginning with row 1, then 2, then 3 all the way to row 1048576 A cells address comes from where columns and rows intersect: if you choose column F and row 19, then the address of that cell is F19. You will learn that we can choose a single cell to work with and we can choose a range of two and more cells to work with at any time. We can even choose multiple ranges of cells to work with at any one time. We will see that! There is another style of cell address, the R1C1 system (Row 1 Column 1) but we will almost certainly not use it here. The Ribbon If you have already got used to using Excel 2003, you will notice immediately that Excel 2007 is different. The drop down menus have gone and have been replaced by what they call the ribbon. The ribbon is the reason many people give for not wanting to change to Excel 2007: that is a very short sighted view and in reality it will take anyone no more than one concentrated hour to start to get to grips with it. There are eight separate Tabs on the ribbon: Home Insert Page Layout Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 6 of 159

Formulas Data Review View Developer

Each tab is really just the old drop down menus but made much more accessible and presented in a graphical rather than textual way. Here is what the tabs looks like: Home:

Insert:

Page Layout:

Formulas:

Data:

Review:

View:

Developer:

To get to and from each Tab you can either Click on the tab itself or Hover over the ribbon and move your mouse wheel up or down and the Tabs will scroll up and down for you. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 7 of 159

Screen Resolution
It is important to appreciate that if you change your screen resolution, the size and content of your ribbon will change. This could be most important if you attach a Projector to your computer as some projectors will need to reset the resolution to something less than you are probably using. What happens when you reduce the resolution is that some ribbon items disappear from view. That can be very frustration. Its a top tip for anyone who makes presentations though and now you can get yourself ready for that now and find the necessary workarounds.

Minimise the Ribbon


If you dont like looking at the ribbon or you want to maximise the working space available to you, you can minimise it. In the top left hand corner of the screen, to the right of the Quick Access Toolbar or QAT (see the next section) there is a down arrow that opens a menu when you click it. At the bottom of that menu you can choose to minimise the ribbon

It looks like Excel 2003 now; but when you click on any of these tab names the ribbon will reappear. The ribbon disappears again once you click away from it. The Quick Access Toolbar: the QAT Also new to Excel 2007 is the QAT: the area of the ribbon that you really can create and change to your hearts content. You can put in the QAT all of the menu items you want. This makes your version of Excel 2007 unique to you. You will find the QAT in the top left hand corner of the screen:

You can see here that in our QAT: Save Undo Redo Change shape Customise Quick Access Toolbar (thats the down arrow to the right of the QAT)

If we click on the Customise arrows it shows us a number of options, including the ones we have already mentioned:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 8 of 159

If you prefer, you can move the QAT to put it below the ribbon rather than above it. If you put a lot of items in the QAT you will almost certainly want to do that so that you can see them all! Select anything you like; but the real power of the QAT comes when you click the More Commands entry.

Try it!
Go to any Excel 2007 work book or open a new one and Click customise QAT Click More Commands This is what you should see now:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 9 of 159

What this means is that you can add anything you see here to your own personalised QAT: select the option you want, click the Add>> button in the centre of the dialogue box and either click OK or select some more. Look at the down arrow area at the top right of the dialogue box where you can choose to have your selections appear in all documents or just in the current one. Of course, you can also remove one or more entries from the QAT if you dont like them or if you feel you have finished with them: select the entry to delete and click the Remove button that will then be highlighted for you. Similarly, there is even more to choose because the drop down arrow selection at the top left of the dialogue box allows you even more options:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 10 of 159

You need to study these options carefully to appreciate the power of the QAT and how you can get the most out of it. When you get to grips with the QAT you should find that most of your fears of moving from Excel 2003 to 2007 will vanish. Basic Rules To begin with, the basic Excel spreadsheet rules are: To enter text in a cell, just type the text in the cell of your choice: put the cursor in the cell you want and start typing and press the Return or Enter key when you have finished. Alternatively, when you have finished typing your text, use your mouse to move the cursor away from the cell you are working with and click somewhere else on the worksheet.

Try it!
If you are starting to work with spreadsheets for the very first time, you must try these things for yourself. Open a new spreadsheet file by clicking on the Excel icon on your computer. Then try typing this in cell A1 of your new file: The quick brown fox ... <Enter> or The quick brown fox ... and use the mouse to click on another cell on the worksheet

Play with your new file: type and retype whatever you want until you are happy with what you are doing. It shouldnt take you long! Add Subtract Multiply Divide In its very simplest sense, a spreadsheet program is really just a calculator. Lets begin, then, by considering how the spreadsheet can help us with a variety of basic calculations. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 11 of 159

As with all calculators, Excel will help you with adding, subtracting, multiplying and dividing. Theres just one thing you need to know in order to get started with calculations which is that every formula in Excel must begin with the equals sign. Lets not just talk about these things, lets get started.

Try it!
In a blank Excel file, type the following into cell A1 =2+2 <Enter> ... of course it should say 4 once youd pressed the Enter key In cell A2 type the following: =2-2 <Enter> ... did you get 0? In cell A3 type the following: =2*2 <Enter> ... did you get 4 again? Note: Excel uses the asterisk key for multiplying and not the letter x In cell A4 type the following: =2/2 <Enter> ... did you get 1? Note: Excel uses the backslash key for dividing rather than the sign Now in column B, enter these and see what happens: Cell B1 B2 B3 B4 Formula =2+3*4 =5/2/1 =15-10+7 =6/9 Answer 14 2.5 12 0.66667 Comment Make sure you know why the answer here is NOT 20

Comment
In the table at the end of the previous section we added a comment to try to ensure that you understand the basic rules of arithmetic and know why the answer to 2 + 3 * 4 is 14 and not 20. In Excel 2007 you can put that comment in a cell so that anyone who gets to that cell can read your comment. In the work sheet that you have just been working on Click on cell B1 Right click on the cell Select Insert Comment Type your comment in the comment box that appears ... you can resize and reformat that comment box.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 12 of 159

Heres the before and after Comment in cell B1. Before After

To reveal the comment once you have entered it notice that the cell containing a comment has a tiny red triangle in its top right hand corner and the comment appears when you hover your cursor over the cell.

Format a Comment
Formatting a comment is a little odd in that making text bold, italicised or underlined is simple, just click on their icons or press <Ctrl>+B, <Ctrl>+I or <Ctrl>+U. As for changing the font and its colour, select the text whose format you want to change and right click to call up the Format Comment dialogue box, which will be very familiar to you.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 13 of 159

Try it!
Make the kinds of formatting changes to your own comments as you see above.

Edit a Comment
To edit a comment: Click on the cell containing the comment Right click on the cell Select Edit Comment Do what you have to do!

Delete a Comment
You can delete a comment in a similar way to the way you edit the comment: Right click the cell containing the comment Select Delete Comment

Try it!
Edit and delete one or more comments until you are happy with the process! More Complex Calculations Work through the following on your own now, starting in cell C1: create a single formula in each case to find the answers

Try it!
C1: C2: C3: C4: Add 10 to 3 and multiply your result by 5 Divide 1,000 by 250 then add 25 divided by 5 to the result Add 50 to 175 to 104 and subtract 57 from the answer then subtract 103 from that answer Divide 1 by 3 and then multiply the answer by 30

The answers to these questions are all in the spreadsheet file basics1.xlsx Built in Functions: SUM ... AVERAGE ... MIN ... MAX Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 14 of 159

Excel has a very long list of built in functions that save us all a lot of work. We will be exploring many of these built in functions in this book and here we are going to start with four of them: SUM, AVERAGE, MIN and MAX. Here is a screenshot of what you need to do first, set up a blank worksheet like this:

In cell A6 A7 A8 A9 enter enter enter enter =sum(a1:a5) <Enter> to add together all of the numbers in the range A1 to A5 =average(a1:a5) <Enter> to find the average of all of the numbers in the range A1 to A5 =min(a1:a5) <Enter> to find the smallest of all of the numbers in the range A1 to A5 =max(a1:a5) <Enter> to find the largest of all of the numbers in the range A1 to A5

After you have finished, put your cursor back in cell A6 and you will see that Excel has automatically capitalised the word SUM and the range A1:A5... and AVERAGE(A1:A5) ... and MIN ... and MAX ... it ALWAYS does this and there is no need for you to type in capitals. Notice how Excel deals with ranges: rather than writing out A1 to A5 or from A1 to A5 or all of the numbers in the range A1 to A5 inclusive, it just puts the first cell in the range and the last cell in the range and separates them with a colon ... A1:A5

Try it!
Use the spreadsheet you have used in the previous example to find the sum, average, minimum and maximum of the values in the range C1:C5, as follows:

Your answers should be: Sum 385 =SUM(C1:C5)

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 15 of 159

Average Minimum Maximum

77 55 103

You can find the fully worked solution to this section in the file basics2.xlsx IF Statements A spreadsheet is commonly treated as a glorified calculator by many people. There is nothing wrong with that necessarily as it can contain a massive amount of data and many relationships as it is prepared for those calculations. One major resource that has always been built into spreadsheets is the IF statement. This section takes you through the way to set up a spreadsheet with basic IF statements and highlights one or two ways in which an IF statement can be enhanced. An IF statement has the following basic structure =IF(x meets a condition you set, do A otherwise do b) More formally, that is: =IF(logical_test,value_if_true,value_if_false) For example, in cell B1 if cell A1 is equal to 10, write the word yes in this cell otherwise write no, again more formally: if the test is true, do something, otherwise do something else if the test is false: B1: =IF(A1=10,Yes,No)

Try it!
Open a blank spreadsheet file and enter 10 in cell A1 and the above formula in cell B1 Change the value in cell A1 to 8 then 3 then 14 and monitor what happens in cell B1 We can use any operator in our IF statement, enter the following variations of the above formula in the cells shown below and see what happens: B1: B2: B3: B4: B5: B6: =IF(A1=10,Yes,No) ... IF A1 is equal to 10 =IF(A1<10,Yes,No) ... IF A1 is less than 10 =IF(A1>10,Yes,No) ... IF A1 is greater than 10 =IF(A1<>10,Yes,No) ... IF A1 is not equal to 10 =IF(A1<=10,Yes,No) ... IF A1 is less or equal to than 10 =IF(A1>=10,Yes,No) ... IF A1 is greater or equal to 10

You should have this now and make sure you understand why you get these results:

Try it!
Create a work sheet that looks like this Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 16 of 159

(Note: we created the values for the Budget and Actual cells by entering =RANDBETWEEN(10000,12500) in cell B4 and then dragging and filling to fill the entire range B4:C15 with random numbers that can have any value in the range 10,000 to 12,500, inclusive) Program the Comment range with an IF statement so that it says Favourable if the variance in column D is positive and Adverse if the variance in column D is negative. If you have used the =RANDBETWEEN() function to generate your budget and actual values, you can press the F9 key and Excel will generate a brand new set of values ... this will test your IF statement for you. Check that it works properly!

Notice that the numbers in the above screenshot are different from the numbers in the previous screenshot. Thats because we have used the volatile =RANDBETWEEN() function and it always works like that! Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 17 of 159

Try it!
You might be a quality controller or a teacher or a student or someone who needs to set and manage thresholds. Program the following work sheet and program an IF statement to record Pass against any value that is greater than or equal to 55% and Fail to anything less than 55%.

Again, you might generate your specimen results by using =RANDBETWEEN(30,100)/100 (note that we have assumed that no one can score less than 30% and you can change that if you wish) and then testing your results by pressing the F9 key once you have programmed the P/F column.

Nested IF Statements
A nested IF statement is one in which an IF statement can have other IF statements built into it, like this: =IF(A1>0,Favourable,IF(A1<0,Adverse,)) You can nest your IF statements up to 64 levels deep (in Excel 2003 it was only 7 levels) Here is the screenshot of our variance example from above with the original IF statement still included (column E) and the new nested IF statement (column F) ... make sure you can see the benefit of the new IF statement by concentrating on the results in June:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 18 of 159

With the original IF statement, all we said was, if a number is positive it is Favourable otherwise it is Adverse. We did not allow for a zero value and Excel quite rightly said that according to our IF statement, a zero value is something other than favourable so it must be Adverse. Our nested IF statement, though, says this: IF the variance is greater than zero it is Favourable otherwise IF the variance is less than zero it is Adverse otherwise IF the variance is equal to zero, enter nothing in the cell ... thats what means, it tells Excel to enter nothing

Try it!
Amend the Pass/Fail example to reflect a revised rule: A Pass is a mark greater than or equal to 55% A Fail is greater than or equal to 35% but less than 55% A Bad Fail is less than 35% It helps if you have used the =RANDBETWEEN() function to create your results so that you can press the F9 key and test your work.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 19 of 159

There are several other aspects and enhancements that we can make to IF statements but for now we will leave it there. Auto Fill Another labour saving device from Excel is the Auto Fill function. Try this: Open a new workbook and enter the numbers 1, 2, 3 in the range A1:A3. Now select the range A1:A3 by clicking on cell A1 and with the left mouse button pressed, drag down to cell A3. The selected range A1:A3 should be coloured in as you see below:

If youve never selected a range before, you might need to practice a bit until you get it right. Now the clever part! Put your cursor over little dot you can see at the extreme bottom right hand corner of the range. When you have done that your cursor will change to a + sign (this is the auto fill handle). When you have got the + sign, keep the mouse still, press the left mouse button and drag down until, say, cell A10. What do you find?

Try it!
Enter 1, 2, 3 and fill down to cell A10 as described above. This is the result you should have got:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 20 of 159

Try it!
In the range B1:B3 enter jan, feb, mar and fill down to B12 ... what do you get? In the range C1:C3 enter 10, 20, 30 and fill down to C10 ... what do you get? This is what you should now have in your worksheet:

Use fill down for any series you like and Excel will give you an answer: please note, you need to use this with caution as some of the answers Excel gives might not be what you are expecting and you need to think about the answers carefully. What we mean is, Excel assumes your values come from a linear (straight line) data set and if they dont, well, your fill down answers might be rubbish!

Try it!
Fill down the values you see in the ranges D1:D3 and E1:E3 and comment on your results!

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 21 of 159

You probably got this:

The answers in the range D4:D10 are fine but the answers in the range E4:E10 are wrong when we tell you that the numbers 27, 29, 33 came from this function: E1 =25+2^A1 E2 =25+2^A2 E3 =25+2^A3 Where ^ means raise to the power of ... 2^2 means 2*2 2^3 means 2*2*2 6^4 means 6*6*6*6 And so on Enter =25+2^A1 in cell F1, fill down to F10 and compare your answers with what youve got in the range E1:E10! See the workbook basics2.xlsx for the completed solutions. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 22 of 159

Auto Fill Menu You might have noticed when you were using auto fill that a little icon appeared at the bottom of the column when you had finished dragging the series. Thats the auto fill menu and you can activate it by clicking on it. That menu gives you a few additional options that you might want to use, such as Fill Series, Fill Formatting only ... something for you to play with and use as you need it. Creating your own Custom Lists When you first install Excel 2007 it comes with just a few custom lists along the lines of the ones we have been discussing here. You are free to create your own lists. Lets see how we do that. In a work sheet, old or new it doesnt matter, create a list that you are likely to want to use over and over. You can generate the list either by typing them in or if you want to build a formula to create them then thats fine. Click the Office Button Click Edit Custom Lists

In the Custom Lists dialogue box, select the range of cells containing your new list Click Import Repeat these two steps for any further lists you might have created

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 23 of 159

What can you do with your new custom lists? In our case, we can type, for example, Duncan in cell E1 Daniel in cell E2 Then select cells E1:E2 Drag and fill down to cell E8 and the list of names will be completed according to your new custom list of names

Building a Custom List with a Formula


If you build a list with a formula, you do exactly the same as in the previous section but with one exception: you need to turn the formula into a value. For example, if you have created a list from the formula =A1+B2*4 and then dragged that down from E1:E10: Copy E1:E10 Paste Special Value OK

Now E1:E10 contains values and not formulas and you can import that list into your Custom Lists.

Try it!
Create your own list of names, numbers, dates or any other variables or parameters and import that list into the Custom List function using the technique above. If you cant think of anything, try these: Enter the list of The days of the week in French German Italian Spanish Formatting Cells One vital aspect of your work will be to make your spreadsheets to look good. Even though spreadsheets are primarily extremely powerful calculators they have also become extremely powerful communicators. Excel 2007 has moved us a lot further along the communications channel than Excel Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 24 of 159 Months of the year in Chinese Thai Viet Malay

2003 ever could. Excel 2007 charts are excellent, tables have been improved, conditional formatting (see later) is much more powerful. Ordinary formatting of cells is something we should learn from the beginning. For example, look at the range E4:E10 in the basics3.xlsx file: 35.66667 38.66667 41.66667 44.66667 47.66667 50.66667 53.66667

Not very pretty are they, all of those decimal places?

You might want to show just two decimal places, or three or even none. The choice is yours and this is how you make the change: On demand More permanent formatting of cells Open the basics3.xlsx file now if it isnt already open and select the range E4:E10

We have shown here jus the Number formatting section of the Home Tab on the Ribbon (the menu bar at the top of the screen). In that section you can see the Increase Decimal and Decrease Decimal icons, as follows:

Click on either of the icons and see what happens. Click again, see what happens. This is formatting on demand ... select a cell or a range and increase the number of decimal places on demand as you need it. Suppose, though, that you always want to see two decimal places in your answers and dont want to have to click on those icons every time ... lets set up some more permanent formatting now, then: Make sure you have still got the range E4:E10 selected and then click the right mouse button anywhere over that range and choose Format Cells from the menu you are given. You should see this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 25 of 159

Notice we have chosen the Number option from the Category list on the left of this dialogue box and 2 decimal places together with using a comma as the thousands separator. Do the same as you see here then click OK and see what you have done. 35.67 38.67 41.67 44.67 47.67 50.67 53.67

This is what you should be seeing now

Again, play with that right click, format cells command and learn how to format to three decimal places; how to turn a decimal into a percentage automatically; how to format values as accounting figures and so on. This format cells function is very powerful, by the way; and we will use it more and more throughout this book. If you want to learn more about formatting, take a look at Excel 2007s Help files: there is a lot of useful information and there are many examples there. Before we leave formatting for now, though, take a look at the table below for more! Press <Ctrl>+<Enter>+ ~ 1 2 or @* 3 4 5 6 *Whether you click the 2 or To format in this style And this is what you get! General 1.5 2 decimal places 1.50 Time format 12:00 PM Date format 1-Jan-09 Currency 1.50 Percentage 150% Scientific 1.50E+00 @ key depends on the layout of your keyboard.

That is, for example, press the CTRL key, keep it pressed and press the Enter key, keep it pressed and press the ~ key or the 1 key ... and you will automatically format the cell or range you have currently selected. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 26 of 159

Moving Around your Workbook The previous example, formatting using keyboard keys, is useful because it gives your fingers a rest from using your mouse ... that must be a good thing if you want to prevent or minimise repetitive strain injury. The following examples will not only save your hands and fingers, but they will make you much more efficient. You will also appear suave to anyone who doesnt know these shortcuts. Open any workbook you like and go to, say, cell AA99 (press the F5 key and use that Go To dialogue box to get you there!) Now, go to cell A1 ... are you going to use the mouse, or press the up arrow and left arrow keys to get there? Why not do this? Press these two keys together ... <Ctrl>+<Home> ... whoooosh! Go to or stay in cell A1 and now press <Ctrl>+<End> ... where are you now? You should be in the bottom right most active cell in your worksheet ... the most extreme cell from home that you have used so far. <Ctrl>+<Down Arrow> ... you will either be at the bottom of a list of in cell A1048576 if column A is empty. What this combination does is to take you from your current position to the next empty row moving down from top to bottom ... it might not be the end of the column if your column has row breaks in it. If the column is continuously populated you will get to the bottom immediately by using this keyboard combination. Go to or stay in cell A1048576 and now press <Ctrl>+<Up Arrow> ... you will either be at the bottom of any list there is in column A or at the top of it or the first section ... From anywhere in your worksheet press <Ctrl>+<PdDn> ... where are you now? You should be in the next worksheet to the right of the one you started in if there is one! If you are in the final sheet, you cannot go right and more, so this combination will not work in those circumstances <Ctrl>+<PgUp> ... where are you now? You should be in the next worksheet to the left of the one you started in if there is one! If you are in the home sheet, you cannot go left, so this combination will not work in those circumstances It is well worth your while getting used to these keyboard shortcuts as they will save you time and pain. Splitting the Screen One of the problems with moving around a spreadsheet is that as soon as you move down or across more than a screens worth of data, the column headings and row headings disappear. Even though we know how to get back to the home cell really quickly now and so on, seeing the headings at all times is a very useful thing to be able to do. Here is a screenshot of a large database that we will begin to use shortly:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 27 of 159

There are 2,000 rows of data or records in this database so clearly as we scroll down below 40 or so, the column headings to be seen in row 5 will disappear.

Split Screen
The next screenshot shows what we can achieve by splitting the screen and scrolling down to row 100 ... 300 ... 2000

To split the screen, place the cursor in the row below the row you want to keep visible at all times Click on the View Tab Select Split

Now scroll down the work sheet and the row above the split remains visible at all times. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 28 of 159

Unclick Split on the View Tab to cancel the split.

Freeze Panes
Freezing is similar to splitting but with one or two additional features. Again, here is a screenshot of a frozen column header row:

We have frozen row five again but this time what we had to do was to move row five to be the topmost cell on the screen: that is, whichever row is at the top of the screen is the one that is frozen. To freeze the column headings and make sure that the column headings are the first visible row. Click View Tab Click Freeze Panes Select Freeze Top Row

To freeze the row headings, unfreeze the column headings and make sure that the row headings are the first visible column. Click View Tab Click Freeze Panes Select Freeze First Column

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 29 of 159

In the case above the column headed Row will be frozen.

Freeze Column and Row Headings


There are times, of course when we might want to freeze both column headings and row headings at the same time. This is possible, as this screenshot shows:

In this case we have frozen column and row headings and just for demonstration have moved down to row 95 and across to show the Country heading together with sales, profits, assets and market value values. Clearly we have frozen row five as the column headings and the country column as the row headings. To freeze column and row headings: Clear all previous freeze settings Put the cursor to the right of and below the row and column headings respectively you want to freeze. Click View Tab Click Freeze Pages Select Freeze Panes

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 30 of 159

Changing Column and Row Sizes When you are setting up a spreadsheet file for the first time, you will be typing in column headings, row headings, values and all sorts of things. Of course, some words or titles will be short and some will be long. Some values will be small and some will be large. If you dont know how to deal with the formatting of such things, your work might not only not look good, it might really be unreadable. Copy the following to cell A1 in a blank workbook: Date 04 September 2008 05 September 2008 5 September 2008 07 September 2008 15 September 2008 15 September 2008 16 September 2008 18 September 2008 Account Internet Connection Food Taxi Fare Book Book Book Book Postage Details Al Salam Rotana Hotel Khartoum HMSHost Schiphol Airport Amsterdam Home to Manchester Airport Business Book This isn't Excel it's magic Toyota Culture: the heart and soul of the Toyota way From amazon, title forgotten Special Delivery Letter Destination/Other Classification Khartoum Khartoum Khartoum Book Book Book Book Visa

When we did that just now, this is what we got:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 31 of 159

See, a bit of a mess: the ####### characters tell you that the column width is too narrow to display the values in that cell. What do we do then to overcome this problem? The answer is to let Excel do everything for us ... almost! Go to your new worksheet and left click on the column heading A, keep the left mouse button clicked and drag the cursor to the right until you have selected all of cells A to D.

You should now have a worksheet like that one above. Now carefully move the cursor over the column headings until you get to the point where two columns meet: A and B or B and C ... or even D and E. You should notice that the cursor changes from being a down arrow to a two way arrow. When you have got your two way arrow, keep the cursor still and quickly double click the left mouse button ... you might need to practice this. Select the columns again and try again ... # When you get this right, this is the result:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 32 of 159

Excel has automatically expanded each column to the width of the largest content in each column. You should do this whenever some text spills over from one column to another. You can use the same technique if the rows in your worksheet are too small and text is being squeezed from top to bottom. Select all rows as you select all columns and double click when you have got the double arrow key selected. Moving a Column or Row Imagine that we realise that entire contents of the column headed Destination/Other Classification should really be column B not column D, what can we do? Do this: Click on the heading of column D so that the entire column is selected and then move the cursor either to the right or the left boundary of column D and when the cursor changes from its default to a four way arrow, keep the cursor still, click the left mouse button and drag column D to its new place between the existing columns A and B ... try it! Again, practice until you can do it but this action moves the entire column: lock, stock and barrel! Move rows in the same way and we can move one column or row at a time or two or more columns or rows at a time. Formatting Text Sticking with the example from the previous section, imagine we want to format the table of data in a simple way. For example, we just want to make column headings bold ... select the text and either Press these two keys together <Ctrl>+<B> Or click on the B icon in the Font section of the Home Tab:

You can see how to make the content of the range A2:A9 Italicised cant you? <Ctrl>+<I> Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 33 of 159

Or click on the I icon in the Font section of the Home Tab ... next to the Bold icon above. And underlining any text? <Ctrl>+<U> Or click on the U icon in the Font section of the Home Tab ... next to the Italics icon above. Cell Borders In some cases you might want to put borders around some or all cells in your worksheet. Use the Borders icon to make your current worksheet look like this:

To put borders round a cell or a range, this is the icon you need to use, also found in the Font section of the Home tab:

There are many options for borders and variations of them. Here is the icon expanded in full:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 34 of 159

Its best if you experiment with the options that are available to you and here are just a few of the things you can do with the borders and your tables:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 35 of 159

In the three examples above we have used top border, bottom border, thin top and thick bottom border and, experimenting just like you should, we have used different line colours, different line thicknesses and styles and so on. Its so easy once you know where to look. How to find a new function So far we have looked at just a few of Excels in built functions: SUM, AVERAGE and so on. However, there are hundreds more functions built into Excel. How can we find whether a function is already available even if we dont know it exists? Like this: To the left of the formula bar there is the symbol fx, meaning insert function: its also really a function finder!

Click on the insert function icon and it gives you this dialogue box:

This dialogue box can tell you directly which functions are available by type of function: Financial Date and time Statistical And more

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 36 of 159

Find out which categories are available by clicking the down arrow next to where it says Or select a category. Alternatively, if you are not sure if there is a built in function but you know what you want to do, enter a word or phrase into the section underneath where it says Search for a function. For example, test it out by typing in such words as: Add Mean Standard deviation

And then click the Go button. Excel will then either give you exactly what you want or what it thinks are the best alternatives from what it thinks you have asked for. In the case of the three examples above, Excel will probably give you: Expression Entered Add Mean Standard Deviation Excels Suggestion DSUM, SUM, SUMIF, RTD, SUMIFS A long list that includes AVERAGE, the arithmetic mean Another long list that includes STDEV, standard deviation, the one that we want

When you click OK n that dialogue box, having found the function you want, Excel then opens another dialogue box that allows you to enter the data you want to enter and it will then enter the result in the current cell you have selected. In the case of Add, we will use the SUM function:

This dialogue box describes the function and will show you the results to date as you add more and more data. As you enter your data the number of numbers it will allow you to enter will grow.Try it ... and get used to how it works and what it does for you. Alternatively, if you want more information before you start to use the function, you can see the option to use Excels Help files where it says Help on this function in the bottom left hand corner of the dialogue box.

Try it!

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 37 of 159

Lets test this out: open a blank workbook and keep your cursor in cell A1. Click on the Insert Function icon and search for sum, click Go and then OK. Now enter the following data into the dialogue box number by number: 30, 63, 49, 38, 57, 73, 19, 53, 42 Click OK now and in cell A1 you should see the total of those 9 numbers is 424 and inside cell A1, Excel has automatically built the function =SUM(30,63,49,38,57,73,19,53,42) for you. Do it again but for the standard deviation this time (whats the standard deviation? Well, you can read about it as you carry out this exercise, in the Help file and later in this book ... its a very useful statistical function). Use the same 9 numbers as before and this time put your cursor into cell A2 to start with. Format your answer to two decimal places and your answer should be: 16.77 and in cell A2 you should see that Excel has automatically generated this for you: =STDEV(30,63,49,38,57,73,19,53,42) Consolidation Exercise This consolidation exercise will help you to work through many of the things that we have done so far. Apart from the data that follow, all you need to know is contained in the work book basics_summary.xlsx which you should open alongside these instructions. Copy the following table or type the contents of the following table into the spreadsheet. Make sure that you begin by typing the column heading Month into cell A1 and then complete the table with no column or row gaps. Month March April May June July August September October November Machine hours 30 63 49 38 57 73 19 53 42 Labour 347 521 398 355 473 617 245 487 431

If you copy and paste the table into the Excel file, use the Smart Tag Paste Option either to keep the formatting as it is above or to change it to the destination formatting: the choice is yours. Resize columns A to C to make the headings fit properly. In In In In In In In cell cell cell cell cell cell cell A11 A12 A13 A15 A16 A14 A17 enter enter enter enter enter enter enter Total Average Count Minimum Maximum Range Standard Deviation

The ranges B11:B17 and C11:C17 enter the appropriate function to find the values suggested by the row headings in column A, rows 11:17. Hint: fill the range B11:B17 with the functions and then Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 38 of 159

copy right to copy them into C11:C17. We havent covered all of these functions yet ... time to do a bit of research by using the knowledge you gained in the section How to find a new function? Format your answers to two decimal places and resize the columns again if necessary. There is in built no function for Range ... build a formula to find it! How else could you have found the average, arithmetic mean, apart from using Excels in built AVERAGE function? Dont look at the following until you have done everything you should have done!

Range = maximum minimum You could have found the average in this way: SUM/COUNT Copy the row headings in rows A1:A10 and paste them into the range D20:D29, use the Paste Option smart tag to Match Destination Formatting. Copy the column heading and data from the range B1:B10 and paste them into the range E20:E29. Again, use the Paste Option smart tag to Match Destination Formatting. Make the column headings in the cells D20:E20 bold Select the range D21:E29 and use the fill handle to auto fill the data down to row 44: you should now have the range D21:E44 filled with months and data. Format the data in the range E21:E44 to two decimal place Follow the instruction in Cell F50 CONCATENATION Have you ever come across the word to concatenate before? We hadnt either until I learned about it as a function in Excel. Concatenate is a big word with a simple mean: it means to join together. In Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 39 of 159

terms of a spreadsheet what it means is that we could have, for example, two names or numbers in two cells and by using the concatenate function, join them together. There are two ways of using concatenate:
=CONCATENATE("duncan ","williamson") ="duncan"&" williamson"

Try it!
Copy and paste these two examples into separate cells in a worksheet and see what happens. How could you use concatenate in other ways? Well, if you want to join two or more things, concatenate. If you want to combine, say, a date with a title, concatenate. Heres an example for you: In a blank worksheet enter this in the cells shown A1: DW Ltd Income Statement for the year ended A2: 31st December 2009 A3: =A1& &A2 ... Note: you should retype these double inverted commas in Excel if you copy and paste what you see here and get a #NAME! error Take a look at the screenshot below, this really works!

Isnt that so simple: by the way, we never use =CONCATENATE(...) because & is so simple and direct.

Try it!
Starting in cell B5 of your worksheet, type the following names exactly as you see here and then concatenate row by row in column D, as you see here:

As a final example for now, you can join numbers together too: from what you see below, in cell E9 concatenate the numbers in cells E10, F11, G12 ... Leaving a one space gap between the numbers Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 40 of 159

In cell F9 concatenate the numbers in cells E12, F11, G10 ... Leaving no gap between the numbers at all

You answers should be E9: 45 86 48 F9: 858624 See what happens when you multiply your concatenated answers by 2 Selecting non Contiguous Ranges Contiguous is another word, like concatenate, that most of us have never used until we started using spreadsheets. A contiguous range is simply a group of cells that are all joined together in one area. The range A1:D55 is a contiguous range of cells providing there are no gaps anywhere in that range. We know how to select the cells in a simple range, such as the range of cells A1:D55. What you might want to know sometimes is how to select more than one range at a time when those ranges are NOT contiguous. The following screenshot shows three non-contiguous ranges that have been selected all at the same time:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 41 of 159

One big clue that we have selected a range or ranges is that the selected cells turn grey: as you can see. This is how to select those non contiguous ranges, A1:C9 and F6:J12 and C15:F24 now. 1 2 3 Start by selecting any of the three ranges as normal: put the cursor in one of the four corners of the range, click and hold the left mouse button and drag the cursor to select the rest of that range and let go of the left hand mouse button. Now go to a corner of the second range you want to select and before you click the mouse button click and hold the <Ctrl> key, then left click the mouse button and drag the cursor to select the second of your ranges. Let go of the left mouse button and the <Ctrl> key now. Repeat step 2 for the third range

You can select as many non contiguous ranges as you wish at any one time. PLEASE be careful with your left click and <Ctrl> clicking because if you make a mess of them you may well have to start all over again. We are speaking from experience here: with our lack of coordination getting in the way at times! Why Select Non contiguous Ranges? A fair question , why might you want to select two or more non contiguous ranges? Formatting them for one, printing them for another. We have used non contiguous selection of cells and formatted the ranges you can see in the following screenshot:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 42 of 159

Look carefully at the above screenshot and you will see that we selected the three non-contiguous ranges because the values in them were all in a range different from the other numbers on the sheet: we made the selected values bold, italics and gave them a pink background. Print Areas You might have a simple work sheet in which case you can just ask Excel to print it and all could be well. In the case of the above example, though, we have decided that, having highlighted the values we want to highlight, we want to print those values and only those values. We do this: Select the ranges as we have already discussed and then do this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 43 of 159

Select the Page Layout tab Click on the Print Area icon and Click on Set print area You should see that the selected ranges are now surrounded by a dotted border. Lets preview our selection now, before we print it out: 1 2 3 Office Button Print Print preview

You will find each of the three ranges will be printed on its own page. Alternatively, click on the View Tab and click on Page Break view to see this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 44 of 159

The three ranges are highlighted with the rest of the sheet dimmed. You probably cant see it here but the range A1:C9 has been designated as Page 1 F6:J12 has been designated as Page 2 C15:F24 has been designated as Page 3 How did Excel choose which area goes on which page? It didnt. We did! The order in which we selected the ranges will tell Excel that this is the order in which we want to print them. If page order is important, think carefully about this, then. You are free to print your three ranges now: 1 2 3 Office Button Print Print or Quick Print

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 45 of 159

Alternatively, simply press <Ctrl>+P and you will get the print dialogue box: make sure you choose the correct printer and other settings and there you go!

Try it!
We strongly recommend you work your way through the selection and printing routines because they can be a bit of a bother until you have got used to clicking <Ctrl> and the left mouse, then letting go, then clicking them again ... Open the file basics6.xlsx to select, preview and set up printing ranges for at least three non contiguous ranges. You are free to select any three or more ranges you wish. The Camera Tool: Printing Non Contiguous Ranges ... and more Imagine you have generated the work sheet that follows. The purpose of this work sheet is to demonstrate how we might print on one page two or more ranges that would otherwise have to be printed on separate pages. The illustration that follows has been simplified purely for demonstration purposes.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 46 of 159

We want to print on one page the ranges A1:D5 and H15:K19

Putting the Camera Tool in the Quick access Toolbar (QAT)


Lets assume that they cannot be printed on one page unless we use the camera tool and that the camera tool is not already in the QAT:

Click the Office Button

Click Excel Options

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 47 of 159

Click Customise and then scroll down the list below to get to Camera Click Add>> to put the Camera Tool into the Quick Access Toolbar Click OK

The Camera Tool is now in the Quick Access Toolbar (QAT) in the top left hand corner of the screen.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 48 of 159

To use the Camera Tool


Select the range you would like to capture with the camera Click the camera tool in the QAT ... you will now see the cursor as a cross, + Click on the worksheet where you would like your picture to appear Click on the new picture and move it as necessary to align it

The picture normally develops with a border round it: right click it to remove that border.

Try it!
Set up a work sheet or open an existing work book and Put the camera tool into the QAT Copy and paste a range using the camera tool

Other Benefits of the Camera Tool


OK, so whats so good about the camera tool, apart from having a picture of the range H15:K19 in the range A7:D11 ready for printing? Go to the range H15:K19, or your own equivalent original range. Make some changes to what is in one or more cells or reformat the title or even change the title ... make any change you like. Go to the picture, in the range A1:D11 in our case, to see what it looks like now:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 49 of 159

Make a change in the original range and it is also made in the camera tool produced picture range. Marvellous! Now print the range A1:D11. Transposing Data Another word for transpose is rotate: we all know rotate but we might be unfamiliar with transpose! In any case what transpose means in the context of an Excel spreadsheet is that we select a range and paste it somewhere else in such as way that rows become columns and columns become rows. Here is an example of data before and after being transposed:

Can you see what has happened? Study the Before and After Tables carefully to ensure you can see what has happened. Perhaps the colour coded version will help you:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 50 of 159

We use the transposition of data for a variety of reasons, including Data are easier to understand once they have been transposed In some cases it is impossible to draw a chart properly unless the data are transposed

Heres how to transpose a table: Select the data and copy it (click on the copy icon on the Home Tab or select the data and click <Ctrl>+C Put your cursor in the cell on a sheet where you want to paste your transposed data (this will be the top left hand corner cell) and then click the down arrow on the Paste icon on the Home Tab and select transpose from the list you should see immediately:

There you are, as simple as that!

Try it!
The Excel work sheet basics7.xlsx contains the previous example and starting in cell E16 is a table of data that you would like to transpose and paste in the blank range starting with cell E31 ... do it! Cell and Range Addressing Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 51 of 159

We have used a variety of addresses in this chapter already, like these: A1 B1 C19:F45 We have also used Excels ability be able to drag and fill down and across a variety of things. Dragging and filling cell and range addresses needs to be looked at carefully because of the way Excel has been programmed to work.

Try it!
Open a new workbook and enter =A1 in cell A1 Now drag and fill cell A1 down to cell A10 What do you see in cell A2? And cell A3? And cells A4, A5 ... A10? Yes, A1 became A2 then A3 ... then A10 Now drag and fill cell A1 right to cell H1 and what do you find? B1 contains B1 Cell C1 contains C1 ... Cell H1 contains H1 This is what Excel is supposed to do. Imagine, though, that cell B1 contains a number that you want to include in several calculations. For example, cell B1 contains 155, the rate of VAT at the time of writing and you want to use that for a number of calculations. Look at the following screen shot:

In the range D4:D10 we have entered a series of cost values and in columns E and F we want to find the VAT and Sales values for each item respectively. In cell E4 we have entered the formula =D4*B1 In cell F4 we have entered the formula =D4+E4 Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 52 of 159

Select and drag down cells E4:F4 to row 10 Oops! What went wrong? What went wrong was that in cell E4 it says D4*B1 but in cell E5 it says D5*B2 and in cell E6 it says D6*B3 What we really want is: in cell E4 it says D4*B1 in cell E5 it says D5*B1 in cell E6 it says D6*B1 Hmm, boring! Imagine if there are 10,000 calculations to do? How will we cope? Dont worry, Excel already knows how to solve this problem for us. We use the Dollar sign, $, to tell Excel when we should let Excel change B1 to B2 to B3 ... or to keep it as B1 ... In cell E4 we amend the formula to read in cell E4 it says D4*B$1 in cell E5 it says D5*B$1 in cell E6 it says D6*B$1 You can drag down that formula to as many rows as you like and B$1 will stay as B$1. If we were to transpose the calculation table, however, we need to think again:

In this case cell D5 contain the formula =D4*B1 and now we want to drag it to the right to find the VAT amounts for items 2 7. If we use B$1 this happens: in cell E5 it says E5*C$1 in cell F5 it says F5*D$1 in cell G5 it says G5*E$1 In this case, starting with B$1 is wrong, we should use $B1 and then we will get: in cell E5 it says E5*$B1 in cell F5 it says F5*$B1 in cell G5 it says G5*$B1 Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 53 of 159

We can see that putting the $ sign in front of the letter or number part of a cell reference anchors that letter or number. Formally, we have moved from relative addressing where letter and/or number can change when it is dragged to absolute addressing where the elements that are anchored with the $ sign means that it cannot change however far we drag it.

Try it!
Take it a stage further by yourself now: here are the possible combinations you might use for the absolute addressing of cells and ranges: B1 $B1 $B$1 B$1 In a blank work sheet create examples that will allow you to use these four variations. We will be using absolute and relative addressing throughout this book. Range Names This is the final session in this chapter and it relates to something we will be using over and over again in this book: range names. Up to now, we have defined ranges in this way: A1 and B8:D15 and BA101:ZF1000. As we have seen in the previous section, though, there are times when we want to use a cell or a range more than once and to that end we drag a cell or range reference and forget to turn it into an absolute address. We might not spot what we have done and eventually find that we have made a real mess of our work. A good example of the kind of situation we might come across where simply using notation like this A1:D15 can be improved upon includes something like this, an example we have already seen: Month March April May June July August September October November Machine hours 30 63 49 38 57 73 19 53 42 Labour 347 521 398 355 473 617 245 487 431

When we used this example before we calculated these values: Total Average Count Minimum Maximum Range Standard Deviation Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 54 of 159

When you worked with this example before you probably found it was a bit awkward to program the formulas, even though we used the same range, B2:B10, for the SUM as for the AVERAGE as for the COUNT ... for the machine hours and similarly for the Labour cost. Using a range name, now, though, we are going to increase our productivity by a very large amount. Open the work book basics8.xlsx and 1 2 select the range B2:B10 then in the name box type the word machine and press <Enter> select the rangeC2:C10 then in the name box type the word labour and press <Enter>

Now, here comes the productivity saving: In B11 In B12 In B13 In B14 and so we we we we on can can can can enter enter enter enter =SUM(machine) =AVERAGE(machine) =COUNT(machine) =MIN(machine) In C11 In C12 In C13 In C14 and so we we we we on can can can can enter enter enter enter =SUM(labour) =AVERAGE(labour) =COUNT(labour) =MIN(labour)

Try it!
Complete the calculations in the range B11:C17 for Machine hours and Labour as appropriate. Your answer should look like this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 55 of 159

Wherever you are on that work sheet, you can use the range name machine instead of the range B2:B10 and you dont need to remember whether it should be B2:B10 or $B2:$B10 or $B$2:$B$10 ... Using range names is not only a good idea, it is a productivity saving device and it saves your memory ... the bonus being that the chances of making mistakes with ranges is probably reduced by using range names. Text box If you are a Microsoft Word and/or PowerPoint user then you are probably familiar with the Text Box utility. Text boxes are also available to be used in Excel 2007. We use text boxes to highlight features of a work book or work sheet; or to enter text and instructions in such a way that they dont interfere with the workings of the work sheet. To create a text box: Click on the Insert Tab Click Text Box Click wherever on the work sheet you would like to place the text box and it is immediately ready for you to enter something in it

Try it!
Open an existing work book or create a new work book and create a text box for one or more work sheets: enter into it, for example, your name, the name of the work book and a sentence telling the user what its for ... You might then have this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 56 of 159

Not very exciting though is it: it doesnt stand out at all! Lets format the text box.

Formatting a Text box


Firstly, select some text in the text box and make it bold and/or italic and/or underlined ... any font feature you like:

Try it!
Make sure you can change the formatting of the text in your own text boxes.

Text box Styles


Excel 2007, more than any previous version of Excel, has made available a large range of built in styles that we can use to enhance our text boxes: Click on a Text Box Click on the Format Tab Select Shape Styles and choose the format you would like to use

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 57 of 159

Here we are:

Notice that the text box has been reformatted along the lines of the style we chose and it has retained the changes we made earlier. If you think the style options provided by Excel are not enough, click on the more styles option to reveal even more options:

In case you hadnt noticed, you can move your text box about your work sheet, you can copy and paste it and you can resize it: add more text and resize the box to your hearts content. CHAR() There are times when you might want to put a special character or symbol in a cell or a text box. You can use Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 58 of 159

Click Insert Tab Click Symbol Select the symbol you want: they are sometimes difficult to find! Alternatively open a blank work book Change the font for that cell or check to make sure its the font you want (different fonts can give different characters. For example, Wingdings only give pictures not numbers and letters) In cell A1 of the work sheet you now see enter =CHAR(ROW()) Fill down to row 255 Print out your listing for ready reference and/or save the file for future use We have changed the function to =CHAR(A1) and filled down and across as you can see, to prepare a much smaller table than a continuous list from A1 to A257 or so

Changing the font can have this effect: Wingdings Symbol

Note that the first 32 characters are always NULL, that is blank or empty or having no value. Of course, you do not have to prepare these tables just to find the symbol you want. It might pay you to learn the ones that you use most and enter it directly into a cell or formula. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 59 of 159

For example =CHAR(163) = and the UK Pounds sign is not always available on all keyboards but its always available by using =CHAR(). The work book symbols.xlsx has been prepared for you and shows the three fonts shown above. As a third alternative, there is another character set you can access by Click the cell where you want to put a character Click the <Alt> key and keep it pressed Select any combination of numbers on the KEY PAD (NOT the numbers at the top of the keyboard, they wont work): from 1 to 255 If you want to know why there are apparently TWO sets of characters, do an internet search for ASCII and ANSI codes. Conditional Formatting We have looked at formatting already: making this bold and putting them in italics, changing the fonts and all the rest of it. How about formatting something if it meets a given criterion though? Cant imagine what that means? Imagine you have prepared a budget report that contains columns for Budget Actual Variances In the simplest case, the only thing we need to worry about is whether a variance is positive or negative, favourable or adverse. In a more complicated world, though, we will realise that some variances are more important than others. We might want to apply management by exception and make a note of and do something about any variance that is, for example, more than 5% or 6% or any other percentage away from the budgeted amount. There you are: we have now found at least two situations for which we might want to highlight or flag or format something as a result of one or more criteria or conditions. Build a work book that recreates the budget report shown below and save it as condit_format.xlsx:

Your report must contain formulas to calculate automatically the values of Gross profit Net profit Variances

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 60 of 159

The report is rather ordinary, you must agree: not only is it just ordinary, there has been no real attempt to distinguish in a meaningful way between favourable and adverse variances. Lets look at a just one or two ways in which conditional formatting can help to spice up our report: The following report uses one of the many inbuilt conditional formatting set of rules: so simple to use Highlight the range D4:D8 Click Home Tab Click Conditional formatting Select Icon Sets

Excel has analysed the data and decided that relatively large positive numbers are good, green tick relatively small positive numbers are uncertain, exclamation mark negative numbers are bad, red cross

Try it!
Open or create a work book that includes the report shown above and use Excels conditional formatting capabilities to highlight the various values in the variance column in as attractive and value adding way as possible. Use the Data Bars option in conditional formatting to see how that can improve or detract from your report:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 61 of 159

Programming with Conditional Formatting


Rather than merely accepting Excels built in conditional formatting decisions, we can programme our own and the following graphic and explanation explain what to do.

OK, not massively more attractive yet but we have done something rather special to the Variance column. What we have done is to tell Excel 2007 to do this: If the value in any cell in the Variance column is greater than or equal to 1% of its budget figure then give that cell a pink background and a bold blue font If the value in any cell in the Variance column is less than or equal to -1% of its budget figure then give that cell a gray background and a bold red font Otherwise leave the cell alone Hmm, rather complicated. What it means in plain English is that if any value is outside the threshold of 1% of budget, it must be marked as exceptional and therefore flagged for action. How does Excel 2007 act on our rule, though? It does so by using Conditional formatting: Select the Variance column: range D4:D8 Click Home Tab Select Conditional Formatting

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 62 of 159

Select Manage rules

Select New Rule

Select Use a formula to determine which cells to format and then enter your first condition in the text area (Excel will enter =$D$4>=0.01*$B$4 once you have typed =$D$4>=0.01*$B$4 but you MUST change that to =$D4>=0.01*$B4 otherwise Excel will Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 63 of 159

anchor your formula in cells D4 and B4 and they must be allowed to change as it moves down your selected range) Choose the font, colour, background etc that is presented or that you want to associate with this rule by clicking on format and making your choices Click OK

Repeat the process for the second condition and format your result (Excel will enter =$D$4<=-0.01*$B$4 once you have typed =$D$4<=-0.01*$B$4 but you MUST change that to =$D4<=-0.01*$B4):

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 64 of 159

Try it!
Change the conditions in the conditional formats as if the threshold for the variances is 2%, change the font colours and cell background colours according to your own design ideas.

The REPT() Function and Conditional Formatting


In the IF Statement section of this chapter we programmed a results table with a pass/fail threshold of 55%. Here is that table again but with an additional column. The third column has been programmed as follows: =REPT("|",F16*10) ... the first result is in cell F6, which are formatted as percentages but which have been entered as decimals; and we have changed the font to Wingdings

Try it!
Format the results of the REPT() function in the third column to appear in red if the result is fail and dark blue if the result is pass. Now enhance your conditional formatting to take this change to the rule into account: Pass is greater than or equal to 55% Fail is greater than or equal to 35% but less than 55% Bad Fail is less than 35%

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 65 of 159

Data Bars dont start at Zero There is an aspect to conditional formatting that needs to be explained and thats what Edward Tufte calls the lie factor: see the web page http://www.math.yorku.ca/SCS/Gallery/lie-factor.html. This lie factor comes from the fact that when Excel 2007 was developed, they built a lie factor into conditional formatting by making sure that no data bar that has a value of zero will ever start at zero. Take a look for yourself at the following table in which all three values are equal to zero:

We have stretched column B to exaggerate the point to enhance the point but you can see that the salaries of the three unfortunates are zero and yet the conditional formatting data bars dont start at zero. What has happened is that, apparently, the Excel 2007 developers were told that no one wants any data bar to show as empty even though the value on which it is based is zero. You can read this page to see a little bit more about this issue: http://www.juiceanalytics.com/writing/excel-2007-andlie-factor/ Data Bars Start at the Smallest Value but ... Data bars start with the smallest value in the formatted range but they do not start at zero by default. Take a look at what this means in reality:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 66 of 159

Our three employees have been awarded salaries now and we have chosen to compare them by using conditionally formatted data bars but you can see what has happened: Bakers bar has a value of 975 and Ables bar has a value of 1,000 while Charlies bar has a value of 1,200 but are their data bars in proper proportion to each other? Not a bit of it. Is there a solution to this problem? Fortunately there is, as follows: Set your data bar range and then manage or edit that rule like this:

Excel 2003s default is the have the shortest bar set equal to the Lowest value: change that to type: Number and its value to 0 and then click OK to give this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 67 of 159

Again, we have stretched column B to emphasise the change we have made but it is clear for all to see the effect of setting the shortest bar to Type: Number with value zero. Showing Data Bars Only If you are satisfied with the way that data bars are working for you now, thats fine but here is one more enhancement that you might like: showing data bars only. The following screenshot shows you what happens when you tell Excel 2007 to show data bars only, meaning that the numbers on which they are based are hidden. Like this:

Introducing and Working with Array Formulas To introduce the concepts behind array formulas, we will use a more direct approach than before. To do this open the file arrays_1.xls and follow the instructions below which will help us to build our array formula knowledge step by step and in detail. Using an Array Formula to Enter Characters In a case like this, array constants, you need to type in the = and the {} even though it's an array and they are not always needed. To put 10 in A4, 20 in A5, 30 in A6 and 40, 50 and 60 in the range A7:A9 respectively: select A4:A9, type in exactly what you see below and then press Ctrl+Shift+Enter: ={10;20;30;40;50;60} ... note you are using a semi colon to separate the numbers Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 68 of 159

Using an Array Formula to Enter Characters in a 4 x 3 Range To enter the numbers 1 - 12 in a 4 column and 3 row range, select the range B11:E13 then type: ={1,2,3,4;5,6,7,8;9,10,11,12} note you are using commas and semi colons to separate the numbers now ... why? and press Ctrl+Shift+Enter In the range G11:J13, array enter a formula that will find the square roots of the values that you have entered in the range B11:E13. Use an array formula to enter the days of the week in the range F15:L15, give that range the name DayNames and then array transpose that range into the range E16:E22 Copy Ranges Using Array Formulae Use arrays formulae to copy the contents of the range M25:O28 to the range P30:P33 Use the outline grid in the range S35:AE46 to construct the 12 times table using array formulae. Give your grid the name timestable (excluding the headings) and use array formulae where necessary to derive the values suggested by the headings in the range AG37:AG41. For the three smallest values from the table, you need to use the SMALL function. Find the total Number of Letters in text In cell AK47 use an array formula that includes using the LEN function to find how many characters there are in the words in the range AI47:AI60. Use the ISTEXT function in an array formula to find how many cells in the range AI47:AI60 contain text Arrays Can Eliminate the Need to Clutter Your Spreadsheet We just want to know the average of all differences between the results of a pre test and a post test trial from a market research survey, all found in the range AM63:AN76. Using an array function, put the average in cell AO78. Similarly, find the maximum of the differences and put the result in cell AO79 and finally find the minimum of the differences and put that in cell AO80.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 69 of 159

Chapter 2: Charting
Introduction This chapter is concerned with the communication of spreadsheet based ideas. The chapter is concerned with charting or the preparing of graphs. The chapter begins by introducing the main concepts of the chart: how to prepare one, the various types or styles of chart and how to add date, change titles and axes and so on. The chapter is then concerned with more advanced aspects of charting such as preparing combination column and line charts, waterfall charts, radar charts, charts driven by comboboxes and so on. The chapter concludes with a brief review of dashboarding: the communication of ideas by means of multiple and various charts presented all at once. The Rules of Charting The following mind map sets out the major rules for drawing good charts. You need to understand and use these if you are serious about preparing and presenting good charts:

Setting up a Chart the Easy Way: the F11 key There are several ways to setting up a chart in Excel and we will begin by using the easiest possible method: the one key depression method. Consider the following table: this table contains data that we worked with in chapter 1. Month March April May June July August September October November Machine hours 30 63 49 38 57 73 19 53 42 Labour 347 521 398 355 473 617 245 487 431

Open a new work book and copy and paste the above table: paste it into cell A1 in the work sheet. Save the file with the name charting1.xlsx Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 70 of 159

Select the range A1:B10 Press the F11 key There you are, your first chart. Yours might or might not look like this:

When you prepare a chart using the F11 key method, you automatically are given the default chart that has been set up in your computer. If you have never prepared any charts on your computer before, the default chart will be the one that Microsoft has decided for you. If someone else has been using your computer, they might have set their own default chart. In any case, you might or might not like the default chart or you might think that the current default is no longer appropriate for you. We discuss changing the default chart after the next section. Before we go any further, lets make sure we are both using the same type of chart. To make your chart look more like ours: Select your chart ... just left click anywhere on it Make sure you have selected or are on the Design Tab and click Change Chart Type:

You can see that our chart is an XY (Scatter) chart, as follows: but we want to change it to a line chart, also as follows

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 71 of 159

Make sure you have selected the line chart and then we can tidy it up and finish it. Excel 2007 really has improved the life of anyone who needs to prepare charts: the Charts Layouts section, for example, is a good starting point:

The options in this Charts Layouts options area are really templates that will automatically put titles, axes, legends, gridlines and so on on the chart. Choose the option highlighted above to give you a chart with everything we need for now. Firstly, the titles fine: big and bold and centred at the top of the chart Lets delete the legend: there is only one data series so we dont need a legend. Just click on the legend and press the delete key ... if you are not sure, you will know its the legend key if you put the cursor over it and some text appears that says ... Legend Entry Change the names of the Axes by clicking on each of them in turn, selecting the text and over typing horizontal axis = Months vertical axis = Machine Hours resize the axis labels by selecting them and then on the Home Tab changing the font size: depending on the font chosen, size 16 could be fine. If size 16 is too small for your font either change the font or choose size 18 or 20 ... Resize the size of the axis labels: the values and the month names ... do the same as for the axis names, choose font size 14 for them You might want to dress up your chart a little more by exploring the chart styles available to us: choose the one you like, our selection is shown below

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 72 of 159

By choosing one of these styles, you need to know that it might reset some of the changes we have just made: font sizes of axes names and labels. Never mind, accept what you get or revise them again. Depending on the chart style you have chosen, you should see something like this now:

Default Chart Change Lets change the default chart so that when you press the F11 key from now on, it will always select that new chart. Remember, you can change your default chart at any time to anything you want so there is nothing permanent in what we are doing here. Select the chart you would like to use as your default chart Select the Chart Tools, Design Tab Click Change Chart Type Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 73 of 159

Click on Set as Default Chart Whenever you use the F11 key method of creating a chart, the chart you have just set as your default will be the one you choose.

Try it!
Do this for yourself: start with the chart we have been working on and set it as your new default or create your own chart and then set it as your default. Creating a Template Chart You can also save one of your charts as a template chart: essentially this option allows you to save more than one default chart. Select or create the chart you would like to set as a template for your future use Click on the Chart Tools, Design Tab Click on Set as Template You would be wise to accept the default location of your templates and just enter a name for your new template in the Save Chart Template dialogue box.

Try it!
Time for you to build your own chart and edit it. Go back to the data work sheet: use <Ctrl>+<PgDn> for that Select the non contiguous ranges A1: A10 and C1:C10 Press the F11 key ... this is a good time to see your new default chart! Click Change Chart Type on the Design Tab Click Templates, at the top of the dialogue box and then click on what may be your only template in the My Templates area to the right. Now edit it until you get something like this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 74 of 159

By saving and using your new default or your own template(s), you should have noticed that great saving in time from preparing your first chart to preparing your second.

Try it!
Whilst we are dealing with a fairly simple data set, why not prepare another chart for machine hours: A column chart and/or An XY (Scatter) chart An Area chart A pie chart

If you don t like this version of a pie chart, right click on the pie itself and choose something like pie explosion 75%:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 75 of 159

In other words, play with the charting options and become familiar with them. Spend an hour or so in serious contemplation of the charts and options on offer.

Try it!
Use the following data to prepare what you consider is the best chart. Remember that you are communicating ideas and data in a chart so your choice of chart is important. This table has already been put into manuf_output.xlsx for you. You might find it easy to work on the manufacturing data only at first: partly because this table contains a relatively large amount of data compared to what we have worked on before. Then you can expand your analysis. Manufacturing Output Data for the UK economy from 1976 to July 2008 Manufacturing All All Extraction production engineering of oil & gas industries industries 1976 83.5 74.3 75.2 8.3 1977 85.1 78.1 76.5 24.3 1978 85.7 80.4 75.1 35.3 1979 85.8 82.1 74.2 50.5 1980 78.7 76.4 70.2 51.2 1981 74.3 73.3 64.8 56.5 1982 73.8 73.4 65.8 64.4 1983 75.3 75.3 67.1 70.5 1984 78.0 75.8 71.5 75.3 1985 80.3 79.7 75.0 77.3 1986 81.6 81.5 73.4 78.3 1987 85.5 84.8 75.9 79.5 1988 91.7 89.2 83.4 73.3 1989 95.3 91.1 90.0 61.7 1990 95.2 91.1 89.7 62.6 1991 90.4 88.1 83.7 66.7 Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 76 of 159

1992 90.5 1993 91.7 1994 95.9 1995 97.4 1996 98.1 1997 99.9 1998 100.2 1999 101.7 2000 103.8 2001 102.5 2002 100.2 2003 100.0 2004 102.5 2005 101.7 2006 103.7 2007 104.4 Not seasonally adjusted Constant 2003 prices 2003 = 100 rd Updated on 3 September 2008

88.5 90.4 95.1 96.8 98.1 99.5 99.7 102.2 103.8 102.4 100.6 100.0 101.2 99.6 100.4 101.0

83.0 84.1 89.9 92.5 95.8 98.0 101.5 105.4 110.2 107.3 99.2 100.0 104.7 103.5 107.9 109.6

71.5 81.1 100.5 104.5 110.3 109.5 112.4 117.7 113.6 107.2 105.9 100.0 91.7 82.7 75.3 73.3

To help with your efforts, here are just three examples of what you can do with this table of data: you should consider how well these charts communicate their information.
Manufacturing Output Data for the UK economy from 1976 to July 2008
120

100

Index of Output (2003 = 100)

80

60

40

20

1985

1986

1987

1988

1989

1990

1991

1992

2006

Years

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 77 of 159

2007

1976

1977

1978

1979

1980

1981

1982

1983

1984

1993

1994

1995

1996

1997

1998

1999

2000

2001

2002

2003

2004

2005

Manufacturing Output Data for the UK economy from 1976 to July 2008
2006
2004

2002 2000
1998

1996
1994

Years

1992 1990
1988

1986 1984
1982

1980
1978

1976 0.0 20.0 40.0 60.0


Index of Output (2003 = 100)

80.0

100.0

120.0

Manufacturing Output Data for the UK economy from 1976 to July 2008
140.0

120.0

100.0

80.0

60.0

40.0

20.0

0.0

1970

1975

1980

1985

1990

1995

2000

2005

2010

2015

-20.0 Extraction of oil & gas Manufacturing All production industries All engineering industries

Embedding a Chart with the Chart Wizard So far we have worked with each chart on its own work sheet. Suppose you want to include the chart on the work sheet next to the data rather than that? Thats an embedded chart and its not difficult to achieve such an objective. The way to take almost complete control of any chart you want to prepare is to use the Chart Wizard from start to finish. By using the wizard, you take greater control over the chart creation process and can accept or reject the default, any templates ... Open the file charting1.xlsx and select the range A1:B10 in Sheet1 as we prepare the Machine Hours chart again. Select the Insert Tab Click on whichever of the chat type icons you prefer: Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 78 of 159

o o o o

Column Line ... In the Other Charts icon you can chose between a number of different charts, see the screenshot below for full details:

For demonstration, lets choose the Bar Chart option: Clustered Bar Chart (the first icon in the sub menu). Once selected, an embedded Clustered Bar Chart is placed on the work sheet.

Try it!
Go through this process again but this time choose a 2-D Area Chart.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 79 of 159

Having prepared your chart in this Wizardy way, you should notice that the ribbon is dedicated to helping you further:

There are two other sub menus ready to help you: Layout and Format

The best way forward now is to experiment with these menus and see what happens.

How about these, for example?


Machine hours
March April
May June July August

September
October November

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 80 of 159

Embedding by Moving Using the F11 method of creating a chart is fine although it has the restriction of preparing the default chart. The other possible limitation of using the F11 method is that it prepares your chart on its own sheet. However, we might want the chart to be embedded on the work sheet that contains the data we are working with. Here is the method you should use to move your chart from its own sheet to being embedded in another sheet. Open the charting1.xlsx file if it isnt already open and open any of your charts. Right click the chart as near to the edge as possible and choose Move Chart from the options on offer:

In the dialogue box you see now, make the following selection and click OK:

This will give you:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 81 of 159

You will find sometimes that the font sizes are not the best and you might have some adjustments to make: it will be obvious if the chart doesnt look good when you copy it to a work sheet and you might have to move it to where you really want it on the sheet. Again, play with it until you are happy. We are going to take a bit of a leap now. What we mean is that we have introduced many of teh basic aspects of charting for you and encouraged you to try things out and explore the various icons and menus and so on. What follows now is a series of examples relating to various charts and/or charting techniques. You might not need all of them but we do recommend you work through them as they contain several techniques that will boost your spreadsheet understanding and productivity. Titles and Axes Labels One of the most frustrating things that we can face when we prepare chats is typing out the title and labels for the axes. Well, Excel has come to the rescue because there is an easy way to enter them. In the case of the machine hours chart, go back to that file and do this: Click once on the title of the machine hours chart In the formula bar enter = Use your mouse to go click on cell B1 which says Machine hours Press Enter Repeat the same process for the horizontal axis title and for the vertical axis

As if thats not clever enough, go back to cell B1 and change something ... that change will immediately be made in the title of the chart too Do the same with your axis labels and they will change too You might ask when its best to use this technique. Well, consider the next section where it comes into its own.

Copy Charts: make clone and move them


In some cases, you might prepare a chart and then need to prepare a very similar one: for example, you might prepare a chart of sales for a few years for Company A, then you want a similar chart for Company B and so on. Here is how to copy a chart EXACTLY and with certainty. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 82 of 159

Go to any of the work books we have worked with that contains a chart on a chart sheet of its own. Left mouse click on the tab of the chart sheet you want to copy and keep the button pressed Press the <Ctrl> key and keep that pressed too Now slowly drag the mouse horizontally to the left or to the right and as you do so you should see a tiny icon apparently stuck to the cursor that looks like the one on the left Once you have got the icon clear of the tab you are copying, let go of the mouse button first and you should have a clone of the first chart. You might need to practise this until you do it faultlessly! By the way, if you just want to move a chart sheet or a work sheet around the work book, left click on a tab and drag that tab left or right by keeping the button pressed and only letting go when you have dragged the chart or sheet to where you want it. In that case, the tiny icon you will see apparently stuck to the cursor looks like the one on the left. Other Charts We have been inspired in part by the work of John Walkenbach and others as we prepared some of what follows. However, we have updated the examples so that they are compatible with Excel 2007. We have provided references at the end of the book for you to follow up where we have used other books and resources in this way. Category Axis Contains Labels from Three Columns When you want to fill the X Axis with more information than normal, do this: set up your table of data with, in the example that follows, three columns of information. Open multi_category_axis.xlsx City Bangkok Region Region 1 Month Jan Feb Mar Jan Feb Mar Jan Feb Mar Projected 700 750 800 450 475 500 300 300 300 Actual 734 745 709 492 492 495 239 275 210

Chiang Mai

Region 2

Pattaya

Region 3

Select the table to prepare your graph and set the first three columns as the X Axis data source. You can then set up column four as the source for the projected line or bar and column five for the actual line or bar, depending on the type of chart you are preparing. See the setup in the figure below for the Projected data series:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 83 of 159

Be careful, though, as this doesnt look too good with a large chart as the horizontal axis gets very full indeed. But heres a chart that does look good using this technique, based on the data given in the work book multi_category_axis.xlsx:

Try it!
You can use this technique to prepare charts with all sorts of data: all you need is a table with the data already in it or by generating a table of your own. Here is another table for you. This table is the same size and shape as the one in the work book multi_category_axis.xlsx so you can simply copy and paste it there if you wish as you start to explore this technique on your own. The following is the price list of a small range of specialist vehicles being built for a small vehicle market. The prices are in units of currency and the List price is the price in the companys catalogue

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 84 of 159

whereas the Actual prices represent those that are actually achieved, on average, in the market place. Model Springbok Style Town Size 2000 2200 3000 1800 2000 2500 2500 2800 3500 List 7,900 8,750 10,000 7,450 9,475 11,300 10,350 12,700 13,900 Actual 7,634 8,745 9,999 8,192 9,382 11,575 10,950 12,675 14,200

Ibyx

Rugged

Impala

Country

Note: if you simply copy and paste this table into the work book you will probably have to reposition the Legend ... select the chart and use the Layout Tab to locate the icon you need to make the change. Conditional Colours Setting a chart with conditional colours can be very effect but is not really new. Here are the before and after charts: one without conditional colours and one with:

No Conditional Colours
100

80 60

Data

40 20
0 -20 -40 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

Month

To turn our chart from one with bars all the same colour to one where various classifications of value are coloured differently, what we do is to split or slice the data different categories. The formulas we need to use are relatively advanced for a novice so work carefully with this chart if you are a novice. The basic data are as follows: Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Data -16 -20 12 22 45 56 84 90 54 21 12 -31

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 85 of 159

However, in this case it makes sense for us to classify our data in two or more class intervals. The class boundaries we are going to use are: 0 33 33 66 66 100 To achieve this aim, we reorganise the table to look like this: Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Data -16 -20 12 22 45 56 84 90 54 21 12 -31 0 -16 -20 33 66 100

12 22 45 56 84 90 54 21 12 -31

To make this table and this technique as useful for us as possible, we should program the table with formulas that will give us the general solution that will always work: Allowing for a work sheet title and so on, the above table starts in cell A4 then In cell C5 we enter =IF(B5<=$C$4,B5,"") and copy that down to fill the range C5: C16 In the cell D5 we enter =IF(AND($B5>C$4,$B5<=D$4),$B5,"") and copy that down and across to fill the range D5:F16 We then create the graph based on data in these ranges =Sheet1!$A$4:$A$16,Sheet1!$C$4:$F$16 In full, the table, complete with all formulas is as follows:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 86 of 159

You can work out the formulas for columns E and F from there.

Try it!
To appreciate whether this solution is a general solution, change the values in the column headings and see what effect it has on how and where the data appear in the table and how they are coloured on the chart. What this means, for example is that you can change the class boundaries from the original to these new ones or any new ones you can to try ... make any changes to see how they work. Original 0 33 33 66 66 100 New 0 20 20 50 50 100

The screen shot that follows comes from conditional_colours.xlsx you would make the changes to the class boundaries by changing the vales in cells D4:F4 from to 33 ... 66 ... 100 20 ... 50 ... 100 if you want to try the example given in the table above

why not try changing it to 45 ... 75 ... 100

and anything else that appears appropriate.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 87 of 159

Finally, consider having a table, or changing the above table, so that there are five or six or even more columns or class boundaries. Waterfall Chart You've probably seen a waterfall chart although Microsoft Excel doesn't have a feature or function to prepare one. Waterfall charts are commonly found in Annual Reports and Accounts of Companies are can be very effective. Rollover Here is a waterfall chart you will prepare if you work through this section:

In this version of a waterfall chart we have started with the first data point and that is in blue. For each subsequent addition to the data set we have created a floating bar that starts where the previous bar stops and it then adds the new amount. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 88 of 159

In this chart the units are values but you could prepare a waterfall chart based on percentage changes; and we have presented a graphic of such a waterfall chart. The question is, of course, how did we make the bars apparently float? This is how we did it. Firstly, the data on which the chart is to be based: Period 1 2 3 4 5 6 7 8 Sales () 15,450 16,448 18,591 19,944 18,976 18,486 18,028 20,376

Fine but it needs to be rearranged to look like this:


Period 1 2 3 4 5 6 7 8 Sales ()_a Sales ()_b Sales ()_b_2 Change ()_1 Change () _2 15450 16448 15450 998 0 18591 16448 2143 0 19944 18591 1353 0 18976 18976 0 968 18486 18486 0 490 18028 18028 0 458 20376 18028 2348 0

That is: the initial data, for period 1 then offset one column to the right all of the subsequent data then offset by a further column to the right the previous month's value prior to the change the positive change values the negative change values

It is vital to show all of this information in this way so that we can control the appearance of each bar (especially their colours, eg negative changes to be shown as red bars). It might help to see the formulas in this range of the spreadsheet:
Period Sales ()_a =ROW(INDIRECT("1:8")) 15450 =ROW(INDIRECT("1:8")) =ROW(INDIRECT("1:8")) =ROW(INDIRECT("1:8")) =ROW(INDIRECT("1:8")) =ROW(INDIRECT("1:8")) =ROW(INDIRECT("1:8")) =ROW(INDIRECT("1:8")) Sales ()_b 16448 18591 19944 18976 18486 18028 =C14+2348 Sales ()_b_2 =IF(E9=0,C9,C9-E9) =IF(E10=0,C10,C10-E10) =IF(E11=0,C11,C11-E11) =IF(E12=0,C12,C12-E12) =IF(E13=0,C13,C13-E13) =IF(E14=0,C14,C14-E14) =IF(E15=0,C15,C15-E15) Change ()_1 =IF($C$9-$B$8<0,0,$C$9-$B$8) =IF($C10-$C9<0,0,$C10-$C9) =IF($C11-$C10<0,0,$C11-$C10) =IF($C12-$C11<0,0,$C12-$C11) =IF($C13-$C12<0,0,$C13-$C12) =IF($C14-$C13<0,0,$C14-$C13) =IF($C15-$C14<0,0,$C15-$C14) Change () _2 =IF($C$9-$B$8>0,0,-($C$9-$B$8)) =IF($C10-$C9>0,0,-($C10-$C9)) =IF($C11-$C10>0,0,-($C11-$C10)) =IF($C12-$C11>0,0,-($C12-$C11)) =IF($C13-$C12>0,0,-($C13-$C12)) =IF($C14-$C13>0,0,-($C14-$C13)) =IF($C15-$C14>0,0,-($C15-$C14))

Secondly, notice that this is a very simple data ... This part is fundamental but simple.

Create a Stacked Column Chart


Prepare a stacked column chart from the above table by selecting the table and creating it (there are a few ways of doing this, so choose the method most familiar to you!). You should get this: Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 89 of 159

The smaller green and red bars are the ones we want to float, but at this stage they are not floating but sitting on top of the purple bars. We need to make the purple bars disappear and we do this in a very simple but effective way: click on any of the purple bars ... just once, to highlight all green bars on the chart. right click on any purple bar and select Format Data Series now the clever part: change fill to no fill/no colour and change border colour to no line/no colour then click Close or OK

There you are, your chart will now be a waterfall chart with floating bars.

Finished Waterfall Chart


Here is the finished waterfall chart.

Alternatives
You might have seen different waterfall charts: for example, there are waterfall charts with the main bar in the center of the chart and the floaters to the left and to the right. There are also waterfall Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 90 of 159

charts based on percentages rather than values. Look around at the reports you read and consider how these alternative charts are prepared. You really need to learn nothing new to prepare any variations on the basic waterfall chart, however.

Percentage Waterfall Chart


The percentage waterfall chart is a common thing to see: here's one, based on the same data as the chart above.

See also: http://www.duncanwil.co.uk/water.html

Try it!
Here is a table of data of exactly the same shape and size as the one we have used in this section so far. This new table contains some new data and you can simply copy and paste this table in the work book waterfall_chart.xlsx and paste the table into the range A7:C15, making the necessary adjustments, in the data sheet. For full value and to appreciate this method most of all, begin your preparation of the waterfall from scratch. Period 1 2 3 4 5 6 7 8 Sales () 54,397 52,184 48,581 47,197 38,731 52,626 45,670 50,535

Try it!
The following table is to be used to prepare a waterfall chart. This chart, however, is to be slightly different from the charts we have prepared in this section in that some people call it a bridge chart: a bridge chart looks like this. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 91 of 159

Period 1 2 3 4 5 6 7 8 9 10 Radar Chart

Sales 54,397 57,187 55,147 56,489 52,626 55,670 60,842 67,849 58,457 48,581

80,000 60,000
Sales ()
40,000

Sales and Changes in Sales ()

20,000 0 1 2 3 4 5 Period 6 7 8 9 10

Radar charts are very useful for comparing such things as income statements from period to period.

Try it!
Without any further help and guidance, you should be confident enough to be able to prepare a radar chart now. So, take the following income statements for an organisation for three separate years and prepare three separate radar charts. You will find the option to prepare a radar chart on the Inset Tab and in the Other Charts sub menu. Copy and paste the following table into an empty range on an existing work sheet or into a new work sheet, as you wish: Income Statements for the years ended 31st December Sales Cost of Sales Gross Profit Expenses Net Profit Dividends Retained Profit Values ($) 2007 266,324.00 194,416.52 71,907.48 17,976.87 53,930.61 3,775.14 50,155.47 2006 309,469.00 229,007.06 80,461.94 23,333.96 57,127.98 5,141.52 51,986.46 2005 358,985.00 222,570.70 136,414.30 35,467.72 100,946.58 5,047.33 95,899.25

Here is the first radar chart for you. We have prepared this chart simply by selecting the accounting headings (sales, cost of sales and so on) and the column for 2007.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 92 of 159

2007
Sales 100%

80%
Retained Profit 60% 40% Cost of Sales

20%
0% Dividends Gross Profit

Net Profit

Expenses

For subsequent years, you need to select the non contiguous ranges for account headings and 2006 then 2005. Self Expanding Chart We will prepare a self expanding chart on the basis of the following initial data set: self_expanding.xlsx> You will appreciate that the preparation of a self expanding chart is a relatively complex thing to do so please work through what follows very carefully. Date 01 Oct 02 Oct 03 Oct 04 Oct 05 Oct 06 Oct 07 Oct 08 Oct 09 Oct 10 Oct 11 Oct Sales 499 603 581 633 635 621 512 654 709 580 725

You can create a self expanding chart by selecting a range much larger than the data range you start with and then adding data as you need. The chart will expand using this solution but the right hand side of the chart will be empty. Consider two alternative and better solutions:

Excel 2007 Solution 1


Type in the list/convert the data to a table: On the Insert tab, in the Tables group, click Table and create a column chart by pressing the F11 key this list and the chart will expand automatically when you add new data.

Excel 2007 Solution 2a


Alternatively use NAMEd formulas Formulas Tab Define Name enter the word Dates. In the Refers to field enter this formula: Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 93 of 159

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1,1) Notes substitute the name you have given to your worksheet if it's not Sheet1 and that the OFFSET function refers to cell A2, the COUNTA function counts down the entire column and then the formula subtracts 1 from the number. Click Add in the Names in the workbook field enter the word Sales. In the refer to field enter this formula: =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B)-1,1) Note the range begins with cell B2. Click Add Close the Define Name dialogue box

Excel 2007 Solution 2b


Activate the chart and choose Chart Source Data In the values field enter Sheet1!Sales In the Category (X) Axis labels field enter Sheet1!Dates STRICTLY SPEAKING you should enter the filename!Sales and finlename!Dates since named formulas are file level formulae and not sheet level formulas. Click OK Test your work by adding some more data now. Selecting Data from a Combo Box As with the previous example, the self expanding chart, you need to work carefully through what follows in this section. Open the file combobox_chart.xlsx The figure below shows a chart that displays data as specified by a drop down control (known as a Combo Box). The chart uses the data in B1:E2, but the month selected in the Combo Box determines the contents of these cells. Range A6:D17 contains the monthly data and formulas in B2:E2 display the data using the value in cell A2. For example, when cell A4 contains the value 4, the chart displays data for April (the fourth month).

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 94 of 159

The formula in cell B2 is =INDEX(A6:A17.$A$2) This formula was copied to C2:E2 and it is the key to the graph as what appears in cells C2:E2 are the values that appear on the graph. The key here is to get the Combo Box to display the month names and place the selected month index into cell A2. To create the Combo Box, follow these steps: 1 Select Developer ... Insert ... to display the Forms toolbar.

2 3 4 5 6 7

On the Forms toolbar, click the control labelled Combo Box (Form Control) and drag it into the worksheet to create the control. Right click the Combo Box and select the Format Control option. In the Format Control dialogue box, click the Control tab. Specify A6:A17 as the Input range, and A2 as the Cell link. Choose the number of dropdown lines you want: how many months you will see, in this case, when you click the down arrow of the control when you use it ... 6 is a good number Click OK to dismiss the dialogue box now and start using the combobox

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 95 of 159

You'll find that the Combo Box displays the month names and puts the index number of the selected month into cell A2. Spreadsheet Allowing the User to Highlight Alternative Scenarios This exercise does not involve the creation of a chart: it is aimed at consolidating your knowledge and use of a combobox. This spreadsheet also contains an inbuilt function VLOOKUP() that we will use extensively later but that you can explore here too. Open the file scenario_selection_using_combobox.xls and use your knowledge of comboboxes to help the user of this file to select the data relating to any one of three separate but related scenarios at any one time. This file is already fully working so you are required to explore how it works and to experiment with it as you wish.

Table and Chart Selection Including a Combobox This example also encourages you to explore the use of a combobox. The main objective of this example is that of communication: how best to communicate budget, actual and variance data in an effective and uncluttered way. Again, this example is already fully worked for you to explore at your own leisure. This example also incorporates the VLOOKUP function. Open the file budget_actual_variance_selection_using_combobox.xlsx and see how to program the spreadsheet to allow the user to select at any time a chart showing one of: The budget data The actual data The variance data

In addition, you should format the variance analysis chart to show red markers/bars/lines for adverse (negative) variances and blue or black markers/bars/lines for favourable (positive) variances.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 96 of 159

Charts with Scroll Bars Here is an example of a chart with scroll bars: the scroll bars are uses, in this case, are used to control the number of months to be shown on the chart, five in this case.

This chart is the most complex chart we have prepared to date, so please read and work with it very carefully. Firstly define the NAMEs to be used in the chart to which you wish to assign the scroll bars. In the file

scroll_bars.xls

NumMonths = cell D1 Months = OFFSET(Sheet1!$A$2,0,0,NumMonths,1) Balance = OFFSET(Sheet1!$B$2,0,0,NumMonths,1) In the Select Data of the graph now, you can enter Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 97 of 159

Sheet1!Months for the X Axis and Sheet1!Balance for the Y Axis Work through the following and whenever you use the scroll bars, the number of data points will increase or decrease according to the value in cell D1 that the scroll bars assign for you. The Scroll Bar control can be added to the worksheet or to the chart itself. Adding it to the chart offers an advantage: If the chart is moved, the scroll bar will move with it. The following instructions add the Scroll Bar control to the chart. 1 2 3 Select Developer Click the chart to activate it now select Insert ... Forms to display the Forms toolbar. On the Forms toolbar, click the Scroll Bar control and then drag in the chart to create the control. You can size and position it just as you can any other graphic object.

4 5 6 7 8 9

Right click the Scroll Bar and choose Format Control from the shortcut menu. This displays the Format Control dialog box. In the Format Control dialog box, click the Control tab Enter 1 n the Minimum value field. In the Maximum value field, enter 12 (the maximum number of data points for the chart). Set the Incremental change field to 1 and the Page change field to 3. In the Cell link field, enter NumMonths. This will link the Spinner control with cell Dl. Click OK to close the dialog box.

After performing these steps, the value in D1 will be controlled by the Scroll Bar and will have a numeric range of 1-12. This value, in turn, will control the number of data points shown in the chart. As a further exercise, you could turn this into a self expanding chart.

Try it!
Basic Chart and Rates of Change Chart For this exercise, you are given some data and the solution. Your task is to work out how the chart has been put together. You are also required to consider the meaning of the charts as they add a great deal of value over and above an ordinary chart on its own. The table is to be interpreted as follows: JD Wetherspoon is a company managing and operating public houses and restaurants in the UK and it is a public limited company (plc). The actual data represent the actual sales for the company for the years given in the left hand column. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 98 of 159

The rates of change column is calculated as follows: = Where t0 is 1998 t1 is 1999 t2 would be 2000 and so on For Example, for the two years 1998 1999 ... designated as 1998.5 as between years in the final column of the table: = 269,699 188,515 100 = 0.4307 100 = 43.07% 188,515 1 0 100 0

JD Wetherspoon: ten year financial review


Turnover from continuing operations Year Actual Data Rates of (000) Change (%) 1998 188,515 1999 269,699 43.07% 2000 369,628 37.05% 2001 483,968 30.93% 2002 601,295 24.24% 2003 730,913 21.56% 2004 787,126 7.69% 2005 809,861 2.89% 2006 847,516 4.65% 2007 888,473 4.83%

Between Years

1998.5 1999.5 2000.5 2001.5 2002.5 2003.5 2004.5 2005.5 2006.5

We have prepared just one chart here; and we are sure you have notices that there is a vertical axis on both left and right hand sides of the chart. We need to give you a hint to help you with the double axis.

Double Vertical Axes


Select the data for your chart using the first three columns only Leave the actual data alone Right click on one of the data points for the rates of change data and select Format Data Series From the dialogue box you see now, select Secondary Axis Format the rest of the chart and so on as you wish: you might not like our colour scheme so feel free to choose your own!

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 99 of 159

JD Wetherspoon: ten year financial review


1,000,000 900,000 800,000
700,000

50% 45% 40%


35%

600,000 500,000
400,000

30% 25%
20%

300,000 200,000 100,000


0
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007

15% 10% 5%
0%

Years
Actual Data Rates of Change

Additional Charting Exercises One of the major objectives built into these exercises is for you to be able to use the Text to Columns utility. In addition, the exercises encourage you to consider the most appropriate chart(s) to use in the circumstances. You are also encouraged to begin thinking about the statistical analysis of such databases as you are faced with here.

Text to Columns
When we copy tables of data from some web sites or we download data from an intranet, it has been formatted so that it can be used in a word processing file, a spreadsheet file. If your data comes in a* .txt file or a *.csv file, you may need to use the Text to Columns utility. Example 1 Its difficult to predict exactly what form your file and its contents might take but the symptom is that when you paste the contents into a work sheet, you might find something like this:

In this case, the months of the year are all crammed into one cell rather than across 12 and the same with the values linked to them. In this case there is just a space between the words but in others there may be a comma or a semi colon or who knows what! If this happens all is not lost, try the following Click on the Past Options smart tag and select match destination formatting and that MIGHT solve your problem Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 100 of 159

Rate of Change in Sales (%)

Sales ('000)

If it doesnt help select the data you need to correct, making sure in the case of our example here there are 11 blank columns to the right of the column your are in Click or scroll to the Data Tab Click text to columns

In the dialogue box that follows make sure Delimited is selected then click Next>

You should now select Space from the options presented and in the display neat the bottom of the dialogue box you can see here that we have solved our problem as Excel is telling us that it has now put jan and 10 in its own column, feb and 11 in its own column and so on

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 101 of 159

It should be obvious that if there is a comma between the words and numbers rather than a space, we need to choose comma from this dialogue box. And the same according to whether its a space, comma, tab or semicolon. If its something else, the final option is to tell Excel what it is: just select Other and in the box to the right of the word other, enter the delimiting character. At this stage you can normally press finish but if you need to tell Excel that you are dealing with a date or text then click Next and select that option before clicking finish. Example 2 How about this example, what can we do with this example? This example came from the web site www.ons.gov.uk: thats the British Governments Office of National Statistics web site and when you download a data file from there it often looks like this unless you download it directly into an Excel file. Copy the data you see here into a blank work sheet, starting in cell A1 " " " " " " " " " " " " " " " " " " " " 1988",91.7,89.2,83.4,73.3, 1989",95.3,91.1,90.0,61.7, 1990",95.2,91.1,89.7,62.6, 1991",90.4,88.1,83.7,66.7, 1992",90.5,88.5,83.0,71.5, 1993",91.7,90.4,84.1,81.1, 1994",95.9,95.1,89.9,100.5, 1995",97.4,96.8,92.5,104.5, 1996",98.1,98.1,95.8,110.3, 1997",99.9,99.5,98.0,109.5, 1998",100.2,99.7,101.5,112.4, 1999",101.7,102.2,105.4,117.7, 2000",103.8,103.8,110.2,113.6, 2001",102.5,102.4,107.3,107.2, 2002",100.2,100.6,99.2,105.9, 2003",100.0,100.0,100.0,100.0, 2004",102.5,101.2,104.7,91.7, 2005",101.7,99.6,103.5,82.7, 2006",103.7,100.4,107.9,75.3, 2007",104.4,101.0,109.6,73.3,

Now select the data and use Text to columns to split the data into columns and when you are confident that you can do that move onto the examples that follow to use this technique and then prepare one or more charts according to the exercises.

Try it!
Open the following .doc files one at a time and follow the instructions given in them:

manuf_uk.doc retail_sales_uk.doc rpi_uk.doc

Deriving Values from Published Charts From time to time we come across charts that are published in newspapers, magazines and so on that are either in hard copy format or are in the form of a graphic. You might want to derive the data from the chart so that you can construct the table on which the chart might have been based. Here Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 102 of 159

are two examples of charts we have recently come across and for which we wanted to prepare the table of data on which they were based:

Both of the charts come from The Economist at http://www.economist.com/business/displaystory.cfm?story_id=12887368 Here are the tables of data we derived from the charts: For chart 1 above
Manufacturing Value Added as % of total GDP Germany Japan United States Britain France Source: OECD 1996 22.0 22.6 18.5 20.5 16.0 2006 22.5 20.5 14.0 13.0 12.6

For chart 2 above


Share of World Merchandise Exports, % Germany United States France China Japan Britain Source: World Trade Organisation 1983 9.25 11.30 5.20 1.50 8.00 5.20 1993 10.50 12.50 6.00 2.50 10.00 5.00 2003 10.10 9.75 5.20 6.00 6.30 4.10 2007 9.80 8.50 4.00 8.75 5.30 3.30

These tables are very accurate but how did we prepare them with such accuracy? This is the method: Paste the graphic into a work sheet Prepare the outline tables, for example as above Estimate the values from the chart and put them into your table Prepare the appropriate chart: bar, column, line ... from your table of data Resize your chart and graphic to be equal to each other and of such a size that you can read them both comfortably Right click the graphic and click Send to back Overlay your own chart over the graphic Use your judgement and any other technique you can to assess as accurately as possible what the actual values are and adjust your table accordingly

Not everyone will need to do this but if you do, this method is accurate and reliable although it will inevitably take some time to do. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 103 of 159

Dashboards Here are a few examples of dashboards that we have found on the web: all we did was to search for the word dashboard using google. What you might be able to see from here is that a dashboard is essentially a summary report that largely uses graphics. Excel 2007 was developed at least in part with dashboarding in mind. It is now relatively easy to prepare dashboards and dashboard charts using Excel 2007. One key feature of dashboard is that they are usually top level reports. Moreover, each element of the dashboard contains a hyperlink that might allow you to click through to a larger version of the image you have clicked. In addition the dashboard might allow you to drill down to more detailed report of just that section of the dashboard. One of the beauties of dashboarding is that there are not set rules as to how they are prepared but of course they should follow the general rules for charting that we put into that mind map near the beginning of this chapter. The beauty is that dashboards are flexible reports: your imagination is all that limits what you might do. Take a look at dashboards in your favourite search engine to see the wide variety of examples being developed.

Source of all images

Source of image

Source of image

What can we put into a dashboard? Whatever you like is the answer. Just take a look at the few examples we have provided here: Deep and detailed financial information Sales analysis Dashboard for an art gallery Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 104 of 159

In essence, then, what we need to do to prepare a dashboard is to Prepare one or more tables of data Generate a series of charts and images from the data Combine the charts and images on one screen/page as you can see above

Try it!
The following data come from the file dashboards.xlsx and you are encouraged to experiment with that file and prepare your own dashboard report. The examples below comprise raw data from the companys income statement and four charts: everything has been pasted here as images. Dashboard Report
Dashboard Example Sales Cost of Sales Gross Profit Expenses Net Profit 2009 738,766.00 258,568.10 480,197.90 422,574.15 57,623.75 2008 545,462.00 250,912.52 294,549.48 265,094.53 29,454.95 2007 571,265.00 257,069.25 314,195.75 263,924.43 50,271.32 2006 706,558.00 233,164.14 473,393.86 397,650.84 75,743.02 2005 678,713.00 298,633.72 380,079.28 326,868.18 53,211.10 2004 596,955.00 185,056.05 411,898.95 362,471.08 49,427.87 2003 745,187.00 268,267.32 476,919.68 424,458.52 52,461.16 2002 580,868.00 191,686.44 389,181.56 330,804.33 58,377.23 2001 659,406.00 224,198.04 435,207.96 387,335.08 47,872.88 2000 502,524.00 251,262.00 251,262.00 216,085.32 35,176.68

Sales
400,000.00 800,000.00
600,000.00 400,000.00 350,000.00

Cost of Sales
300,000.00
250,000.00

200,000.00
-

200,000.00 150,000.00 2009 2008


2007 2006 Sales 2005 2004 2003 2002 2001 2000 100,000.00

50,000.00
-

2009 2008 2007 2006 2005 2004 2003 2002 2001 2000

Gross Profit
600,000.00 600,000.00

Expenses
500,000.00
400,000.00

500,000.00
400,000.00

300,000.00
200,000.00

300,000.00
200,000.00

100,000.00
-

100,000.00
-

2009 2008 2007 2006 2005 2004 2003 2002 2001 2000

1998

2000

2002

2004

2006

2008

2010

2012

In the Excel file dashboards.xlsx, there is a second table, ratio analysis and your task is to complete this table in the Excel file prepare new charts from them and prepare a dashboard report from them

More Advanced Chart


In the dashboards.xlsx file there is a tab entitled adv_ratios that we have used to prepare the following chart:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 105 of 159

Sales Growth Rates


30% 25%
20%

15% 10% 5% 0%
-5%

-10% -15% -20% -25% 2009 - 2008 2008 - 2007 2007 - 2006 2006 - 2005 2005 - 2004 2004 - 2003 2003 - 2002 2002 - 2001 2001 - 2000

Positive Growth

Negative Growth

This chart is similar to the Conditional Colours Chart in some respects and we have programmed this sales growth chart for you: it is on the sales_growth_b sheet in the Excel file. Feel free to use Excels Hyperlink utility to create links between your report, your charts and your table of data: Insert Tab ... Links ... Hyperlinks

You can see from this screenshot that you can create a hyperlink from this file to another file or from this file to another part of the same file.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 106 of 159

Chapter 3 Introduction to Pivot Tables In this chapter we will be exploring the use of Pivot Tables to analyse such data as Simple lists of data Departmental information Analysis of the sales ledger Preparing budget reports

Formatting a pivot table report Using calculated fields Using page fields Pivot charts Introduction A Pivot Table (PT) is one of the most useful and flexible functions or utilities built into the modern spreadsheet. With the advent of Excel 2007, we now have PTs that are not only flexible but that are stable and very easy, exceptionally easy, to work with. Prior to Excel 2003 PTs were generally fine to work with but trying to get information out of a PT could be a nightmare as we had to use the =GETPVODATA() function and it was far from easy to learn and apply and it was far from stable. You will not have those problems with the Excel 2007 PT. Definition of a Pivot Table Here is a very basic definition of a PT: we will be exploring this definition initially. However, as this chapter goes on we will see that there is more to a PT than is described here. Chapter 4, 4 Pivot Tables 2, will take our understanding of PTs to an even higher order. A pivot table is a data summarisation tool found in ... programs such as spreadsheets (eg Microsoft Excel, OpenOffice.org Calc, Lotus 1-2-3). Among other functions, they can automatically sort, count and [sum] the data stored in one table or spreadsheet and create a second table displaying the summarised data ... The user sets up and changes the summary's structure by dragging and dropping fields graphically. This "rotation" or pivoting of the summary table gives the concept its name. Source: http://en.wikipedia.org/wiki/Pivot_table The essence of a PT is that it is a list organisation device and from such lists we can create a very wide range of reports and analyses: as we will see. You might think that we have understated the nature of a PT by saying it is a list organisation device but no. From a list of assets or the output from the payroll or a list of sales generated by sales person, by product by area ... we can produce reports that add a lot of value without the need for us to consider layout, order and so on before we prepare a PT. Why you need a Pivot Table Imagine you need to prepare an analysis of a database you have just downloaded or from your companys own database. There are 2,000 lines of data in the database There are eight columns:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 107 of 159

Now you are given this job to do: present an analysis along the following lines Basic data by country Basic data by industry By profitability o o By country By industry

By asset turnover o o By country By industry

By return on capital employed o o By country By industry

You are required to include in your analysis tables showing Total, Average, Maximum and Minimum Sales values Profit values Asset Values Market Capitalisation Values o o By country By industry

You are required to show detailed analyses of the three industries with the highest average sales values and the three industries with the highest average rate of profitability You are also required to prepare charts of your findings Oh! All of this is required within 30 minutes. Oh! And its 4:30 pm on Friday afternoon and at 7 pm you are catching a low cost airline flight to Prague for a weekend away with your partner!! What are you going to do? a) Will you? Refuse to take the job as you believe it to be impossible? Panic? Start and do the best you can and hope what you can achieve in the time allowed will get you off the hook? Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 108 of 159

Share the job: delegate various tasks to as many of your colleagues as you can find and dragoon into solving your problem b) Or are you going to use Pivot Table functionality and guarantee that you will be catching your 7 pm flight having comfortably met your deadline? Once you have studied the basics of Pivot Tables in this chapter you will be in the position of catching your flight rather than spending potentially many hours in trying to answer the above questions. Pivot Table functionality will improve your productivity possibly more than learning anything else in Excel 2007. Example PTs If you have never seen a PT (and I work with hundreds of people a year who think they are intermediate level users of Excel but who have never seen a PT let alone create one!) lets start our discussion and description of them by showing you one. You will also see the source data on which the PT has been built. Here is the first part of a list of data taken from the file create_pt.xlsx. Open that file to see the entire list: the sales records for an organisation selling hardware and software. Month January January January January January January January January January January Sales Person Harrington Harrington Drury Drury Harrington Harrington Smythe Smythe Williamson Williamson ID 345678 345678 123456 123456 345678 345678 567890 567890 456789 456789 County Essex Essex Yorkshire Yorkshire Essex Essex Essex Essex Derbyshire Derbyshire Region South East South East North East North East South East South East South East South East Midlands Midlands Sales Type Software Hardware Hardware Software Software Hardware Hardware Software Software Hardware Amount () 311,569 568,944 789,504 255,975 89,005 103,900 654,300 145,900 54,900 99,875

Here is a specimen PT derived from the entire table:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 109 of 159

As you will see very shortly, within around 10 seconds we have turned our list of 50 rows and 7 columns into a highly organised table summarising them in terms of Sales of person Sales values analysed by sales type Imagine doing that without a PT! Of course, it can be done but not with such speed and accuracy unless you have already prepared your work sheet to analyse, prepare subtotal s and so on. How did we do that then? Like this: Firstly, your table MUST have column headings for EVERY column to be included in the PT analysis. Excel doesnt really care what the heading is. There must be no column or row breaks in your table or Excel will set up your PT wrongly for you. Put your cursor anywhere in your table: again, Excel doesnt care where in your table. Click the Insert Tab and then Pivot Table You will then be faced with this dialogue box:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 110 of 159

This dialogue box shows you the range of data that Excel has found for you: it is always worth checking that it has found the list you want. For example, if your table has column or row totals already included, dont include them in your PT. At this stage, you can click OK providing the option New Worksheet has been selected. Immediately, you will be presented with a blank PT (by the way, Excel 2007 is much more efficient in this respect than Excel 2003!):

Note the four sections of the PT:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 111 of 159

Note also that as long as your cursor is somewhere in the PT apart from the Page Field area, the Task Pane will be shown to the right of the PT: when you click away from the PT the Task Pane will disappear. Not a problem, but you probably do need the Task Pane visible as long as you are editing your PT. You can now do one of two things: Drag and drop the field you want to include and analyse in your PT or Click the fields you want to include and analyse in your PT At this stage you can safely click to select the fields as Excel 2007 is generally intelligent in knowing the kind of data we are dealing with here.

Try it!
As carefully as you like, select the following fields for inclusion in your PT and watch carefully what happens. Month Sales person Sales type Amount

If you wish select then unselect the fields as often as you like to see exactly what is happening; but this is what you are likely to see when you have selected those four fields: once you are confident with this process, this PT will probably take you 2- - 30 seconds to prepare. In many cases you can now simply print it off and send it to the relevant person or intranet or wherever you choose.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 112 of 159

COUNT of instead of SUM of When we create a Pivot Table and select our values or amounts, Excel 2007 will normally create a name for the series which might be, for example, Sum of Sales or Sum of Profit. Now, whilst the names that Excel 2007 chooses for us are usually as ugly they can be changed (see the next section editing a column heading). However, here we want to mention why sometimes a heading doesnt say Sum of ... but Count of ... even though the data on which that column is based looks exactly like the data in all other values columns in your original database. What will have happened here is that in the column that is now called Count of ... there is either one blank cell or more in your data column one cell or more containing text rather than values in your data column If there are blank or text formatted cells in that column, find them and correct them and that should make Excel 2007 accept them as normal data columns. Editing a Column Heading The names that Excel 2007 gives to a column heading in a Pivot Table are usually ugly but they can be changed: to do that, double click on a column heading, a dialogue box opens and you can over type the given name and make your changes. However, you cannot choose a column heading that is the same as a heading that has already been used. What that means is that if, for example, our database contains the heading Person, we cannot Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 113 of 159

use that heading in the Pivot Table. Heres a handy tip though: you can appear to choose the same heading by, for example, doing one or more of these things: put put put put a space before the word Person a space after the word Person a hyphen in front of or after the word Person an underscore in front of or after the word Person

That is, as long as the heading is at least one character different, Excel 2007 will accept your revised name and a space is a valid character as are hyphens and underscores. Pivot Table Layout The weak spot with PT analysis is the layout of the PT: its not always exactly what you want. In the case of the PT we have just prepared there are two things that need to be looked at: Column width Field totals Column width: for some reason, the programmers at Microsoft have yet to get to grips with this! Take a look at your PT and you might find that the words November and December have not been allowed to fit their column width:

The solution here is the select the columns as you would when formatting any other column and double clicking the divider between columns. We think that this is an annoyance! Field totals: you might be happy with your report as it is. However, let us just point out that Excel 2007 has decided on your behalf that you should have a sub total for each of: January and Sales Person and Sales type

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 114 of 159

If you are happy with these sub totals, then fine: there is nothing further for you to do. Lets suppose for the moment, though, that you only want the Monthly sub total, so this is what to do! Either Click Right on the Sales Person column heading in cell B4 Select field Settings Select Subtotals None ... this approach removes the subtotals only in the field you selected Or Pivot Table Tools Design Tab Select Subtotals Do not show subtotals ... this approach eliminates all sub totals in your PT

That sub total has now gone ... reverse this process to put it back if ever you want to!

Repeat the process for Sales Type and you will be left with this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 115 of 159

Easier to read dont you think!

Try it!
Finish off the formatting now by getting rid of the sub total for the Month to leave you with the following final version of the PT for now:

Copying a Pivot Table

A Copy of a PT is a Clone of a PT
One vital thing about a PT that you need to know is that every copy of a PT is a clone of the original PT. What this means is that if, for example, you copied and pasted a PT somewhere then you accidentally deleted your original PT, your copied, cloned, PT has kept absolutely everything that was in the original PT. So, if you do have an accident with a PT you can always get it back to square one if you have one or more copies of it. Marvellous! Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 116 of 159

Copying your PT
As with many things in Excel 2007, there is more than one way to copy a PT. Here are just two ways to copy your PT: Method 1: Copy the work sheet that it is on: as we saw in chapter 2 (in the section Copy Charts: make clone and move them), click on the PT sheet tab, keep the left mouse button pressed on the tab, press and keep pressed the <Ctrl> key and now drag the tab to the right or left until you can see the down arrow icon move to the right or left of the tab you are trying to copy. Let go of the mouse button and there you are ... this movement takes practice. Look back to chapter 2 for a more detailed explanation of this manoeuvre. You can now make any changes you wish to your new and old PT. Method 2: select the entire PT ... to do this, just click on any cell in the PT ... do not select a few or nearly all sells, but the whole PT. You know you have selected the entire PT because it looks like this, with blue outlines:

Right click the table Select Copy Put your cursor at the top left hand corner of the range where you want to paste your copy PT (same work sheet or different w0rk sheet and even a completely different work book) Paste It should now have pasted your PT as a clone PT. Changing Sum of to Average of to Count of ... Here is a screenshot of a PT of the Forbes 2000 database of the worlds largest companies by Sales values: lets assume that Sum of ... is the default but that we want to change, lets say, Sales from Sum of Sales to Average of Sales ...

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 117 of 159

We made the change from Sum of ... to Average of ... just for the Sales column and we did it within 10 seconds, this way: Right click anywhere on the Sum of Sales column Select Summarise Data by ... Average ... THIS IS NEW TO EXCEL 2007

Instantly, the Sum of Sales column changes to Average of Sales and all necessary calculations have been done. You can repeat these changes change from Sales to Count to Average ... as and when you wish and column by column.

Try it!
Dont just sit there, try this for yourself with every one of your first five or six PTs until it is etched in your brain. Moving a Field from Row to Column So far so good but what else can we do? Well, look at the column Sales Type: we can see that Hardware and software are there, but they are on top of each other. What this means is that Excel Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 118 of 159

2007 has automatically put them into row format whereas we think they ought to have put them into columns. There are two ways of PIVOTING or moving a field from a row to a column and vice versa: Drag and move the chosen field within the PT Drag and move the chosen field within the Task Pane Drag and Move Within the PT Left click on the column heading you would like to move: Sales Type in this case and move your cursor a little and you will see an icon like the one on the left, below. This icon reflects the layout of a PT, as per the larger icon on the right:

As you move the icon ... slowly ... up and down, left and right, you will see that the various sections will change from white to blue as you get to the relevant part of the PT: Page Field Column Row Data Area

Note: when working in a PT, this icon is very small and you will almost certainly make mistakes with your dragging and moving until you have tried this a few times.

Try it!
Click on the Sales Type column heading in your PT Drag and move the Sales Type to put it into a column, when your PT should look like this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 119 of 159

Now we can see that every sales person has got their Hardware and Software sales properly aligned against them and there is no wasted space in this PT. Drag and move the chosen field within the Task Pane This is a much easier option whereby we drag the relevant field from one part of the Task Pane to another: Before After

Finally, there are Grand Totals for both Columns and Rows (although only row totals are shown above). If you dont want those Grand Totals, do this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 120 of 159

Right click in the Grand Total column heading and click on Remove Grand Total Repeat this process for the row Grand Total heading. (We will explore an alternative approach for this later)

Try it!
Remove the grand totals from your own PT. Filtering a Field One of the easier things to do with a PT is to filter a field: the reason being that Excel makes it so simple of us. Remembering that our create_pt.xlsx database has 408 active cells, filtering it before we prepare our PT would be a bother: its not a big database but the possibility of making mistakes is always there. Having prepared a PT, then, all we need to do is to do the following:

Each column or field heading has a down arrow next to it and that is the key to filtering Imagine, for example, that we only wanted our PT to show us the first six months of the year, we want to filter out July December: Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 121 of 159

Click the down arrow next to the field heading Month Deselect July ... August ... September ... December Click Ok Your PT now looks like this:

Of course, reversing the process and putting July December back again is a simple job: Click the month down arrow Click Select All Click OK

Try it!
Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 122 of 159

Filter the months of the create_pt.xlsx PT again to filter out months other than July Dec Combine the filtering of months with filtering the Sales Person Combine the filtering of months with filtering the Sales Person and with Sales Type Combine the filtering of the Sales Person with the Sales Type but not with months And so on ... just try it until everything is crystal clear for you.

In some cases, filtering is not so straightforward. For example, in the Forbes 2000 databse and PT, each Field contains 2000 entries and as most of them are unique values, filtering may not be such a profitable exercise. Filtering the industries and countries could, however, be a profitable exercise. Sorting a Pivot Table There are times when you might want to sort one or other of the fields in your PT. In a large list or database, for example, you might have some cells and even ranges of cells that are blank or have a zero value. In such a case you could sort the relevant field so that all of the rows at the top of the PT have values in them. Compare the following before and after screenshots of one PT, the Forbes 2000 database for 2008: Before After

To carry out the sorting process, click somewhere in the Field you would like your PT to be sorted on: this is important! Pivot Table Tools Options Sort ... in this case we have selected the Average Sales Filed so the dialogue box opens as Sort by Value: Ensure you select Largest to Smallest AND Top to Bottom to repeat what we have shown above: Then click OK

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 123 of 159

You will have noticed from the previous two screenshots that some values have no decimal places, some have two decimal places some have a lot more decimal places. This is not good reporting practice and it makes the PT difficult to read. Here is how to format values in a PT. Formatting Fields There are at least two ways of formatting values in a field in a PT, here is just one of those methods, using the Task Pane: Left click once on the Field in the Value area of the Task Pane Click Value Field Settings

Click the Number Format button at the bottom left of the Value Field Settings dialogue box:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 124 of 159

The dialogue box you are now presented with should be very familiar and the screenshot below shows the settings that we have selected: Number 2 decimal places Select Use 1000 separator (,) Click OK

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 125 of 159

You will now be returned to the Value field Settings dialogue box Click OK Having repeated the process for the Average Profits Field, your PT will now look much better, like this:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 126 of 159

Calculated Fields In our grand set of questions at the beginning of this chapter we suggested that you were required to report profitability, by asset turnover and by return on capital employed. There are two approaches to calculating these values: Within the basic database in a very simple way: for example =A1/B1*100 where Profit is in cell A1 and Sales are in cell B1. As a calculated field within a PT

However we calculate the results, the answers will be the same: the profitability of HSBC will be the same under with both calculations and so will the profitability of General Electric, Bank of America and JPMorgan Chase. There are various possible reasons why we dont want to calculate the profitability and other ratios in the database but here we are going to set up some calculated fields. Go to and click on the PT you have already prepared for the Forbes 2000 and with your PT selected: Click on the Pivot Table Tools Tab Options Click on the Formulas down arrow Select Calculated Field

Where you will be presented with the dialogue box that will enable you to build a calculated field or formula based column you like:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 127 of 159

Give your calculated field a Name simply by typing on in the Name box Click on the Formula box where it says = 0 and delete the 0 Now, for example, click on the appropriate Field (you might have to scroll down to find the one you want) and then click Insert Field Now, if necessary, enter an operator in your Formula such as +, -, /, * and select another field Add anything else that will complete your formula Alternatively, begin the formula with a function such as =SUM, =AVERAGE, =LN, =EXP, +LINEST ... whatever it is you are trying to do Add anything else that will complete your formula Click OK if you have finished or Click Add if you want to build another formula Your formula will be added to the Fields lists ... again, you might have to scroll down the Fields list to see it/them In this case, here are two specimen formulas you should try: Profit_Margin =PROFITS ($BIL)/SALES ($BIL)*100 (for percentages, you might format the results in the PT and leave out the *100 part of the formula if you prefer) SQRT(Sales) = SQRT(SALES ($BIL)) Your new formulas will appear in the list of fields in the Task Pane too and you can select and deselect them there for inclusion or exclusion from your PT

Try it!
Using the Forbes 2000 PT again, prepare calculated fields to show Asset turnover: Sales Assets Return on Capital Employed: Profit as a percentage of Market Value Drilling Down Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 128 of 159

Make sure that you have included the Profit Margin calculated field in your PT and suppose that you need to, or want to, enhance your analysis of the Forbes 2000 by showing the detail behind it for the Aerospace and Defence Industry. Put your cursor on the Aerospace and Defence row for the Profit_Margin column Right click and select Show Details

In a new work sheet created especially for you, you will now see all of the detail for the industry you selected:

This is drilling down: you have now worked from the PT, the top of the summary of the data; and drilled down to the next level and revealed all of the data BUT only for the industry, in this case, that you selected. Calculated Item

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 129 of 159

Calculated items are a feature of a PT that allows you to create new items that are not part of the original source data that can appear in fields in your PT. Lets work through an example: we will use the create_pt.xlsx work book here. Imagine there has been a reorganisation and that Baker and Drury are working as a team to be known as DruBak. The question is, how can we reflect that in our PT without having to modify all of the source data? To achieve that objective we create a calculated item which represents the DruBak team. Click on the Sales Person Field heading or one of the Sales Person in the PT (selecting Sales Person tells Excel that you want to include an item relating to that field) In the Pivot Table Tools Options tab click on the Formulas down Arrow Click Calculated Item

You are now given the Insert Calculated Item in Sales Person dialogue box with which we can generate a formulate in the same way that we generate a formula for a Calculated Field.

In our case we generated a new Calculated Item called DruBak with the formula =Drury+Baker and clicked OK

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 130 of 159

Keeping our PT as simple as possible, here are the results of our new PT showing DruBak, Harrington, Smythe and Williamson ... Drury and Baker are deselected from the PT but of course they are still retained in the raw database:

The calculated item field is a real time and energy saver. In this case we would have had to have found and combined 13 separate rows of data to combine Drury and Baker manually.

Try it!
Open the work book calc_item.xlsx and create a calculated item by joining the North and East Regions. Other Calculated Item Features

Adjusting the Formula


Click on any of the calculated items you have prepared and you will see the formula of the item in the formula bar of your work sheet . Moreover, you can edit that formula ... on a cell by cell basis. What this means is that you can, for example, change the formula for, say, February alone by adding or subtracting any amount you like ... an adjustment because of an error, someone found an invoice and want to enter it here for a quick report. You can make any permanent changes to your database properly later of course.

More Complex Formulas


In the same way that any cell in a work sheet can contain anything that Excel has been programmed to accept, calculated items can take relatively complex formulas too. This means that you could enter an IF statement or even a nested IF statement in your calculated field if you wished: look at the page on the internet for an example of this that we have linked to at the end of this section.

Forecasting with a Calculated Item


Imagine you would like to include a forecast in your table based on the historical data that is already there. Using the calc_item.xlsx work book, click on the Month Field heading or on one of the month headings (eg, Jan, Feb ...) in the PT (this tells Excel you are entering a calculated item that is based on the Month field) Options tab Formulas Calculated Item Name the item Forecast_May Enter the formula = (Jan +Feb +Mar +Apr )/4 Click OK Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 131 of 159

You will see a new field called Forecast_May in your PT based on the above formula.

Try it!
Lets use something a bit more adventurous than the very simple average forecast in the previous example. Create a calculated item in the Month field called Forecast_May2 Enter this formula = (jan*1+feb*2+mar*3+apr*4)/10 Click OK Deselect the previous forecast Forecast_May

Here is another example, taken from the web link at the end of this section.

In this example, the PivotTable author had actual financial results for FY02 FY04 and wanted to create a forecast for the next financial year based on the actual for those three years. You can see in the screenshot above that they used the following formula: =IF(Year[-1]=0,Year[-2],2*Year[-1]-Year[-2]) The formula says "if last year's sales (which is what "Year[-1]" means) is 0, the projection is sales from 2 years ago, [otherwise] the projection is two times last year's sales minus the sales from two years ago." The [-1] modifiers are simply used to tell Excel to refer to previous and next values in that field, and it is particularly (but not exclusively) useful for financial calculations involving time periods. http://blogs.msdn.com/excel/archive/2008/05/08/pivottables-calculated-items.aspx Values

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 132 of 159

One the worst things that can happen to anyone who prepares a PT is that the data cells can be unformatted. In some cases values can be shown with no decimal places in some cells, two decimal places in others and, say, eight decimal places in yet others. Lets see how to format our PTs value cells. In fact, there are at least two ways of formatting a set of data: Right click on a column heading in the PT and select 1 Field Settings Left click on the Field Name in the Task Pane and select Value Field Settings

Whichever way you call the Value Field Settings dialogue box, you will see the same dialogue box and you can do several things while you are here:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 133 of 159

Change the name of the field: Excels default names are usually not that good and the only thing you need to know is that you cannot change the name to a field name that already exists. Change how to summarise the field: sum, count, average and so on (changing formats from sum to count or to average and so on is something we have already seen: right clicking on any cell in any field column will allow you to do that) Change the number format: this is the same dialogue box you see when changing the format of numbers in an ordinary work sheet cell or range

Try it!
Call up this dialogue box and change the format of one or more fields according to your wishes. Show Values As In the Value Field Settings dialogue box there is a second tab, Show Values As. Lets see what that might do for us now; but you might find this is a really exciting part of Excel because of the things it can do and the time it can save you. Click somewhere in the Sum of Profits ($bil) column Call up the Value Field Settings dialogue box by right clicking ... Click the Show Values As tab

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 134 of 159

We chose % of column under the Show Values As heading and then clicked OK:

... ... ... ... ...

We have now formatted the entire column as a percentage of the total ... with no calculations for us to do!

Try it!
Us the Show Values As tab of the Value Field Settings to change any field to any of the other settings you choose. Play with it and change things then change them to something else until you are happy with how this utility works for you. Under the Show Value As heading there are several options, in addition to % of Column and they are: Normal Difference From % Of % Difference From Running total in % of row % of column % of total Index

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 135 of 159

We will take a further look at these options in Chapter 5: Pivot Tables 2 Grouping PT Data One of the most useful things that we can do with data is to group it and present it in the form of a frequency distribution. We will talk about frequency distributions and histograms in chapter 6 when we look at the ToolPak Add In and Descriptive Statistics. After you see what we can do with the Show Values As dialogue box of a PT, you might find that you dont need the ToolPak Histogram for what you want to do. We will demonstrate the grouping of items in a PT by way of an example: you dont need to do everything that follows in order to group the data in your own PT. What we are essentially doing is killing two birds with one stone: setting up a grouped PT and introducing another couple of useful ideas. Open the Forbes 2000 work book if it isnt already open. Go to the PT you have already saved there even though we are going to rewrite that PT from the beginning.

Starting or Setting up a PT
The first thing to do is either to open up a PT that is ready to have its data grouped or, as in this case, to set up your PT: Remove everything from your PT so that it looks like this: it is an empty PT

Now, click the Sales ($ bn) Field and that will put the Sales ($ bn) in the Row Labels area of the Task Pane Drag the Sales ($ bn) Field to the Values area of the Task Pane TWICE This is what you should have now:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 136 of 159

Left click on the top Sum of Sales ($ bn) entries under the Values section Click Value Field Settings Select Summarise Value Field by Count Click OK Left click on the bottom Sum of Sales ($ bn) entries under the Values section Click Value Field Settings Select Show Values As Click the down arrow and select % of total (scroll down to find this option) Click OK

At this stage you will have this:

The Grouping Process


Now to group this PT: Either right click anywhere on the first column of the PT Select Group Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 137 of 159

Or Select Pivot Table Tools Options Tab and click Group Selection

Then Either accept the options you now see: Starting at and Ending at ..., or change them to the values you feel most comfortable with. The values Excel presents you with are the maximum and minimum values in that field. We recommend you round the numbers given to the nearest 5 or 10 (that is, Starting at -5 and Ending at 380 or Starting at -10 and Ending at 380) Accept the By (the class interval) value of 100 (for now and we will experiment with this later on)

Then you will see this:

How about that? Once you have tried this for yourself, you will find it is a simple and effective way of analysing data and then grouping it in the way you can see here.

Try it!
Clear your PT and repeat the previous example but this time use Profit ($ bn) or Assets ($ bn) or Market Value ($ bn) to prepare a grouped frequency distribution. Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 138 of 159

Change the column headings to make them more meaningful than the default names given by Excel When Grouping is a Problem There will be times when you get to the stage of grouping your data but you might find that Excel tells you that it Cant group that selection. Frustrating but not normally difficult to deal with!

Cannot Group that Selection is normally caused by one of two things. The first cause is that your data range includes blank cells within the field you are trying to group. The second cause is that you have both text and numeric data in the same field. To eliminate this problem, you have no choice but to go back to your data and find the source of the problem: Eliminate blank cells Reformat text as values if appropriate Eliminate text such as NA of #NUM! Or proper nouns or similar Once you have made all of the corrections, your selection will probably be able to be grouped. Pivot Chart We think it is worthwhile introducing Pivot Charts (PC) here now because the grouped PT we have just prepared gives us a simple starting point for them. We think that some PCs are very difficult both to read and to understand. Open your Forbes 2000 work book and select the grouped distribution PT from the previous section. Remove the % of total field in the Values section of the Task Pane o Excel will not understand it if you leave both of the two fields in the Value section On the revised Pivot Table tools Tab click the Options Tab Select Pivot Chart

The Insert Chart dialogue box will open: select Clustered Column Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 139 of 159

What you see now may be exactly the same as what you see below or a little different ... but similar ... we have already added a title and labels for the aces. Notice that in this case there are so many companies in the -10 90 class interval that it has skewed the chart enormously.

Try it!
Change the Class Intervals In the case of the chart we have prepared for the previous example, we ended up with a decent chart but the class intervals we chose werent that good: change them to something more sensible ... up to you what intervals to choose! As a matter of interest, we kept the minimum and maximum values unchanged in the Group by dialogue box but we changed the By (class interval) value to 5:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 140 of 159

There is no getting away from it, the data are still skewed but we are starting to see more detail now. Formatting a Pivot Chart Just look at the chart in the previous section: even though we have changed the class intervals from 100 to 10 and improved the chart, the columns are still very thin. Lets make the columns wider and easier to see: Right click any of the columns Click Format Data Series Move the Gap Width slider to the left until you can see the column is a wide as you want ... 100% in the example below:

Here is the PC on its own now, formatted for cosmetic appearance now! Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 141 of 159

Try it!
Ensure you have prepared the chart up to the point where we said ... cosmetic appearance ... Select the PC Click on the Pivot Chart Tools Design Tab Select the Chart Style you want to use Change the Chart Style a few times until you are confident with this utility

Here are three more examples:


Distribution of Companies
1,400 1,200

Distribution of Companies
1,400 1,200 1,400 1,200

Distribution of Companies
Number of Companies

Number of Companies

1,000 800 600 400 200 0

Number of Companies

1,000 800 600 400 200 0

1,000 800 600 400 200 0

Sales $ bn) Intervals

Sales $ bn) Intervals

Sales $ bn) Intervals

A Pivot Chart with a Data Table In an ordinary Excel chart there is the option to include the table of data on it frowm which the chart was drawn. A PC is no different: we have changed the class interval back to 50 just for demonstration purposes

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 142 of 159

Distribution of Companies
2,000 1,800 1,600 1,400 1,200 1,000 800 600 400 200 0 Total

Number of Companies

-10-40

40-90

90-140 140-190 190-240 240-290 340-390

1841

110

31

10

The data table shows the actual data column by column as well as illustrating the class intervals, also column by column.

Try it!
Reformat your own PC: Begin by NOT changing the class intervals just to see how it looks with a class interval of 10 Select your PC Pivot Chart Tools Design Tab Chart Layouts ... layout 5

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 143 of 159

Try it!
Open the work book create_pt.xlsx and create the following chart from the database you will find there:

Sales Data for DW plc


4,000,000 3,500,000

Amount ()

3,000,000 2,500,000 2,000,000 1,500,000 1,000,000 500,000 0 Hardware


Software

Harrington 3385093

Smythe 3559809

Williamson 1594725

DruBak 3221427

1136265

2087482

389850

3059744

Formatting The format that Excel chooses by default for a PT is often, lets be frank, dreadful and difficult to read. On the other hand, Excel 2007 has a lot of easy to reach options to make everything better for us. In this section, we will be using a basic PT, the one in the calc_item.xlsx work book and taking you through a series of formatting options in a very direct way, using:

Starting point:

Working across the Pivot Table Tools Design Tab from left to right: Subtotals: this has no effect on this table Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 144 of 159

Grand totals: off for rows and columns

Report Layout: in compact form (grand totals back on1)

Report Layout: outline form

Report Layout: tabular form

Using Pivot Table Styles Pivot Style Medium 10

Pivot Style Light 12

Pivot Style Dark 4

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 145 of 159

We have ignored the Pivot Table Style Options in the centre of the Design Tab: Row headers and Column Headers have been ticked so far. Banded Rows and Banded Columns have remained unticked:

Try it!
The formatting options available via the Design Tab are many: spend some time getting used to them. Dont finish playing with these options until you are confident with them and feel able to used them without any problems. See what happens when you untick The Row Header The Column Header See what happens when you tick The Banded Rows Banded Columns Here is Pivot Table Dark 4 again with some of the Headers and Banding options changed:

Try it!
Work out which settings we have changed to prepare that revised version of Pivot Table Dark 4. Page Fields Page Fields give a PT the wow factor for many people! We are going to demonstrate Page Fields using the Forbes 2000 work book. Open forbes_2000_2008.xlsx and click on the PT Make your PT look like this: Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 146 of 159

There is something new in this PT ... we have put the Country Field into the Report Filter section of the PT: we have not done that before. This is what that part of the PT looks like:

Page Fields have no effect on the PT until you activate them! What they do is to sit there with all data included in them by default until you ... Click on the down arrow to the right of the Country Page field Click the box Select Multiple Items towards the bottom of the dialogue box

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 147 of 159

Select All and then reselect Australia Click OK What you are left with is a PT that includes data ONLY for your selected country, in this case Australia. You can select as many or as few countries as you want.

Try it!
Use Page Fields to Select or Deselect any or all of the countries, leaving the country or countries you want ... do this at least five or six times to get used to what this feature can do. Multiple Page Fields If you wish, you can include two or more Fields in the Page Field area: this can give you a lot of options and flexibility in designing and presenting your PTs.

Try it!
Add, for example, the Company Field to the Report Filter area/Page field area and make changes to one then both Fields to see how the PT reacts to such changes. Reporting with Page Fields Whilst Page Fields/Report Filters are good and powerful enough, it is the reporting with them that gives the wow factor. Get rid of all but the Country Field from the Page Field/Report Filter area Select All in the Country Page field Click the Pivot Table Tools Options Tab Click Options Select Show Report Filter Pages ...

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 148 of 159

Now, get ready ... once you have clicked Country in this Show Report Filter Pages dialogue box and clicked OK

Did the screen flicker for a few seconds? Did you see that you have now suddenly acquired a whole host of new PT work sheets ... one for each country? Thats what makes people say wow! Here is just a snapshot of some of the country work sheets now available to you:

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 149 of 159

Right click the sheet tab scroll buttons, bottom left of the screen, to get that listing of all of the work sheets in the work book. Pivot Table from an External Source Here is a PT derived entirely from an external source of data. In this case we have used Excel 2007s functionality to go and find, in this case, a Microsoft Access 2007 Database file and virtually import the data into the PT. However, we did not need to import or even open the database file and all that our work sheet contains is the PT itself. See the work book pt-external_course.xlsx. The Access 2007 database we have used (budget data1 .mdbx) file contains a total of 31,680 records each with 11 fields: in spreadsheeting terms thats 348,480 cells. It takes a lot more time to locate the file than it does for Excel 2007 to interrogate it and generate the PT: in spite of the size of the file, Excel 2007 deals with this database extremely quickly. In summary this is how to use data from an external source, an MS Access Database file in this case Insert Pivot Table

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 150 of 159

Use an External Source Choose Connection

Browse for more ... New Source Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 151 of 159

ODBC DSN

MS Access Database

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 152 of 159

Find File

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 153 of 159

Click Finish

You will now arrive back at the dialogue box you started at and now you can click OK Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 154 of 159

The Access 2007 file is 5,576 Kb in size whereas the Excel file is just 784 Kb in size ... up to the point shown in the graphic below that is. Does this mean that we can generate a database file and by having the PT generated and maintained in Excel 2007, we have found a secure way of hiding our data? No, we can still drill down through the PT and find the underlying data: see the screenshot below.

Try it!
Open the file pt-external_course.xlsx and double click on the value, for example: Compensation Entertainment Budget 2,307,809 You should then be presented with a new work sheet containing all of the relevant records from the database relating to Compensation, Entertainment Budget. Notice that we have put Division and Department in the Page Field Section of the PT so the PT Report you see here is for the entire organisation.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 155 of 159

Here is a snapshot of the drill down report that shows a total of 660 records coming under the heading both of Compensation and Entertainment and Budget.

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 156 of 159

Try it!
You can apply much of the knowledge from this chapter now in relation to this major report. Reformat the PT using the Pivot Table Tools Design Tab options We have shown only the data for 2006 here but the database includes 2005 too: find a way of reporting on that data: o o In the existing PT In a new PT

Generate Page Field Reports for o o Each division: there is five of them Each Department: there is eleven of them

The database file and therefore the PT contains a Variance column that has already been included: assume now that you have been told there may be a programming error in the database file, create a calculated field to prepare a corrected version of the Variance column Drag the Month Field to the Page field area and generate a monthly report for the entire organisation. Here is a PC for the budget data for the entire organisation for all items of expenditure: comment on what you see here ... particularly the value of the Other category?

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 157 of 159

Budget 2006
8,000,000 7,000,000 6,000,000 5,000,000 4,000,000 3,000,000 2,000,000
1,000,000 0

Photocopiers

Conferences

Benefits

Computer Supplies

Books & Subs

General Office

Telephone

Other

Rent

Bonuses

Salaries

Computer Hardware

Outside Services

Entertainment

Maintenance

Payroll Taxes

Software

Try it!
Here is a final exercise for this chapter. Open av_bakery.xlsx which is data taken from the records of a bakery that produces just one type and size of loaf of bread. Output is at the rate of 19,400 loaves per day. From the Bakery Costs per Day provided, you are required to prepare two pivot table reports:

Report one
Include Departments 1 5 and Department 7 Include the following fields o o o o Department number as page field Dept No as row label Cost Heading as row label Classification as column labels

Format the PT in the most optimal way and do not include Grand totals for rows but do include them for columns

Report two
Include Departments 6, 8 and Departments 9 10 Repeat the format of Report one for this PT

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 158 of 159

Telecommunications

Commissions

Training

Utilities

Lease

Finally, as a NON PT solution, provide a summary of both tables to provide a total cost per day, as follows: Summary cost per loaf Total costs per day Number of loaves (net) Cost per loaf Summary cost per loaf by Department Number of loaves per day 19,400 Costs per day Average cost per loaf

19,400

Department Flour Storage Mixing Cut and Shape Proving Baking and Take off General Production Total Production Costs Boiler Repairs and Maintenance Distribution Administration Total Costs

This is the end of Part 1 of the book Excel 2007 with Excel Master. The other two parts of the book are: Part 2: Data Analysis Part 3: Decision Making

Duncan Williamson All rights reserved September 2009

Excel 2007 with Excel Master Duncan Williamson Part 1 of the book: Introduction to Excel 2007 Page 159 of 159

Vous aimerez peut-être aussi