﻿

# EXCEL data analysis training course

Télécharger EXCEL data analysis training course

★★★★★★★★★★3.5 étoiles sur 5 basé sur 1 votes.
Votez ce document:

### Télécharger aussi :

1: The Fundamentals of Excel

2: How to Start Excel, Creating and Saving Workbooks

3: Toolbars and Task Panes in Excel

4: Insert/Delete/Name/Move Worksheets

5: Cells, Moving Around Workbooks, Exiting

6: Basic Copy/Cut & Paste

7: Quick Copying Using the Fill Handle

8: Pasting Using Paste Special

9: Inserting Rows, Columns and Cells

10: Changing the Standard Default Options in Excel

11: Using the Undo and Redo Feature

12: Using the Format Painter to Copy a Cells Format

13: Using Dates and Times in Excel

14: Working with Custom Formats in Excel

15: The Basics of Excel Formulas

16: Excel Cell References. Relative and Absolute Cell References

17: Avoid Typing Whenever Possible. Use Your Mouse Pointer

18: Excel Arguments and Syntax in Formulas

19: Excel AutoSum Function/Formula

20: Excel Auto Calculate. Calculate Without Formulas

21: How to Use the Insert Function Feature to Create Formulas

22: Using Some of Excel's most Common Functions

23: Using Named Ranges in Excel as an Alternative to Cell References

24: Using Constants to Name Values and the Paste Name Dialog

25: Excel Calculations/How Excel Calculates/The Order of Calculations

26: Excel Cell Comments  27: Excel Find & Replace

28: Different Methods of Clearing Cell Contents

29: Effective Printing in Excel 1

30: Effective Printing in Excel 2

31: Sorting Data in Excel

32: Hide/Show Rows/Columns in Excel

33: Excel AutoFormats

36: Excel Worksheet Protection

37: Excel IF Formula/Function

38: Volatile Functions-Now & Today

# THE FUNDAMENTALS OF EXCEL

Spreadsheets have been in use on personal computers now for some years. They are used in nearly every office environment in the world for any number of reasons. In the past they were used only to perform basic math, such as adding, multiplying, subtracting and dividing. Today's spreadsheets can be significantly different and far more advanced. The leader in the spreadsheet field today is without doubt Microsoft Excel. The reasons for this will become apparent the more you learn about this very powerful program.

You will find that by following a few basic fundamental rules when starting a spreadsheet that you will be able to extract, change, modify, report, add and manipulate data in a way you never thought possible. Sadly most users of Excel never realise the full potential of what they are using. In fact all too many users simply use Excel as no more than a personal whiteboard, with the occasional calculation (formula) thrown in. This is a great shame as it is designed to do so much more than this.

We will show you how you can use Excel to achieve all your wants and need.  As we progress you will also find yourself wanting to know more and it can become an unquenchable thirst if you allow it to be (believe me we know!).  By the completion of these lessons you will be able achieve a lot more than you can now, but even more importantly you will have the knowledge to be able help yourself.

You will notice throughout the course that we do NOT use screen shots to aid you. This is done intentionally, as we believe that by doing so forces the student to think a lot more about what they are doing.

Excel is spreadsheet program that hinges entirely on three very important aspects.

•    The Workbook (the spreadsheet in its entirety)

•    Worksheets (pages or sheets within the Workbook)

•    Cells (contained on all Worksheets)

Remove any one of these aspects and Excel can no longer function.

# STARTING EXCEL

Before we go into any detail at all we need to know how to start Excel. Starting Excel is no different to starting any other Microsoft applications (Word, PowerPoint, Publisher, Access etc.) and can be done in any number of ways.

The three most common ways to start Excel are:

•    From the Microsoft Office Toolbar

•    From a shortcut icon on your desktop

•    By selecting the Start button located at the bottom left hand side of your screen, then selecting Programs then Microsoft Excel.

The first two may not be relevant to you if your computer is on a network, so if you don’t have these options available to you, select the third option. (If you wish to set up a shortcut to your desktop, or install the Microsoft Office Toolbar, please let us know and we will send you instructions on how to do so).

Lets now open Excel by selecting the Start button located at the bottom left hand side of your keyboard, then selecting Programs then Microsoft Excel and have a look at the screen in front of us.

# WORKBOOKS

Every single time you start Excel you are, by default, creating a New Blank Workbook. The name of your

Workbook has the default name of Book1, until you save the Workbook as a different name.  A

Workbook is like the outer shell of the spreadsheet and contained within it are the Worksheet(s) and cells.

When you start Excel you should first see a blue bar at the very top of your screen. This is called the Title Bar. The title bar is where you will see the name of your Workbook once you have saved it. (Note that if you have not yet saved a Workbook, the default will probably be Book1). As you are familiar with Windows, you will notice to the right of the Title Bar the Minimise (hyphen), Restore (two squares) and Close (X) buttons.

# SAVING WORKBOOKS

There are many formats that we can save our data in Excel as, but by far the most common is the default

*.xls. (The asterisk represents your chosen file name). Some of the other popular formats are the *.xlt (Template) *.txt (Tab delimited), *.xml (Extensible Markup Language - available in newer versions only) and *.web page (obviously a web page).

To see what we mean go to File>Save As and Excel will display the Save As dialog box (dialog boxes will be discussed later). This is where you initially give your Workbook a name (File name:), nominate a file type (Save as type:) and a location (Save in:).  We say "initially" as once you have saved a Workbook for the first time it will, by default, always save as that File name, type and location you have nominated each time you save.

If you select the drop arrow to the right of the Save as type: box you will see a list of all different types of formats an Excel Workbook can be saved as. You may notice that there are different choices of the .xls types. These different types are for backward compatibility with previous versions of Excel. You can also save the Workbook as multiple versions although, we strongly recommend doing this ONLY if you need to, as it will increase the file size by 10-50% and render some of Excel’s newer features as unusable.

When you are saving a Workbook for the first time Excel will display the Save As dialog box no matter which method we use to save. There are a number of ways to save a workbook, the most common ways that can be used are:

## •     Go to File>Save  •        Push Ctrl + S

•    Click the floppy disk icon on the Standard toolbar (discussed below)

•    Go to File>Save As .

If we close a Workbook that we have made changes to, Excel will ask us (via a message box) if we wish to save the changes we have made. If we close a Workbook without making any changes, no message will appear and Excel will close without saving. We will look at closing a Workbook below.

# CREATING MORE NEW WORKBOOKS

Just because we have one Workbook open does not mean we cannot create more Workbooks, in fact the only limit to the amount of Workbooks we can have open is restricted by the available memory of the PC.

There are also a number of methods that can be used to create more Workbooks.

## •     Go to File>New  •         Push Ctrl + N

•     Click the New icon on the far left of the Standard toolbar. It looks like a white sheet with the top right corner folded over. Don't worry if you cannot see this, as we will be looking at Toolbars soon.

Whichever method we use Excel will create a new Workbook and the name (by default) will be Book2 or the next number in the sequence. As soon as we have created our new Workbook it will automatically become what is known as the Active Workbook.  This means the workbook in which you are currently clicked.  The other Workbook will still be open, but NOT Active! This is because there can only ever be one Active Workbook at any one time.

To switch between open Workbooks, go to Window on the worksheet menu bar and you will see the names of all open Workbooks. To activate one of the other open Workbooks, simply select its name and it will become the active workbook. Close Book2 now so that we only have one Workbook open. As mentioned above you will not be asked if you wish to save, unless changes have been made.

## TOOLBARS

The Toolbars in Excel are where all of Excel’s features can be accessed. They contain both text and icons (pictures). The main toolbar in Excel is called the Worksheet menu bar and it is normally found under the Title bar. On this toolbar you will find nearly all the options available for you to use in Excel under the headings File, Edit, View, Insert, Format, Tools, Table, Window, Help. If you click on any of these options, a menu will drop down giving you a list of the many other options available to you.

Take note of the short cut keys to the right of some of the menu options! Once you have made a selection from the Worksheet Menu Bar, Excel may or may not (depending upon the option chosen) display what is known as a Dialogue box (as with the Save As option).  To see what I mean by a Dialogue box, click on  Edit>Go To , and Excel will display the Go To dialogue box.  Excel uses Dialog boxes for the majority of options, therefore there are loads of these dialog boxes contained within it.  While here, take note of the question mark button on the top right hand side of the box, next to the cross (X).  This is designed to give you Help.  If you click on this and then select any part of any dialog box, Excel will display a description of what that part of the dialog box is designed for.  (Give it a try.)  This is the same for all dialogue boxes. The cross (X) will close the dialog box, as does the Cancel button and the Esc key at the top left hand side of your keyboard.  Close the dialog box.

As a standard, and indeed as a default when you first go into Excel, most people work with what are known as the Standard Toolbar and the Formatting Toolbar in view, so during these lessons we will work with both of these toolbars showing.

To ensure that both of these toolbars are in view, go to View>Toolbars. Another menu option should open.  It is on here that we can show and hide our most commonly used menu bars. A tick means the toolbar is visible, while no tick means it is not.  Another method that can be used to do the same thing is to right click in the grey area to the top of your screen (known as the Toolbar area), immediately under the blue Title Bar.

Let’s ensure that both Standard and Formatting have a tick next to them.

NOTE: You will not find a toolbar called Worksheet Menu Bar under View>Toolbars. This is because Excel will always open with this toolbar showing. It cannot be hidden via the Excel interface.

### Docked and Floating Toolbars

Sometimes when you open Excel, your Standard and Formatting (or any other) toolbars can be shown on the same level, collapsed to show only a certain number of options.  This is to give the user more screen room.  If you wish to see all options available on a collapsed toolbar, you will need to click the last icon on the toolbar, the Toolbar options icon (two arrows pointing two the right and one arrow pointing downwards), to see all other available icons.  If an icon was selected using this method, then the selected icon would be placed in the visible part of your toolbar, and another icon would be hidden.

Most Excel toolbars are what is known as "docked" by default.  This simply means they are situated at the top of your screen directly underneath the Title bar. They can, however, be what is known as "floating" by undocking them.

To undock a toolbar, and move it around the screen, look for the raised vertical ridge the far left hand size of your toolbar.  You will see a shape like a black cross with arrows on the ends of the cross.  This shape means that when you hold your mouse down you will be able to undock and move your toolbars.  So, you can hold your mouse down and move your toolbars apart, on to your screen, dock them at the left, bottom, right of your screen or anywhere you like.  Most users work with the Worksheet Menu bar at the top, followed by the Standard toolbar directly underneath, then the Formatting toolbar, either collapsed on the same level or separated with the Standard toolbar on top, but it is entirely your choice.  You will find once you start using Excel what set-up suits you best.

Most of the time toolbars are docked underneath each other, but at times they may become docked sideby-side. This isn't too easy to spot, but basically if there are two Toolbars side-by-side the raised ridge for one of them will be somewhere other than the far left. If there are two side-by-side, simply drag it off (undock it) then drag to its new location

Once you have both the Standard and Formatting toolbars visible and in place have a brief look over all the icons and hover your mouse pointer over each icon to see its name.  It is important to note that most of the options on these two toolbars are simply shortcuts to the most commonly used options that can also be found on the main Worksheet menu bar under its option heading. Having these two toolbars visible makes it much easier and quicker to access the required option, rather than to go through the menu system.

There is also another menu that makes working in Excel much easier, this is the right click menu. We will look at this when we look at Cells.

### Getting Quick Help on a Toolbar Option

To quickly get a brief description of any menu option, simply use she shortcut Shift+F1. Your Mouse pointer should change to a ? (question mark.  Now click on any menu option and Excel will display a brief description of its function. Once you have selected the menu option your mouse pointer will return back to normal. To find the name of any menu option simply hover your mouse pointer over any icon.

### The Formula Bar

The Formula bar in Excel is where most users would do any editing of formulas or any entries that are within a cell. The Formula bar is the long white bar with either an = (equal sign) or the fx icon to the left.  If you cannot see the Formula bar, it may be hidden, go to View>Formula Bar.

To see a list of Task Panes available, click the down arrow located at the top of the Task Pane to the left of the X (which will close down the Task Pane).  Clicking on a Task Pane name will cause that particular Task Pane to show on your screen.  Notice that you also have Back and Forward arrow icons at the top of the Task Pane.  Just like if you were in a browser, Back takes you back through viewed Task Panes and Forward takes you Forward.

## SMART ICONS

Smart Icons are a feature available in Excel from 2002 (XP) onwards. From time to time you may see these pop up on your screen. They do not print. Certain actions invoke them appearing. A Smart Icon looks like a small box with an picture of some sort inside it and if you hover your mouse over them you will see a down arrow. Click the down arrow and you will see more options in a pop-up list.

Insert/Delete/Name/Move Worksheets

# WORKSHEETS

All Workbooks must contain at least one Worksheet. The maximum number of Worksheets a Workbook can contain is limited only by the available memory of the PC. As a default, Excel places three blank Worksheets in front of you. Each one of these has the default name Sheet1, Sheet2, Sheet3 at the bottom.  By default all Worksheets are identical in that they contain Rows, Columns and Cells (all discussed below).

NOTE: You can change the default of three blank Worksheets by going to Tools>Options/General and changing Sheets in new workbook: by typing in the number you require.

All Worksheets contains 256 columns and 65,536 rows.  Each separate rectangle within the Worksheet is called a Cell. You will notice letters across the top of your Worksheet. These are the names of the columns and go from A through to IV. The numbers down the left hand side of your sheet of graph paper symbolise row headings and go from 1 through to 65,536.

Inserting Worksheets

Adding new Worksheets to a Workbook can be done in a number of ways.  The most common are:

## •     Go to Insert>Worksheet

•     Right click on another Sheet name tab and select Insert and then select Worksheet

There is another way that is not exactly inserting a new Worksheet, but rather making a copy of an existing Worksheet.

To do this, select the Sheet you want to copy then left click on the name tab and holding down the Ctrl key (bottom left hand side of your keyboard), then drag it to one side, then release. This is a great time saver when you have spent hours setting up a Worksheet with all the formatting you want. You will notice that Excel will place a number after the copied sheets name in brackets. This is because we cannot have two Worksheets of the same name in the same Workbook. Name and Renaming Worksheets is covered later.

## Deleting Worksheets

The logical opposite to inserting Worksheets is Deleting them. This can be done in any of the following ways.

•    Right click on the Worksheets name tab and select Delete

•    Go to Edit>Delete .. the Delete dialogue box will appear with options, select your option and click OK to verify your request.

Whichever method we use, Excel will display a warning message letting us know that the deletion cannot be undone. This is not technically true as we could always close our Workbook WITHOUT saving and then re-open the Workbook, but of course this means we would loose any other changes we had made.

## Naming Worksheets

We can also name our Worksheets with meaningful names (which is a good idea!). The only restrictions we have with Worksheet names is:

•    They cannot exceed 31 characters.

•    They cannot contain the following characters: \ / ? * [ ].

•    The name cannot be the same as another Worksheet in the Workbook.

While it is not totally necessary, try to AVOID using spaces between words. For example, if you wanted to name a Worksheet Bills Hours use BillsHours instead! The reason for this is that some of Excels formulas have slight problems when they reference Worksheets that contain spaces.

To name a Worksheet we can do so with any of the most methods below:

•    Double click the Worksheet Name tab. This will allow you to now type the name. Once finished, push Enter or click any cell.

•    Right click on the Worksheet Name tab and select Rename from the shortcut menu. Then type the name and hit Enter or click somewhere else on your Worksheet.

•    Go to Format>Sheet>Rename type the chosen name and hit Enter or click somewhere else on your Worksheet.

## Moving Worksheets

At times we may need or wish to move a Worksheet to another position in the Workbook or even to another Workbook.  We have already looked at how we can make a copy of a Worksheet, select the Sheet you want to copy then left click on the name tab and holding down the Ctrl key drag it to one side, then release.  If we do not want to copy but rather move the entire Worksheet to another position in the Workbook we can simply left click the Worksheet Name tab, then holding down the mouse button drag it to it's new position and release.  The other method is to use the Move or the Copy dialogue box. This can be accessed in two ways.

•     Right click on the Worksheet Name tab and select Move or Copy

## •     Go to Edit>Move or Copy Sheet…

It makes no difference which method you use!  You will see on this dialogue box a To book: box with a small drop arrow to the right. The selection in this box will determine where our sheet will be moved or copied to.  The default name in this box will be the active Workbook name (the current Workbook we are in).  There will also always be another choice, if we click the drop arrow. This is (new book), if we choose this option Excel will automatically create a new Workbook for the sheet to be moved or copied to. Within this box will also be the names of any other open Workbooks, should there be any.

Directly below the To book: box is the Before sheet: box. Our selection in this box will decide which position our sheet will be moved or copied to. Last of all is the Create a copy checkbox. If we check this box Excel will create a copy of our moved Worksheet. In other words our original sheet will remain where it is and a copy of it will be moved to our chosen location.  If we leave it unchecked (which is the default) the Worksheet will be moved and not copied. The best way (as with most of excel) is to jump straight in and try out different options - you cannot do any harm!

EXCEL CELLS & NAVIGATING A WORKSHEET

# CELLS

These are without doubt the very backbone of Excel. On each Worksheet there are 16777216 cells.

These are divided into 65,536 Rows and 256 Columns, as I mentioned earlier.  The number of Rows and Columns in a Worksheet are fixed, which means we cannot add more and we cannot take any away, so as a consequence the number of cells are also fixed. This should never become a problem, as we can add a lot of Worksheets if we need to, each with 16777216 cells, so this should give us plenty!  A cell is defined as the intersection of where a column and row meet, just like the coordinates on a road map.

The method that Excel uses to reference these cells (as a default) is called the A1 style reference. When we refer to a particular cell we use it's cell Address (or location) to nominate the cell. The method Excel uses to reference cells is a very simple, but highly effective method, often referred to as the grid pattern method, exactly the same as a road map.

Click in cell C6.  It should be defined as your active cell, or the cell in which you are clicked, by the border of the cell or rectangle being different in some way, either bolded, or maybe a different colour.  Now have a look at the column heading letter.  It should be defined in some way, either bolded, or highlighted in a colour, it may even look pushed in like a button.  Now look at the row number on the left of your screen which should also be defined in some way.  This is telling you your cell reference. Now look above the column heading A and you will see the reference C6 in what is known as the Name box (discussed below).

In the situation above we have selected one cell only. We can select many more cells at one time if we wish. When we do so, we have selected what is known as Range of cells. A range can be one cell, or many cells.

To select a range of cells we simply select any one cell (position the cursor so a cross appears), then holding down our left mouse button, drag in the direction we wish to select. It is important to note here that although we have more than one cell selected (a range) there is only one Active cell and this will always be the first cell we select. There is no limit to the number of cells we can select on a Worksheet.

To select all cells on your worksheet either push Ctrl + A or the Select all button, (the empty grey rectangle in the upper-left corner of a Worksheet where the row and column headings meet). We can also select entire columns or rows by simply left clicking on the column letter or row number.

We mentioned above while looking at Toolbars that there is another shortcut menu in Excel, the right click menu. The right click menu is also known as the context-sensitive menu.  This means that it will display options that are sensitive to the area in which you are clicked. To see this simply select any cell and (you guessed it!) right click. You will see a list of common options available in the area you are clicked in. We won't go into any detail on these at this stage but we most certainly will in later lessons.

While we are on the subject of the right click, you will notice as we go into Excel deeper that it has many of these right click menus. As stated above, the menu that we are presented with is wholly dependent on the area of Excel we are in at the time.

There are many ways that can be used to move around a Worksheet and the method used is purely user preference.

At the far right of your Worksheet window is what is known as a Vertical scroll bar.  This bar has an upward pointing arrow at the top of it and a downward pointing arrow at the bottom of it.  You can vertically scroll up and down through your document in any one of the common following ways (there are more!):

•    Place your left mouse button on the downward (or upwards) pointing arrow and click once to scroll slowly through your document. This will move you down one row at a time.

•    Hold the left mouse button down on the downward (or upwards) pointing arrow to move more quickly through the document

•    Hold your left mouse button down and drag the grey sliding button between the black upward and downwards arrows. Notice when you select the last option a yellow box with the row number will appear. This is because you will not move to the location until you release the mouse button.

•    Select any cell and then drag down. You may notice that doing this will display a small yellow box that informs you of how many rows you have selected and how many columns. This will only appear after the active cell has scrolled from view. You can also do the same by selecting any cell and holding down the Down arrow on your keyboard while holding down your Shift key.

•    Use the Page Up and Page Down keys on your keyboard.

To get quickly back to the top of your Worksheet, push Ctrl + Home. This will always take you to cell A1.

At the bottom of your Worksheet window to the right is your Horizontal scroll Bar. The use of this is the same as with the Vertical scroll bar, except of course you move horizontally and you cannot use Page Up and Page Down.

If you happen to know the address of the cell you wish to go to we can use the Go To dialogue box.

•    Go back to cell A1 (Ctrl + Home

•    Select Edit>Go To (or push your F5 key, or push Ctrl + G

What has popped up in front of your now is the Go To dialogue box.  Note that your cursor is flashing in the Reference section of the box. This is where you type the cell reference that you wish to Go to. The big box (Go To) is where Excel stores the last references used.  If the reference is in here you would simply select it and click OK

Type in HS3156 in the Reference box and select OK (or hit Enter on your keyboard if you prefer). Excel will take us straight to the cell reference we typed.

To get back to the top left of the Worksheet, push Ctrl + Home. The Ctrl + Home method is simply a short cut key for typing A1 in the Reference box of the Go To dialog box.

While the Go To dialogue box can be handy for moving straight to any cell, there is an easier way!  To see what I mean left click in the Name box (left of the Formula bar), type any cell address and push Enter.

You are no doubt wondering why this is called the Name box? We will cover this in detail later, but not in this lesson.

# MOVING THROUGH WORKSHEETS

The only area of navigation we need to look at now is the Worksheets themselves. This can be done in one of two ways. The most popular and probably the simplest method is to simply left click on the sheet name tab of the sheet you want. This will automatically activate the appropriate sheet.

The second method is probably best suited to when you have a lot of worksheets in the same Workbook.

You will notice to the far left of the sheet name tabs, you have four arrows. Place your mouse pointer over any one of these and then right click. You will see a pop up menu containing the names of all the Worksheets within the Workbook. You simply select the one you want with your left mouse button. The four arrows to the left of the sheet name tab are called Tab Scrolling Buttons. These four arrow buttons are to allow you to scroll through the Worksheet name tabs should your workbook contain more

Worksheets than are currently visible. If you click the arrow with the vertical line after it, you will scroll so that your far right hand Worksheet name tab is visible. If you click the arrow without the vertical line, you will basically scroll one Worksheet tab at a time.

# EXITING

There are two ways to exit Microsoft Excel and close the program down. These are:

•    By selecting the cross (X) at the top right hand side of your screen

•    By selecting File, then Exit

Select either of these options to close down Excel. If we wished to Exit Excel and we were working in a Workbook that we have made changes to, Excel will ask us (via a message box) if we wish to save the changes we have made. If we wished to Exit Excel and we had a Workbook that we had not made any changes to, no message will appear and Excel will Exit without saving.

## COPYING OR CUTTING AND PASTING

Copying, Cutting and pasting is something you will no doubt be doing an awful lot of when working in Excel, especially when you start to use formulas to perform calculations. The reasons for this will become more apparent when we cover the basics of Excel formulas in later lessons. For now, we will just look at Copying, Cutting and pasting typed-in data.

Before we move on to any examples, it is important that we know the difference between Cutting and Copying. When we Copy data from one cell to another, we are doing exactly what the name implies, Copying it. In other words we are making a duplicate of the cells content and placing it somewhere else. When we Cut data from a cell or range of cells, we are actually MOVING it from its current location to a new location.  Pasting, by definition is placing either the Cut or Copied data in its new destination.

### Copying

There are many ways that we can Copy or Cut data in Excel, the way that you do it is purely optional and should be the way you are most comfortable with. We will have a look at the most common ways. Type your name into cell A1 we will use this for all the examples of how to Copy and Paste. Make sure you are selected in cell A1. Then you can either:

•     Right click on the cell and from the Shortcut menu select Copy

### •     Go to Edit>Copy

•    Push Ctrl + C on your keyboard

•    Select the Copy icon from the Standard Toolbar. This is the one immediately to the right of the scissors symbol.  (Note:  Remember to hover your mouse over the icons on your toolbars to see what they do).

You will notice that cell A1 now has a moving dashed line around it. This is called a Marquee. This indicates that you have copied the content of that cell (A1 in this case) to what is known as the Clipboard. The clipboard is where Excel stores all data that you Copy or Cut from your worksheet until such time as you either Exit Excel, or clear the Clipboard.

### Cutting

Cutting from a cell, or range of cells is done in a very similar way to the methods described above for Copying. The differences being, when you Cut data you remove the original data and when you Paste it, you will ALWAYS be pasting in all attributes of the cell you Cut from. This means that the Paste Special option is not available when you Cut a cell or range of cells.

Again, as with most options in Excel, there are a multitude of ways to Cut a cell.  The most common are:

•    Right click and select Cut from the Shortcut menu

•    The Cut icon on the Standard toolbar (the pair of scissors)

### •     Go to Edit>Cut

•    Press Ctrl + X on your keyboard

•    Use the Drag and Drop operation the same way as you would do to Copy, except you DO NOT hold down your Ctrl key.

Note:  Depending on what version of Excel you are using, sometimes you can see your Clipboard as it will pop up onto your screen as a Toolbar, or if you are using a newer version of Excel, the Clipboard Task Pane may locate itself on the right hand side of your screen.  Both of these are used for multiple cutting, copying or pasting actions, and we don't need them right now.  If you see either the Clipboard toolbar, or the Clipboard Task Pane, close them down by clicking on the X at the top right hand side.

### Pasting

Now select any other cell and either:

•    Right click on the cell and from the Shortcut menu select Paste

•    Push Enter on your keyboard

### •     Go to Edit>Paste

•    Push Ctrl + V on your keyboard

•    Select the Paste icon from the Standard Toolbar. This is the symbol immediately to the right of the Copy symbol.

There is a slight difference with the second option, ie; Push Enter on your keyboard. This is that by pressing Enter you will CLEAR the Clipboard after it has Pasted in the data. You will notice with the other four methods that the contents of cell A1 stays on the clipboard.  This means that we could select other cells and continue pasting as much as we like using any of the above methods other than using Enter on our keyboard.

There is another method that can be used to Copy, this is called Drag and Drop, and is possibly the fastest method if you only intend to Paste the data into one destination as opposed to various.

For this method, again select in cell A1, hold down your Ctrl key, and move your mouse pointer to the outer perimeter of the cell until the mouse pointer changes to a white arrow. It should also have a small plus sign to the top right of it.  Whilst still holding down the Ctrl key, hold down your left mouse button and drag in the desired direction to Copy. Once you have your copied data in the cell you want to Paste to, simply release the mouse button.

If you also hold down your Alt key whilst doing this, you can change sheets by dragging the copied data over the sheet name tab that you wish to Paste it to.

If you Copy a range of cells eg; A1:B10 and then select a single cell as the destination range, Excel will use the active cell as the top left of the destination range. For example if you Copy A1:B10 and select cell C1 as the starting cell to which to paste, the range C1:D10 will become filled with the copied data. If you select cells C1:C2 and tried to Paste, Excel would tell you that the Copy area and the Paste area are not the same size and shape. Select an area of the same size and shape, or select a single cell only. Most often it is best to select a single cell only and let Excel determine the Paste area.

## EXCEL COPYING WITH THE FILL HANDLE

COPYING WITH THE FILL HANDLE

Excel has yet another way to Copy (not Cut) data in cells and this is via the Fill Handle. You may have noticed that when you select a cell or range of cells the bottom right of the outlined cell or range has a small black square. This is called the Fill Handle. The Fill Handle can be used for filling a range with increments of any choice we choose, in fact it can do much more than just this, but we will only look at using it to Copy and to increment. To see what we mean try this:

Type the number 1 in cell A1

Select cell A1 and place your mouse pointer over the bottom right corner until the mouse pointer changes to a small black cross.

Hold your left mouse button down and drag down to cell A10

Your range should now contain the number 1 in all cells.

This is using the Fill Handle to Copy. Now try this:

Type the number 1 in cell B1

Select cell B1 and place your mouse pointer over the bottom right corner until the mouse pointer changes to a small black cross

Now double click the Fill Handle with your left mouse button

This should fill the range B2:B10 with the number 1. What Excel does is look in the range immediately to the left and if there is data in that range it copies down to the last cell containing data.  If the range to the left is blank, it looks to the right, if there is data in that range it copies down to the last cell of that range. If both ranges on the left and right are blank, nothing happens when you double click the Fill Handle.

Let's say we have the number 5 in cell A1 and we wish to fill down to cell A100 in increments of 5.

To do this, follow these simple steps.

Type the number 5 in cell A1 and the number 10 in cell A2.

Select both cells A1 and A2.

Place your mouse pointer over the black square, bottom right corner of A2 until the mouse pointer changes to a small black cross.

Holding down the left mouse button drag down to cell A100.

Excel will fill the range A3:A100 with increments of 5 up to 500. What Excel does in this instance is look at the value of cell A1 and A2 (the selected cells) sees that there is a difference of 5 (10-5) and increments by that number.

As you can imagine this can be very handy even for a simple increment like this.

There is one more feature of the Fill Handle we will look at and that is what's known as Custom Lists. By default Excel has two types of Custom Lists, these are Days of the Week and Months of the Year. Try this simple exercise.

Type the text January in cell A1.

Select cell A1 and place your mouse pointer over the bottom right corner of A1 until the mouse pointer changes to a small black cross.

Holding down your left mouse button, drag down to cell A12.

This time Excel will have filled the 12 Months of the year for us. If we had typed a day of the week Excel would fill the range with the 7 days of the week, looping and starting again after it gets to the seventh. While these are the only two defaults, Excel would still recognize Jan or Mon or any other day or month abbreviation.  Not only this but we could type any text followed by a number such as Quart1 and use the Fill Handle to increment by 1 so you would see Quart2, Quart3 or type Quart1 in A1, Quart3 in A2 and use the Fill Handle and Excel will increment by 2

## EXCEL PASTE SPECIAL

PASTE SPECIAL

By default, when you Copy and Paste the content of any cell(s), Excel will Paste all cell formatting. We can, however, use what is called Paste Special to nominate the attributes of the copied data we wish to Paste.

To do this, again Copy the cell(s) in any of the above methods (except Drag and Drop). Now select your destination cell and go to Edit>Paste Special or right click and select Paste Special from the Shortcut menu. This will display the Paste Special dialogue box.  In this dialog box under the heading Paste, there are different options that can be applied, the default is All, which is exactly the same as using any of the Paste methods described above. The other options are:

Formulas

This option would apply only if the cell we copied contained a formula. What this means is instead of the formatting and other attributes of the cell being Pasted, only the formula itself will be Pasted. To put this into some sort of context, imagine the cell containing any formula to be copied where the background colour of the cell is bright yellow, using Formulas would not Paste the background colour of the cell, just the formula.

Values

Again, imagine a cell being copied that contained a formula where the result of that formula was the number 20 (or any other number). Choosing the Values option, would mean that we would only be Pasting the result of the formula into the destination cell and not the formula itself.

Formats

Using this option means you will not be Pasting the contents of the cell, but only the formatting.  Again, imagine a cell with a bright yellow background containing the number 100 (or any other data). On selecting this option, the destination cell would end up having a bright yellow background, but not the number 100.

This option applies to Cell Comments which will be covered in a later lesson.

Validation

This option applies to Cell Validation which will be covered in the Level 2 course.

All except borders

Means all the cell contents and formatting excluding borders would be Pasted. We will be looking at borders later.

Column Widths

Means no content or formatting will be Pasted, except for the width of the column that the data was copied from.

Formulas and Number Formats

Using this option will Paste only formulas and all number formatting options.  Number formatting will be covered later.

Values and Number Formats

This will Paste only values and all number formatting options.

The next part of the dialog box has a heading Operation. In order to demonstrate the options under this heading, type the number 2 into cell A1 and the number 10 in cell A2. Copy cell A1, then select cell A2 and again right click and select Paste Special.

Under the heading Operation there are five options to choose from:

None

This is exactly as the name implies and means None of the options under the heading operation will be applied. Even if this option and all the other options under Operation are not checked, which is the default, None would still apply.

Select the option Add and click OK. You will notice that Excel adds the copied number (in this case 2) to the value of the destination cell (which in this case is 10) to end up with a total of 12. In other words it adds a copied number to the destination cell.

Finally, just to stress my point that we are not technically adding more rows, columns or cells, go to cell

IV1, by either typing the cell reference in the Name box to the immediate left of the Formula Bar, or push F5 and type IV1 in the Reference: box. Type any data into cell IV1 and now push Ctrl + Home to take yourself back to cell A1. Select any entire column, right click and choose Insert.  You will see that Excel will display a warning letting you know that it cannot shift non blank cells off the Worksheet. This is because we have data in cell IV1. So, as you can see, Excel isn’t really adding an extra column, it is simply moving the last one off the Worksheet before inserting a new one. Press OK to cancel out of the warning box.

Subtract

Again, to see this repeat the coping of cell A1 and again select cell A2 and right click and select Paste Special. This time, select Subtract and cell A2 will be have the number 2 subtracted from its value.

Multiply

This works in exactly the same way as Add and Subtract, except obviously it Multiplies the destination cell by the value of the copied data.

Divide

This works in exactly the same way as Add, Subtract and Multiply, except obviously it Divides the destination cell by the value of the copied data.

The other two options work in the following way:

Type any number into cell A1, any number in cell A2, leave cell A3 blank and again type any numbers in cells A4 and A5. Now in cell B1 to B5, type any numbers so that all cells are filled. Now select cell A1 holding down your left mouse button, drag down until cells A1 to A5 are highlighted. Right click anywhere within A1:A5 and select Copy, select cells B1 to B5 in the same way, right click and select Paste Special.

Select the bottom option Skip Blanks and click OK. What you will notice, is that Excel did not Paste the empty cell of A3 over the top of the value in B3. In other words, as the name implies it skipped the blanks.

While you still have five values in cells B1:B5, highlight these cells, right click and select Copy, then select cell D1 choose Paste Special and select the option Transpose. Click OK. You will notice that Excel will have Pasted your rows of values into columns. In other words, instead of cells D1 to D5 having the values Pasted into them, you should have D1 to H1.

The very last option is the Paste Link button located at the bottom right of the Paste Special dialogue box. To see this work, type any value in cell A1, Copy this cell then select any blank cell, right click, choose Paste Special and click Paste Link. You should notice that your destination cell will be showing the value, the same as your copied cell. If you look in your Formula Bar (located under your toolbars) you will see Excel has placed what is known as an Absolute Cell Reference Formula, ie; =\$A\$1.  It is the dollar symbols that have made the reference absolute. We will be discussing Absolute and Relative references in detail in a later lesson.

The last method of Copying and Pasting data is to select the cell you wish to Copy, right click on any cell border and holding down the right mouse button drag to any destination cell, then release the mouse button. Excel will display another Shortcut menu, giving you various options. Some of these options are the same as in the Paste Special dialogue box so we will only look at the last four options of this Shortcut menu, the Shift Down and Copy and the Shift Right and Copy.

Again, type any value in cell A1, then type any value in cell D1. Select cell A1 and right click on any cell border with the right white arrow showing. Holding down your right mouse button, drag A1 to cell D1, then release the mouse button and select Shift Down and Copy. You will notice that Excel shifts down the value of cell D1 and places it into cell D2 before it Pastes in the data from cell A1. Delete the contents cell D2.

Again, select cell A1, right click on any cell border, select cell D1 again and release the right mouse button. This time select Shift Right and Copy. This has now done the same as the Shift Down and Copy option, except as the name implies, it has shifted the data in cell D1 to the right before pasting in the contents of cell A1.

## EXCEL THE INSERT COMMAND

INSERTING ROWS, COLUMNS AND CELLS

When working in Excel, there are times that you may need to insert an entire new row, an entire new column or only a single cell.  Although the term Inserting gives the impression that you are actually adding another row, column or cell, you are in fact NOT. You may remember that in the first lesson we mentioned the fact that Excel has 256 columns, 65,536 rows and 1,677,216 cells per worksheet. These numbers are fixed, so technically we cannot add more. What we can do, however, is move a particular row down, column across, cell in. This can seem confusing, so it is probably best that we do a practical example so you can see how it works.

In cell A1 type any data. In cell A2 also type any data.

Select cell A2 right click, and select Insert.

You will notice that the Insert dialogue box will be displayed giving you four options.

Shift Cells Right

Shift Cells Down

Entire Row

Entire Column

For this exercise, lets select Shift Cells Right, then click OK. You will notice that the contents of cell A2 has now been moved to cell B2.

Lets now select cell B2, right click, select Insert and select Shift Cells Down. The contents of cell B2 should now appear in cell B3.

Now select any cell in row 1, right click, select Insert then Entire row, click OK. You should have an entire new empty row for row 1.

Lets now insert an entire column. Select any cell in column B, right click and select Insert, then Entire Column and click OK. You should now have an entire new empty column for column B. When we insert rows, columns or cells in this manner (that is with a single cell selected) Excel will always display the Insert dialogue box, allowing us to make our choice.

The same Insert dialogue box is available by selecting Insert on the Worksheet menu bar and then your required option (cells, rows, columns)

We can, however, bypass this dialogue box and insert either an entire row or column by default. To insert an entire row by default, select any row number (the row number on the left in the shaded area) so that the entire row is highlighted. Then right click and select Insert. You will notice that Excel makes an educated guess that you are after an entire row as it is an entire row that you have highlighted. The exact same thing would happen if we had an entire column highlighted, ie; an entire column would be inserted.

If we want to insert more than one cell, row or column at a time, we simply select the appropriate number of rows, cells or columns before using Insert either via the menu option or the right click Shortcut menu. For example, if you select four entire rows, then right clicked and selected Insert, you would be inserting four new empty rows

## CHANGING THE DEFAULT OPTIONS IN EXCEL

Sometimes when working in Excel, it can be handy to set it up in a way that you would most commonly use.  In other words, change its default options.

To do this, go to Tools>Options. This will display the Options dialogue box. On this dialogue box you will notice that there are multiple page tabs. We will go through the most commonly used options. If however, there is an option on here anywhere that you would like to know about, but are unsure of, just let us know and we will explain it in detail.

The View Tab

Show/Formula Bar

This option simply toggles the Formula Bar to being visible or non-visible.

Show/Status Bar

This option simply toggles the status bar to being visible or non-visible.

With this option checked, there will be an icon on your taskbar for each Excel Workbook you have open. The Taskbar is the very bottom one, where your Start button is located.

Cell comments are not displayed (discussed in a later lesson). Comments/Comment Indicator Only

Only an indicator in the cell containing the cell comment is shown by default.

Both the comment and its indicator will be visible by default.

Objects/Show All

All graphic objects are visible.  A graphic object could be a text box, drawing object, inserted picture, etc.

Objects/Show Placeholders

Selecting Show Placeholders means that any pictures or charts are only shown as grey rectangles. This option will not have any affect on text boxes and other drawing objects.

Objects/Hide All

All objects including charts, text boxes, pictures etc., are not displayed.

Window Options/Formulas

Selecting this option will make any formulas in cells visible as opposed to the result of the formula only. This is most commonly used should you wish to print a Worksheet and have all the underlying formulas displayed.

Window Options/Gridlines

Toggles the view of the gridlines between on and off.

Window Options/Colour

Changes the colours of the gridlines

Window Options/Outline Symbols

Displays outline symbols. (worksheet must contain a previously created outline.

Window Options/Zero Values

Toggles between displaying zeros and not displaying zeros. Window Options/Horizontal Scroll Bar Toggles the horizontal scroll bar on and off. Window Options/Vertical Scroll Bar Toggles the vertical scroll bar on and off.

Window Options/Sheet Tabs

Toggles the display of the sheet name tabs on and off.

The Calculation Tab

Note: It is recommended that you leave these options as their default unless you are sure of their definitions.

Calculation/Automatic

This means Excel will automatically recalculate whenever necessary.

Calculation/Manual

This means Excel will only calculate when we tell it to. To do this manually, you would push the Shortcut key F9. You would basically only ever use this option if you had a very large workbook containing a lot of formulas that was recalculating very slowly.

The Edit Tab

Settings/Edit Directly in Cell

There are many ways you can edit a cell.  This option allows you to edit a cell by double-clicking.

Settings/Allow Drag and Drop

This enables us to perform the Drag and Drop operation as discussed before with Copying and Cutting.

This option means that if we use the Drag and Drop operation to place the contents of another cell into a cell that already contains data, Excel would display an Alert informing us and giving us the choice as to whether to continue or not.

Settings/Move Selection after Enter

As you are probably aware, when you are selected in a cell and you push Enter you are moved to the cell directly below it. We can change this to any of the four directions, that is down, right, up or left. Or, if we uncheck the Move Selection after Enter box, we will not be moved to another cell after pushing Enter

Settings/Fixed Decimals

Selecting this option allow us to determine how many decimal places Excel will use by default. In other words, if we selected this option and had the Places set to 2, and then entered the number 2 into any Worksheet cell, we would actually end up with the number 0.02. Again, unless needed, leave this option unchecked as it can cause confusion.

The General Tab

Settings/Sheets in New Workbook

This lets us determine the number of sheets Excel will automatically place in a new Workbook.

Settings/Standard Font

Allows us to determine the font type and size Excel will use by default.

Settings/Default File Location

This allows us to determine the location by default that your files will be saved in unless specified otherwise.

## THE UNDO/REDO FEATURE

As with most Microsoft Office applications, Excel contains a very handy feature that allows us to Undo or Redo certain steps we have taken.

The Undo and Redo can both be found on the Standard toolbar. These are represented by the arched left pointing blue arrow for Undo, and the arched right pointing blue arrow for Redo. It can also be found under Edit on the Worksheet menu bar as can the shortcut keys Ctrl + Z for Undo and Ctrl + Y for Redo but most often you will probably use the icons on the Standard toolbar as they are easily accessed.

The other reason why you would probably choose the Undo and Redo via the Standard toolbar is because you may notice next to the arched arrows to the left or right, there are two small downward pointing arrows. Selecting these arrows will present you with a list of up to the last 16 actions taken. In other words, Excel will only store the last 16 actions taken by the user.

What this means is that if you have performed 17 actions, the first of the 16 actions will be replaced by the 17th. To see what how this works, close the Workbook you currently have open and say No to saving any changes.

1.     Now open a new workbook. The reason we are doing this in a new Workbook will become apparent soon.

2.     In the new Workbook type the numbers 1-16 in cells A1:A16. Do not use the Fill Handle as this will defeat the purpose of the exercise.

3.     Now go up to the downward pointing arrow to the right of the Undo icon and left click on it and you should see your last 16 actions. Take note of the fact that you have Typing “1” in A1 as the action at the bottom of the list.

4.     Now click in cell A17 and type the number 17.

5.     Go back up to the downward pointing arrow to the right of the Undo icon and left click on it and you will notice that Typing “1” in A1 has disappeared and at the top of your list should now be Typing “17” in A17.

In other words, Excel has replaced your very first action taken with the last action taken. This will continue on as such at any time you are working in Excel.

6.     To Undo the last action, you simply click the Undo icon.

7.     Click this now and the number 17 should disappear.

8.     If you now click on the drop arrow to the right of the Redo action, you should see that the Typing “17” in A17 is now a Redo action as opposed to an Undo action.

9.     Now go back to the downward pointing arrow to the right of the Undo action and hover your mouse pointer over the top action, ie; Typing “16” in A16.

10.  Without clicking, drag your mouse down slowly and you will see Excel highlight each action as you go. This allows us to select the number of actions to Undo. When you have reached the action at which you wish to stop, simply stop dragging and click on the last highlighted action (or push Enter) and Excel will Undo all the highlighted actions.

11.  If you now click on the downward pointing arrow of the Redo feature, you will see the list of all the actions that we have just Undone.

12.  So again, select these actions and click (or push Enter) and you should be back to exactly where we started.

The most important point to remember here is that Excel will only store the last 16 actions taken. The reason the number is only 16 is because storing any more than this would start to have an adverse affect on the memory usage required.

The other very important point to note of the Undo and Redo feature, is that as soon as you Save, all of the Undo or Redo actions are wiped and there is no way to get them back.

You can change the number of actions stored in Undo, but to do that requires hacking into Excel.  If you are interested in how this works, let us know.

## THE FORMAT PAINTER

When working in Excel there are times when you may wish to copy the formatting of a cell or range of cells to another location without copying the content of the cell(s). To make this simple, Excel has what is known as the Format Painter. This can only be found on the Standard toolbar, is represented on the toolbar by a paintbrush and is immediately to the left of the Undo icon. To be honest this is much the same as using the Paste special and selecting Formats as the option. The big advantage is that it’s much easier and quicker to access and the copy and paste range do not have to be of the same shape and size. So you can get a feel for this feature try these two simple exercises.

1.     Type any number in cells A1:A5.

2.     Type any numbers in cells B1:B10.

3.     Now highlight (select) cells A1:A5 and click the \$ (dollar icon) on the Formatting toolbar.

4.     Now click the B (Bold) and I (Italic) icons, also on the Formatting toolbar.

5.     Click the Format Painter icon and then click cell B1.

You should now have painted the formatting we applied to cells A1:A5 to B1:B5. You would also have noticed there was a paintbrush symbol next to our mouse pointer, which disappeared once we had selected cell B1.

Now using the Undo feature undo steps 3 to 5 so that all we have is the unformatted numbers in A1:A5 and B1:B10.

Now again apply the same formatting to these cells; eg. \$, bold and italics, A1:A5. With cells A1:A5 selected, double click the Format Painter

Again click B1 and the formatting should be painted to cells B1:B5. The difference this time is that the paintbrush symbol should still be present. This is because we double clicked the Format Painter instead of single clicking it

Click cell B6 and cells B6:B10 will also have the formatting applied.

To clear the Format Painter, either single click the Format Painter icon or push Esc on the keyboard.

You can see a single click will apply the Format Painter once, while a double click will keep the Format Painter active until we either click the icon again or push Esc.

We mentioned above that the copy and paste range do not need to be of the same shape and size when using the Format Painter, to see this follow these steps.

1.     Type any numbers in cells C1:G1.

2.     Select cell A1 and then single click the Format Painter.

3.     Now select cell C1 and with the left mouse button still held down drag to cell G1 and then release.

You should now have the same formatting applied to cells C1:G1 as you have in A1.

So as you can see the copy and paste range does not need to be of the same shape and size, unlike the Paste special.

## DATES AND TIMES IN EXCEL

In this lesson we will look at how Excel sees Dates and Times and how formatting a cell affects the data within it.  We will also look at the Undo/Redo feature as well as Custom formats and the Format Painter. This will give us a good background before we move on to what Excel is best at - Working with Numbers - in the next lesson.

You may or may not think that it is odd that we do not go into great detail with formatting cells. This is because while it may enable us to make a spreadsheet look very pretty, it is often at the sacrifice of correctly setting up your spreadsheet, or in other words, the nuts and bolts. We feel that whilst Formatting is pleasing to the eye, it should not be covered too deeply at this stage at the expense of the real workings of a spreadsheet. However, having said this, we do encourage you (as suggested below) to play about with any formatting not discussed here and direct any questions you may have to us.

The term Format according to the Microsoft Dictionary and Thesaurus is:

The arrangement of data for storage or display

A method for achieving such an arrangement

This pretty much sums it up! The big difference with formatting in Excel as opposed to many other Office Applications is that there is a LOT to choose from! This is because Excel needs to be able to work with numbers of all types and from all corners of the globe, as well as text.

On top of this we can also apply formats of our choice to the cells themselves as well as any data contained within them.  As far as numbers alone go Excel has over 100 different types of formatting that we can apply.  If this is not enough we can even define our own with Custom Formats (discussed below).

It is our belief that there are two very important facts that we should all be aware of when working with formats in Excel, these are:

Numbers are aligned to the right of a cell by default, and Text is aligned to the left of a cell by default

Changing the format of a cell will not change the underlying value of a cells content.

If you remember nothing else about formatting then remember these two facts.  We will explain the second point in detail later in this lesson.  Let's for now look at the first.

Whenever we enter a number in a cell on a new worksheet Excel will take an educated guess at what type of format it should apply.  By default all cells in Excel have what is known as a General format.  Most of the time you will find yourself accepting the formatting that Excel applies, but at other times you may wish to change it. The context in which we are discussing formatting here is not the font type, size or color, but rather the Number format eg; Dollar, Percentage, Decimal places etc.

We must stress however, that it is far safer to always leave numbers right aligned and text left aligned (Excels default).  This way you can tell at a glance what is a number and what is not!  I expect by now you are thinking, "I already know the difference between a number and text - it's obvious!"

This is not always the case in Excel. It is quite possible for numbers to appear as text and text to appear as numbers. This may not be quite the case when starting to use Excel, but is very likely as you delve deeper and create your own spreadsheet.

Dates in Excel

You will find that Dates and Times in Excel can often seem confusing!  But they often play a critical part in most spreadsheets so it is important that you have an understanding of how Excel interprets them.

Dates are seen by Excel as whole numbers, starting from the number 1 for 1-January-1900, the number 2 for 2-January-1900 and so on .  These are known as serial numbers. This is so we can use them in calculations such as adding and subtracting etc. We will show you examples of date formulas in the next lesson.

How we enter dates in Excel is extremely important.  If we do not insert a date in a valid form, Excel will not know that it is a date. You should be able to tell immediately if a date you enter is valid or not as Excel will align a valid date to the right of your cell (Number) and align a possible invalid date to the left (Text).  When Excel recognizes a date as a valid date it will change from the General format (default for all cells) to a built-in date format.

The type of date format Excel defaults to is not set from within Excel, but from the Regional Settings within the Widows Control Panel. (See HELP to find this, as the specific location may be different depending on which version of Excel you are using).  As these settings are regional you will most likely simply accept the format applied.

When we enter dates on a Worksheet we must also use a valid date separator, such as 12/12/2004 or 12-12-2004. If we want our date to look different to this we must format it after we have entered it.  Lets try a couple of simple exercises to stress what we have discussed so far.

In cell A1 type: 12/12/2004 or 12/12/04.  Both are valid.

Select Cell A1 and right click, then select Format Cells and then click the Number tab.  This dialog box is the Format Cells dialog box.  This is where you can apply formatting to both the cells themselves and the data contained within them.

If the default date (as set in the Regional Settings) is not within the Category: box, Excel will default to Custom.

Ignore this for now and click General under Categories. Now look in the Sample: box (top right). You should see the number: 36872.  This is the number for our date: 12/12/2004.  This is because the this date is 36871 days from the 1/1/1900

Now select Date from within the Categories: box.

Click through all the different dates within the Type: box and see the result in the Sample:: box. Select the format 3/14 and then click OK

Your date should now appear as 12/12.  I say appear because while we may have changed its appearance we have NOT altered its underlying value which is 12/12/2004 or 36872.  If you are still selected in cell A1 look in the formula bar and you should see 12/12/2004.  So while it may appear we have dropped the year from the date we have not!  In fact it is not possible to enter a valid date that has no Year, Day or Month.  We could in fact format this cell to appear as 1/1/1985 and still have the true value of 12/12/2004 or 36872.  We will explain this when we go on to Custom Formats.

If we enter a date into Excel and omit the day eg; Dec-2004 Excel will recognize this as a valid date, but you should be aware that Excel will (by default) assign the first day of the month to the date. This means that while you may only see Dec-2004 in the cell, the underlying value of the date will be 12/1/2004 or 36861. This means that it is not possible to have a valid date in Excel that does not have a day of the month assigned to it.

Times in Excel

Ok, if you are still with me let's now look at Times in Excel.  While dates in Excel are seen as whole numbers (serial numbers) starting from 1, Times are seen as a portion of a day (decimal fractions) with 1 being equal to 24:00:00 or a whole day.  This means that:

24:00:00 is equal to 1

18:00:00 is equal to 0.75

12:00:00 is equal to 0.5

6:00:00 is equal to 0.25

We can see this by entering any one of the above times in Excel and then formatting the cell containing the time as General, just as we did with the date. There are only three ways you can enter a valid time in Excel.

Make sure your cells are formatted as General

To enter a time based on a 12-hour clock, type the time followed by a space and then AM or PM. eg: 5:30 PM

Type the time followed by a space and then A or P. eg 5:30 P (Excel will convert this to 5:30 PM)

To enter a time based on a 24-hour clock, type 17:30

If you just typed 5:30 Excel will (by default as your cells are formatted as General by default) base your time on the 24-hour clock and store your time as 5:30:00 AM. In other words by default it sees all unspecified times as 24-hours but stores them based on a 12-hour clock.

The easiest way to see this is to type 5:30 in any cell, then select that cell and look in the Formula bar. No matter which method we use to enter times we must separate the hours, minutes and seconds by a : (colon). If we omit the minutes and/or seconds Excel will (by default) assign zero minutes and/or zero seconds.  So entering a time, as 5 P will force Excel to see it as 5:00:00 PM. Obviously this is not the case for a time entered based on a 24-hour.  Entering 17 will be seen as nothing more than the number 17.

Entering a Date and Time in Excel

Now that we have covered the fundamentals of dates and times, we can have a quick look at entering dates and times into the same cell. To enter a valid date and time in the same cell, you simply type any valid date, then a space and then any valid time.  Excel will then store this as a whole number for the date (serial number) and a portion of a day for the time. (decimal fractions).

Try this:

Type the date and time 12/12/2004 18:00 in any cell

Right click in the cell and select Format cells and click the Number tab, then General under Categories:

Look in the Sample: box and you should see 37237.75, where 37237 represent the date (serial number) and .75 represents the time (decimal fraction).

## CUSTOM FORMATS IN EXCEL

What we shall look at now is the Custom Format option under Categories in the Format Cells dialog box. This is a much better way to grasp the concept of applying formats from the Numbers page tab than using the built-in formats.  The reason for this is because you can easily see what affect one of Excel’s built-in formats has on any data in the cell by simply selecting the format and looking in the Sample: box.

Now that we have gone through the fundamentals of dates and times in Excel, we will use a date and time as an example so that you can see how the custom formats can be applied.  We will only look at the basics of custom formats as to try to go into it with too much detail would more than likely add confusion, but as with any area of Excel, if you have a question about it, feel free to ask and we will clarify for you.

For this example try this:

Type 12/12/2004 23:59 into any cell.

Make sure you are selected in the cell you have just typed the date and time in, right click and select Format Cells.

Click the Number tab on the Format Cells Dialog Box, then click Custom in the Category box.

By default you should have the format m/d/yyyy h:mm showing in the Type box or something very similar.  As mentioned before, this is determined by the Regional settings in the Control Panel of your Windows operating system.

What we will do now is go through the steps of how to apply a custom format. While we are using a date and time for our example, we can apply a custom format to any type of data in any cell.

Lets click inside the Type: box (first line), so that the mouse insertion point is flashing at the end of the last character. We will use this default format as a starting point for a custom format.

Hold down your backspace button until the format showing in the type box is completely gone. Note: This will not loose this particular format, it is only a means of adding a new one.

If you then look in the Sample: box, you will see that Excel will be showing the serial number for the date and the decimal fraction for the time. This is simply because the default format for any cell that has formatting removed is the General format.

To apply a format to our date and time, so that it uses abbreviated text to display the month name, type mmm.

If you look in your Sample: box, you should see the abbreviated month name Dec. To get the full month name, you simply need to type one more m (mmmm).

You should now have the full month December showing in the Sample: box.

From this point, we can choose to, or not to, use the / (forward slash) or – (hyphen) as our date separator.  It is important to note here, that as we are only changing the format of the cell, and NOT the underlying value, we do not have to enter the format of our date the same way as we must enter the date itself into a cell. We should also note that any valid custom format we apply to a Workbook that is saved, will always be available to us.

10.   Let us now push the space bar and use a space as our date separator, or if you like, use two or more spaces.

11.   Now type a single d and you should see December 12 in your Sample: box.

12.   Push the d again and your date should not have changed. This is because we have a two-digit number for the day of the month. If we had any day before the 10th of the month, typing dd would place a zero (0) in front of the day of the month.

13.   Push the d again, so that you have ddd and you should see the abbreviated day Wed.

14.   Push the d one more time, and you will see the full weekday Wednesday.

15.   So from this, we can safely assume that the 12th of December in the year 2004 is a Wednesday.

16.   Again, push the space bar and then push the y and you should see 01.

17.   Type yy so you now have yyy, you now have the full year – 2004.

18.   Again push the space bar and type the letter h and you should see the hour 23. From here, again you can choose to, or not to, use a space(s) or a colon as your hour and minute separator.

19.   For this example, we won’t use anything, so push the m so that you have hm together.

20.   Look in your Sample: box and you will see December 2004 2359. This is a perfectly valid date format. But as we discussed above, we would not be able to type this directly into a cell and have Excel recognize it as a valid date and time.

So, basically, should you have a date and/or date and time that you wish to appear different to the formats that Excel accepts when entered directly in a cell, all you need do is simply change the format of that cell. In fact, we stress to all our students that even if you are using dates as headings, you will probably be better off entering the date as a real date and then formatting the cell(s) accordingly.

Try this:

1.     Ensure you are still selected in the cell that contains the date and time and have the Format Cells Dialog box visible and select Custom in the Category box.

2.     Again, left click in the Type box after the last character, push the backspace so that there is no formatting at all in the type box

3.     Now type ”any old date and time” including the quotation marks (“”).

4.     Click OK and you should see what appears to be the text any old date and time in the cell containing the date and time.

You should notice that what appears to be text is aligned to the right as opposed to the left. If you click in the cell, and look in your formula bar, you should see that the underlying value of the cell has not changed at all. We can still reformat this cell to reflect the original date by defining the date/time format.

Of course, the same could apply to any number or text when working with the formats of the cell. No matter what format we apply, the underlying value will never change. However, having said this, there is one instance in which formatting can have an adverse affect on the value of the cell. This is the format Text which is also found under Category: on the Number tab of the Format Cells Dialog Box. I won’t go into any detail at this point as it will be best explained when we look at using formulas in Excel.

As you will have noticed, while we had the Format Cells Dialog Box visible, there were other page tabs that can also be used to manipulate the formatting of a cell.  The best way to find out what each feature on these page tabs will do is to simply type some data in a cell or cells and have a play with the settings. This way you will see immediately what affect it has on your data and you cannot do any harm whatsoever in doing so.

The only exception to this is the Protection page tab. We will be discussing this in a later lesson when we look at Protecting Worksheets. Many of the most common options and features available through the Format Cells Dialog Box can be found on the Formatting Toolbar.  Remember to wave your mouse over each icon for a short description of what it does.

## EXCEL FORMULAS

In this lesson we will start to take a look at what Excel does best and that is; work with formulas.

There aren’t too many spreadsheets about that do not contain formulas of some kind. Excel is regarded by many (including myself) as the number one spreadsheet package in the world today. In fact it has held this title for many years now and not without good reason. Once you become proficient in using Excel and become familiar with its capabilities, you too will no doubt wonder how you ever got by without it!

In this lesson we will look only at what I consider the bare minimum you should know about Excel and formulas. Once we have covered this we can move on to slightly more complex formulas and functions. You may or may not have heard the terms; formulas and functions used in reference to Excel before and wondered what’s the difference? The truth is they are more often than not used out of context. This is no doubt because the difference is quite subtle, though simple.

Functions

Excel has over 300 built-in Functions installed by default (there are more, but 300 will do for now) which are divided into ten separate categories:

Financial

Date & Time

Math & Trig

Statistical

Lookup & Reference

Database

Text

Logical

Information

Engineering

Possibly two of the most popular Functions (and easiest to use) are the SUM, which is categorized under Math & Trig and the COUNT. The SUM function simply adds together numbers and returns the total sum of the numbers. The COUNT simply counts numbers in any given range of cells. So a Function is a single predefined formula that is built into Excel.

Formulas

Once we have used one of Excels functions on a Worksheet we have created a formula. As we become more confident in using Excel we can start to join functions together to create different formulas. For example we might use the SUM and the COUNT function together in the same cell to create what would then become a formula.

So in a nutshell we can use a Function or Functions to create what then becomes a Formula.

Formula and Function Rules

There are only two rules when using functions to create formulas in Excel and these are:

All formulas and functions must begin with a = (equal sign).

For every open parenthesis (brackets) there must be a closing parenthesis.

Don’t confuse point 2 as meaning all formulas must have open and closing parenthesis, as this not always true. What is does mean is, all of Excels built-in Functions use at least one set of open and closing parenthesis.  These are the two rules that we must adhere to.

There is also a valuable tip that is good practice to get into also and that is that whenever you type in a function name, always type it in lower case.  The reason for this is that if you have spelt the Function name correctly, Excel will automatically convert it to uppercase.  Therefore you can use it as an error checking tool.

## EXCEL CELL REFERENCES

More often than not when we create a formula using one of Excels built-in functions we will be referring it to a cell or range of cells. An example of a single cell reference would be A1. An example of a range of cells reference would be A1:A10. For the first example we are referring to the content of cell A1 only, while in the second example we would be referring to the contents of cells A1, A2, A3, A4, A5, A6, A7, A8, A9, A10. Using the reference A1:A10 is just a simple method that Excel will automatically recognize. If we use the reference A1:C5 we are telling Excel to refer to the contents of cells A1, A2, A3, A4, A5, B1, B2, B3, B4, B5, C1, C2, C3 C4, C5.

Relative and Absolute Cell References

Relative

In Excel there are two types of cell references, these are Relative and Absolute.  We will first look at relative cell references. All the examples in the Cell References paragraph are what are known as relative cell references.

As you may remember in lesson 1 we discussed that each cell on an Excel Worksheet has it’s own unique address, e.g. A1 is the relative address of the first cell on all Worksheets, while IV65536 is the relative address of the last cell on all Worksheets. The reason why they are called relative is because they are relative to the cell they are used in. This will be best explained by a simple example.

In cell A1 type the number 1 and in cell A2 type the number 2.

Select cells A1:A2 and use the Fill Handle to fill down to A10, so that we have the numbers 1 to 10 in cells A1:A10.

In cell B1 type this simple reference: =A1 and push Enter.

Select cell B1 and do one of the following

Copy and then select B2:B10 and paste.

Double click the Fill Handle.

You should now have the numbers 1 to 10 in both A1:A10 and B1:B10. This because we typed a relative cell reference in cell B1 (=A1), which is telling Excel to make cell B1 equal the value of the cell one column to the left on the same row i.e. A1. So when we copy the reference in B1 i.e. =A1 and paste it into cell B2 Excel is still going to reference the cell one column to the left on the same row i.e. A2. Copying the same cell (B1) and pasting it into cell B3 again tells Excel to reference the cell one column to the left on the same row i.e. A3.

Lets now copy the content of cell B1 and paste it into cell D1, this time we should get the result 0 (zero). If you click in cell D1 and look in the Formula bar you will see the relative cell reference: =C1. The reason we get the result of 0 (zero) is because the value of an empty cell is 0 (zero).

Absolute

Ok, let’s now look at what an Absolute cell reference is. Basically an absolute cell reference is a reference to a cell that does not change no matter where it is copied. Again this will be easier to see by using an example.

Delete the contents of cells B1:B10 and D1.

In cell B1 type the absolute cell reference =\$A\$1 and push Enter.

Select cell B1 and either

Copy and then select B2:B10 and paste.

Double click the Fill Handle

This time you should have the number 1 in cells B1:B10 and if you select any cell in B1:B10 and look in the Formula bar, they will all have the absolute cell reference =\$A\$1. This is because by using the \$ (dollar sign) we are telling Excel to always refer to the same cell no matter where we copy this reference to. The \$ in front of the A (\$A) is telling Excel to make the column reference absolute, while the \$ in front of the 1 (\$1) is telling Excel to make the row reference absolute. So the reference in its entirety is what is known as an Absolute cell reference.

If you grasped this concept we can move on to what is known as a either an: Absolute row relative column reference or;  Relative row absolute column reference.

Again the best way to see this is by using a small example.

Relative Row Absolute Column Reference

Try this:

Delete the contents of cells B1:B10.

In B1 type the Relative row absolute column reference: =\$A1 and push Enter.

Select cell B1 and either.

Copy and then select B2:B10 and paste.

Double click the Fill Handle

You will have the numbers 1 to 10 in cells B1:B10. This is because the row portion of the reference (1) is relative. Now copy cell B10 to cell D1 and you should get the result 1.  This is because the column portion of the reference (\$A) is absolute. If you click in any cell in the range B1:B10 or D1 and look in the Formula bar you will see that the row portion is always relative to the row the reference resides in, while the column reference is always absolute.

The same principle also applies to any reference that has an absolute row relative column reference. Again this can be best seen via the use of a small example.

Absolute Row Relative Column Reference

Try this:

Delete the contents of cells B1:B10 and D1.

In B1 type the absolute row relative column reference: =A\$1 and push Enter.

Select cell B1 and either;

Copy and then select B2:B10 and paste.

Double click the Fill Handle.

You will have the number 1 in cells B1:B10. This is because the row portion of the reference (\$1) is absolute. Now copy cell B10 to cell D1 and you should get the result 0, this is because the column portion of the reference (A) is always relative to the column the reference resides in. If you click in any cell in the range B1:B10 and look in the Formula bar you will see that the row portion is always absolute. If you click in cell D1 and look in the Formula bar you should see =C\$1

AVOID TYPING IN EXCEL

In all the previous examples we have always said to type in the reference to a particular cell. While this is fine when typing in very simple references it is completely unnecessary.  What Excel allows us to do is to use the mouse pointer to type the reference for us. This is known as the click and point method. I strongly suggest forming this habit early on as good habits are as hard to break as bad ones! To see what we mean try this simple example:

Delete the contents of cells A1:B10 and cell D1.

Type any data into cell A1.

In cell B1 type = and move your mouse pointer outside of B1.  Place it over cell A1 and left click then push Enter.

You will see that Excel has placed the cell address =A1 in our cell for us. Using this method you are much less likely to make mistakes. From now on this is the method we will use in all examples.

There is one other way we can create a reference to another cell and this is via the Paste Link button on the Paste Special dialog box. We can see this method by simply selecting any cell then copying it and selecting the cell we wish to create the reference in, right click and select Paste Special then click the Paste Link button. If you look in the Formula bar you will see that Excel has created an absolute reference to the copied cell.

Toggle Through Absolute and Relative References

Another good habit to form is to use Function key 4 (F4) to toggle through absolute to relative references. This again will save typing and help prevent errors.

Try this

In cell B2 type = and then move your mouse pointer over cell A1 then select it.  Now click within the Formula bar so the mouse insertion point is either immediately before A1.

Between the A and the 1.

Immediately after A1.

Now push the F4 button and your reference should change to absolute i.e. \$A\$1

Push F4 again and you will get a relative column absolute row reference i.e. A\$1  Push F4 again as you will get an absolute column relative row reference; ie. \$A1  Push F4 again and we will return to our original relative reference; ie. A1.

So as you can see, by pushing F4 we can toggle through relative to absolute reference easily.

Referencing Other Worksheets

So far we have looked at how to reference a cell on the same Worksheet, but it is common to reference cells on other Worksheets. This method is again made very simple by using the point and click method. To reference a cell on another Worksheet do this:

Type an = in any cell.

Then using the mouse pointer click the name tab of another Worksheet (Sheet2 in this case).

Select the cell you wish to reference (C7 in this case) then push Enter.

As you will see, Excel will place in the Sheet name and the cell. If you select the cell containing the reference and look in the Formula bar you will see a reference similar to: =Sheet2!C7.  Note Excel uses the ! (Exclamation mark) after the Worksheet name, this is how Excel knows that that Sheet2 is the name of a Worksheet.

## EXCEL FORMULAE ARGUMENTS & SYNTAX

Now we have been through the ways and means of referencing cells we can move on to the SUM function in Excel. Without doubt the SUM function is one of the most commonly used Excel functions. I will also use the SUM function to better explain what Arguments are in functions and what the Syntax of a Function is.

### Arguments

Most of Excels functions need values of some sort to perform calculations and it is these values that are known as arguments. The argument for a function could be in the form of a number, text or logical value such as TRUE or FALSE. They could also be error values or arrays, but we won't go into this in Level 1.

Some functions will take only one argument while others can take up to 30. The SUM function for example takes up to thirty arguments, but only requires one. There are other functions that take 5 or 6 arguments and require that all the arguments have a value in them. Commas are always used to separate arguments in functions.

### Syntax

The term syntax in Excel refers to the order in which arguments are accepted in functions. For example, if we have a function that takes two arguments and the first argument must be a number, while the second must be text we could not put the text value as the first argument and the number as the second. If we did we would have the wrong syntax

Now we have discussed Arguments and Syntax we can move on to creating a formula in Excel using the SUM function. The SUM function will add all the numbers in a range of cells. If there is text within the range the SUM function will ignore them. However the SUM function will not ignore text values not stored in cells (a text value is a number entered as text). I will use an example to show you what I mean by this statement.

•    Type the numbers 1 to 5 in cells A1:A5

•    Now in cell A11 type =sum(

•    Click in cell A1 and holding down the mouse button drag down to cell A10

•    Push Enter (Excel will automatically add our closing parenthesis for us).

You should get the result 15 and if you select cell A11 and look in the formula bar you should see the formula =SUM(A1:A10). If we now type the number 5 in cell A6 we will get the result 20. If we type the word dog in cell A7 our result will not change. If we then type: "5" (including the quotation marks) the SUM function will again not change. This is because the SUM function will ignore text entered in cells.

To see what I mean by my previous statement "However the SUM function will not ignore text values not stored in cells" we will need to add another argument. Remember Commas are always used to separate arguments in functions, so we shall do is what is known as edit our formula. The easiest method to edit a simple function like the SUM is to do so from within the Formula bar.

•    Select cell A11 then place your mouse insertion point between the A10 and the closing parenthesis.

•    Type a comma (this tells Excel we are adding another argument) then type "5" (including the quotation marks)

•    Push Enter

This time our result in cell A11 will change to 25. This shows that while the SUM function will ignore text values stored in cells it does not ignore text values enter directly as an argument.

The range of cells that we use as an argument in the SUM function do not have to be adjoining as in the above example (A1:A10) they can be in non-adjoining ranges. This is the most likely reason we would use more than one argument.

•    Delete the SUM formula in cell A11

•    Type the numbers 1 to 5 in cells D1:D5

•    Type =sum( in cell A11 then select the range A1:A10

•    Type a comma (,) to start another argument.

•    Select the range D1:D5 and push Enter

You should get the sum value of all numbers in the ranges A1:A10 and D1:D5

We can make this task slightly easier by selecting the range A1:A10 then holding down the Ctrl key, select range D1:D5 and up to another 28 ranges if we wanted to.

If the numbers we wish to sum reside on another Worksheet, we would simply click the sheet name tab first then select the range on the Worksheet. If we want to sum numbers on both the Worksheets housing the sum formula and on another Worksheet, we could use the first argument for the current sheet and the

second argument for the other sheet. If we wanted to sum the same range of cells on different Worksheets that are next to each other we could do so like this:

•    Make sure you have five Worksheets in the Workbook you are using. To do this go to Insert>Worksheet as many times as needed.

•    In cell A1 type =SUM(

•    Now select the first sheet, this is the sheet on the far left. Hold down your Shift key and select the name tab of the last Worksheet, this is the sheet on the far right.

•    Now release the Shift key and select the range you wish the SUM function to sum.

•    Push Enter

Depending on the Worksheet names, order and range chosen, your formula should look something like:

=SUM(Sheet1:Sheet5!D1:G20)  If you now type any numbers within your chosen range on any of the Worksheets, they will affect the result of the SUM formula accordingly. We should also note that if we add another Worksheet anywhere between our chosen sheets it too will have the chosen range included (D1:G20 in my example).

## EXCEL AUTOSUM FUNCTION/FORMULA

The Excel AutoSum simply makes using the SUM function even easier, but only under the right conditions. Basically what the AutoSum will do is sum a range that is visibly directly above or to the left of the cell that we use it in (the default is above).  It will include all of the visible range until the first blank cell or the first cell containing text. Try these examples.

On a clean Worksheet put any numbers in the range D5:D10 and F5:J5.

Select cell D15 and click the AutoSum icon on the Standard toolbar. It's the icon on the right of the globe that looks like a reversed Z.

You should get the formula =SUM(D5:D14). Notice it starts at cell D5. This is because D4 is the first blank cell. It includes the empty range D11:D14 because it assumes we will want to add numbers within this range at some stage.

Now try this;

Delete the AutoSum in cell D15 then scroll down until cell D10 is no longer visible. In other words row 11 should be our first visible row.

Select cell D12 and click the AutoSum icon

You should see: =SUM() in cell D12. Push Enter and you will get an error message.

Push Esc twice to cancel the operation.

The reason the AutoSum did not work is because there were no visible cells containing numbers above or to the left.

Try a similar exercise on the numbers in cells F5:J5 and the same thing will happen. Although we could not enter the AutoSum in the second example, it did write the =SUM() formula for us and place the mouse insertion point between the opening and closing parenthesis. This means we could simply select any range that we wanted to sum

## EXCEL AUTO CALCULATE

AutoCalculate

There might be times when you wish to find out the sum of a range of numbers quickly without having to add a formula to the Worksheet.  For these instances, we can simply use the AutoCalculate feature of Excel.

To do this, select a range of cells containing the numbers you want to sum and look in the Status bar. If the Status bar is not visible go to View>Status bar. If the range of cells you wish to sum are non-adjoining, hold down the Ctrl key while selecting the ranges.

We are not restricted to only displaying the sum of our selected range! If you right click on the Status bar a shortcut menu will pop-up allowing us to choose one of six basic formulas. Have a look at each of these in turn and if you are unsure of what they do, please ask.

## THE INSERT FUNCTION DIALOG

Called the Paste Function dialog in older versions, but the Insert Function dialog in newer versions, this dialog box is used to insert or paste the selected function into the chosen cell. The big advantage to using this feature comes as you become more comfortable writing Excel formulas. Initially it is most beneficial because it can be used as a step-by-step guide for each argument in a function. What this means is, if you are going to be using a simple function such as the SUM, MIN, MAX etc., it really serves no purpose. When writing slightly harder functions such as COUNTIF, SUMIF etc., it can aid greatly.

Let’s display the Insert Function dialog and have a superficial look at it. There are three methods we can use to show this dialog box and which one you use is purely optional. The three methods are:

Going to Insert>Function

Push Shift + F3

Click the Insert Function icon to the left of your Formula bar (Fx), or for older version users, click the Paste Function icon on your Standard toolbar.

Once activated you will see the Insert Function dialog pop up in front of you.  Depending on which version of Excel you are using, these heading names may vary slightly in this dialog box.

Search for a Function

Type a brief description of what you want to do in this box, then click Go to view a list of appropriate Functions.

Or Select A Category

In this dialog box you will see the Category Names that the Functions are grouped in.  Click All to see a list of All Functions displayed in the Select A Function: box in alphabetical order.  Click Most Recently Used to see a list of the last 10 functions used in the Select a Function: box.

Help

In the bottom left hand corner you will see either Excels standard help button (question mark), or the words Help on this Function.  If you click this you will be presented with a description of how the selected Function works from Excel's Help.

To see how this works, Select All Under Or Select a Category: then Click on SUMIF under Select A Function.

The help screen that is displayed will give you most of the relevant information for the selected function, in this case SUMIF.  All function help descriptions are uniform in that they will show the syntax, a description of the arguments and an example. We strongly recommend that you familiarise yourself with the Function Help as it can be very helpful once you are aware of the terminology used, hence my explanations on arguments, syntax, ranges, text values etc.

Most Excel users shudder at the thought of using the help to get their answers, but this is most likely because they feel intimidated by the jargon Excel uses. Please do your utmost to not become one of these, as the Excel help will always be your best source of help. If there are any terms used by the Excel help you are uncertain of you can always ask us.

For now close the SUMIF help and click the Cancel on the Insert Function dialog box. Let’s try this simple exercise to see how the Insert Function can help in writing a formula. The purpose of this exercise is more to show you how to use the Insert Function as opposed to the SUMIF function itself.

Type the numbers 1, 5, 20, 40, 50, 100, 200 in cell A1:A7 respectively

Type the names Bill, Bob, Dave, John, Fred, Mary, Jill in cells B1:B7 respectively.

Select cell H2 and go to Insert>Function or push Shift+F3 this will display the Insert Function dialog box.

Click the Math & Trig in the Or Select a Cateogry: box.

Scroll down and select SUMIF.  At the bottom of the Select a Function: box will be the SUMIF arguments and syntax as well as a brief description of what it does.

Click the OK button to display the Function Arguments dialog for the SUMIF. You will notice there is one box for each argument and each box has the argument written to the left of its box. Notice the last argument (Sum_range) is not bold. This is because the argument is optional. Meaning, if we omit this argument, Excel will use the Range argument as the range to sum as well as the range to meet the Criteria.

Your mouse insertion point should be within the Range argument box, if it's not then click in there. If you look near the bottom you will see a brief description of what the Range argument does, which is the range of cells to evaluate based on the Criteria.

Look in your Formula bar and you will see =SUMIF() this is the SUMIF function with its opening and closing parenthesis. It is within these parentheses that the arguments will be placed.

Click the small box on the right of the Range argument box; this is called the collapse dialog button. The SUMIF dialog will disappear. Click in cell A1 and holding down the mouse button drag down to cell A7.

Now click the small button again, this is now the expand dialog button and the SUMIF dialog will appear again. You should now have A1:A7 as the Range argument.

Click in the Criteria argument box and you will see a brief description of what the Criteria argument expects for its data. We are going to use an expression first.

Type ">50" (including quotations) and you will see = 300 in the dialog box.  This is the result of the

Function, which in this case is the SUMIF.  At the bottom of the dialog box you will see Formula result = 300. In this case the Function result and the Formula result will always be the same. There would only be a difference if we were doing what is known as Nesting. This is something we will look at in a later lesson.

So the result 300 is what we would expect in this instance as the only numbers within our Range greater than 50 are 100 and 200. There was no need to supply any data for the Sum_range in this case because we were using the Range as the cells to sum as well as the cells to match the Criteria.

Delete the ">50" Criteria and replace it with "B*". You will notice both the Function result and Formula result =0 This is because the SUMIF is trying to use the Range cells to match the Criteria and for the cells to sum.

What we need to do now is have Excel look in a different Range to meet our Criteria, we also need to supply a Sum_range argument.

Click on the collapse dialog button for the Range argument and select range B1:B7, click the expand dialog button. We should now have the range B1:B7 as our Range argument. Again the result for both the Function and Formula will still be 0 (zero).  Now we need to supply a Sum_range argument!

Click on the collapse dialog button for the Sum_range argument and select range A1:A7, click the expand dialog button. We should now have the range A1:A7 as our Sum_range argument. Click OK we will get the result of 6.

This is because we have told the SUMIF to sum all cells in the range A1:A7 if the corresponding cell in B1:B7 has a word beginning with the letter "B".

The method in which we used the Insert Function for the SUMIF is the same principle we would use for all Functions written by using the Insert function dialog.  As I stated before we began the above steps, the point of the exercise was to demonstrate the way in which the Insert Function can aid us in writing formulas.

## USEFUL FUNCTIONS

Now we have covered the SUM function in detail and also covered formula arguments and formula syntax we will use half of this lesson to look at some of Excels easy to use Functions. Although these functions are among the easiest to use they are also arguably the most useful.

Once we have covered these functions we will go into some detail on Excels Insert Function. The Insert

Function was known as the Paste Function in earlier versions of Excel.  The Insert Function houses all of Excel’s built-in functions under their appropriate categories and goes a long way to writing the chosen function for us. In case you are wondering why we don’t just skip all the detail and go straight to the Insert Function and make life easier for us all, it is because I firmly believe that the most important aspects of Excel and it’s functions and formulas is understanding them. I like to believe that by course completion I will have taught you Excel, not shown it to you!

The functions we shall look at first are:

AVERAGE

COUNT

COUNTA

COUNTBLANK

COUNTIF

MAX

MIN

SUMIF

We will start each description with what the function does, followed by its syntax and then the number of arguments it can accept. It is important to note that while some functions take more than one argument it is not always the case that they must all be supplied.

These arguments are known as option arguments and I will identify these in the syntax description by not bolding the argument. For example the SUM function can take up to 30 arguments, but only one of the thirty needs to be supplied, so I would show this as below, eg:

Syntax SUM(number1,number2, ) Meaning “number2,…. to number 30” are all optional arguments while “number1” must be supplied.

AVERAGE

The AVERAGE function is used to return the average of the arguments supplied.

Syntax

AVERAGE(number1,number2, )

The AVERAGE function can take up to 30 arguments.

The arguments supplied must be numeric or references to numeric values. Text and/or references to text are ignored. It is important to note that cells containing zeros are NOT ignored. This can give you unexpected results if you are not aware of it.

=AVERAGE(A1:A3) would equal 10 if A1:A3 contained 5, 10, 15 respectively

COUNT

The COUNT function is used to count numbers or references to numbers in a range.

Syntax

COUNT(value1,value2, )

The COUNT function takes up to 30 arguments and each argument can be a variety of data types, but only numbers are counted.

If the range reference supplied contains valid dates these will also be counted.

=COUNT(A1:A5) would equal 3 if cells A1:A5 contained 10, 12/12/2001, house, 0, dog

COUNTA

The COUNTA function is used to count non-empty cells.

Syntax

COUNTA(value1,value2, )

The COUNTA function takes up to 30 arguments and each argument should be a reference to a range. Cells within the range can be a variety of data types, but only non-empty cells are counted.

=COUNTA(A1:A5) would equal 4 if cells A1:A5 contained , 12/12/2001, house, 0, dog.

In other words A1 is empty and so is not counted while all other cells are.

COUNTBLANK

The COUNTBLANK function is used to count empty cells. It is the opposite of the COUNTA function

Syntax

COUNTBLANK(range)

The COUNTBLANK function takes 1 argument and this argument should be a reference to a range. Cells within the range can be a variety of data types, but only empty cells are counted

=COUNTBLANK(A1:A5) would equal 1 if cells A1:A5 contained , 12/12/2001, house, 0, dog

In other words A1 is empty and so is counted while all other cells are not.

COUNTIF

The COUNTIF function is used to count cells within a range that meet a specified criterion.

Syntax

COUNTIF(range,criteria)

The COUNTIF function takes two (2) arguments. The range argument is a reference to a range of cells, while the criteria argument is the criterion that should be met by the cells within range before they are counted. The criteria specified can be in the form of a number, text or an expression.

Number criteria

=COUNTIF(A1:A5,20) would equal 1 if cells A1:A5 contained 15, 22, 20, 0, dog

In other words A3 is the only cell that meets the criteria of 20

Text criteria

=COUNTIF(A1:A5,”dog”) would equal 1 if cells A1:A5 contained 15, 22, 20, 0, dog

In other words A5 is the only cell that meets the criteria of “dog”

Expression criteria

=COUNTIF(A1:A5,”<20”) would equal 2 if cells A1:A5 contained 15, 22, 20, 0, dog.

In other words A1 and A4 are the only cells that meets the criteria of “<20”.

MAX

The MAX function is used to return the largest number from a set of values.

Syntax

MAX(number1,number2, )

The MAX function takes up to 30 arguments and will ignore text.

=MAX(A1:A5) would equal 10 if cells A1:A5 contained 9, 8, house, 10, -10

MIN

Opposite to Max, the MIN function is used to return the smallest number from a set of values.

Syntax

MIN(number1,number2, )

The MIN function takes up to 30 arguments and will ignore text.

=MIN(A1:A5) would equal 1 if cells A1:A5 contained 9, 8, house, 10, 1.

SUMIF

The SUMIF function is used to return the sum value from a specified range that meets a criterion.

Syntax

SUMIF(range,criteria,sum_range)

The SUMIF takes up to 3 arguments. The range is the range of cells to evaluate to see if they meet the specified criteria. The criteria specified can be in the form of a number, text or an expression. The sum_range is the range of cells to sum, but only if the corresponding cells in the range meet the specified criteria. If sum_range is omitted then the cells within the range are summed.

=SUMIF(A1:A5,5) would equal 10 if cells A1:A5 contained 5, 8, house, 10, 5

In other words cells A1 and A5 would be summed as they meet the criteria and NO sum_range was supplied.

=SUMIF(A1:A5,5,B1:B5) would equal 20 if cells A1:A5 contained 5, 8, 1, 9, 5 and cells B1:B5 contained 10,1,3,8,10.

In other words cells B1 and B5 would be summed as the corresponding cells in A1:A5 have a value of 5.  =SUMIF(A1:A5,”Cat”,B1:B5) would equal 15 if cells A1:A5 contained Cat, cat, Cat, 9, 5 and cells B1:B5 contained 5,5,5,8,11

In other words cells B1,B2 and B3 would be summed as the corresponding cells in A1:A5 contain the text “Cat” (not case sensitive).

=SUMIF(A1:A5,”>5”) would equal 34 if cells A1:A5 contained 10, 15, Cat, 9, 5 and In other words cells A1 and A5 would be summed as they meet the criteria of being greater than 5.

## NAMED RANGES IN EXCEL

Excel allows us to give Worksheet ranges names that can make our formulas easier to read. For instance if we use the above example that we used for the SUMIF Function, we could name our Criteria range (B1:B7) "Names" and our Sum_range (A1:A7) "Amounts". This would make our formula a bit easier to read.

There are however some basic rules for naming cells that we must adhere to. These are listed below and are from the Excel help file.

Guidelines for naming cells, formulas, and constants in Microsoft Excel

The first character of a name must be a letter or an underscore character. Remaining characters in the name can be letters, numbers, periods, and underscore characters.

Names cannot be the same as a cell reference, such as Z\$100 or R1C1.

Spaces are not allowed. Underscore characters and periods may be used as word separators ¾ for example, First.Quarter or Sales_Tax.

A name can contain up to 255 characters.

Names can contain uppercase and lowercase letters. Microsoft Excel does not distinguish between uppercase and lowercase characters in names. For example, if you have created the name Sales and then create another name called SALES in the same workbook, the second name will replace the first one.

There are a couple of ways we can name ranges so let's jump straight in with an example.

Delete the contents of cells A1 and B1 and type the word Amounts in cell A1 and Names in cell B1.

Type 5, 20, 40, 50, 100, 200 in cell A2:A7 respectively. Type the names Bob, Dave, John, Fred, Dick, Jill in cells B2:B7 respectively, if they are not there already.

Now either select the range A1:B7 with the mouse, or push Ctrl + Shift + * this will make Excel select the Current region. The Current region is defined as all the non-empty adjoining cells surrounding the active cell. The * (asterisk) must be the one on the same key as the 8).

Go to Insert>Name>Create. This is the Create names dialog box and is used to create names based on the current region row and/or column headings. In this case we only have column headings so ensure that only the "Top row" check box is checked.

What we have done by doing this is told Excel that we wish to name the range A2:A7 Amounts and the range B2:B7 Names. In other words use the headings in the top row to name the selected ranges directly below them. Click OK

Now select cell C8 and push Shift + F3 or go to Insert>Function. Locate the SUMIF function either from within the category Most recently used or Math & Trig then click OK.

Click the collapse dialog button on the Range argument box and select range B2:B7. You should see Excel place the name Names in the Range argument box. This is our named range B2:B7. Click the expand dialog button.

Type "D*" in the Criteria argument box.

Click the collapse dialog button on the Sum_range argument box and select range A2:A7. You should again see Excel place the name Amounts, this time in the Sum_range argument box. Click the expand dialog button. Now Click OK.

You should have the formula =SUMIF(Names,"D*",Amounts) giving the result of 120.

Using the Create names dialog is the easiest method to use if we are going to be calling our ranges the same names as the column and/or row headings as it saves typing and typos. We could, if we wanted, type the names in ourselves, by typing them directly into the Name box. The Name box is on the left of the Formula bar. If we click the small drop arrow on the Name box, we should see both our named ranges Amounts and Names. If you select either one Excel will take you straight to the chosen named range and select it. It is in this box that we can type a name in directly.

To see what I mean select the range A1:B7 and click in the Name box. Type the word Data and push Enter.  Now select any cell outside of range A1:B7 and select the name Data from the Name box, you will be transferred automatically to the Data selection.

The other thing we need to know when dealing with named ranges is how to delete them. This can only be done in one way and this is via the Insert name dialog box.

Go to Insert>Name>Define or push Ctrl + F3. This will display our Insert name dialog box.

You should see the three names we had created amongst the listing. Select the name Amounts.

If you now look in the Refers to box you should see =Sheet1!\$A\$2:\$A\$7.  The Sheet1! May be different if the Worksheet is called something else.

All we need to do now is click Delete and the named range Amounts will be deleted.

Do the same for Data and Names then click OK.

You will notice that our SUMIF formula is now retuning #NAME? This is Excels way of telling us the formula within the cell contains text is does not recognise.  Delete the #NAME?

The Insert name dialog is also the only place we can edit named ranges. In the above example we could have altered the Refers to range for any of the names to another range. For example we could have changed =Sheet1!\$A\$2:\$A\$7 to =Sheet2!\$A\$2:\$A\$7 and/or =Sheet2!\$L\$1:\$M\$70 or any valid range address.

CONSTANTS

There is one other area of Naming we would like to cover and this is naming CONSTANTS. A constant is simply a value that is not the result of a formula. So if we type 10% or David or 12/12/2000 into a cell these would all be constants, as their values would not change unless we changed them.

Quite often when setting up a spreadsheet some users will type a value or text that they will be using a lot into a cell and then refer to that cell in their formulas. For example lets say we are setting up a spreadsheet that will constantly be using the percentage 10%.  We could place this into a cell somewhere and then name this cell TenPercent. We could then use this named cell in all our calculations that require 10%.  Let's try this to see how it works.

Type the value 10% in any cell.

With this cell selected go to the Name box and type in TenPercent and push Enter.

Now in any other cell type =100*TenPercent and push Enter.

You should have the result 10, which is what we would expect by multiplying 100 by 10%. The biggest advantage to this method is that if we need to change 10% to say 20% we simply go to our named cell TenPercent and type in 20%. All our formulas that are using TenPercent in their calculations will change accordingly. The down side to this method is that it is all too easy to accidentally delete the value in our named cell.  A better method is the one below.

Go to Insert>Name>Define (or push Ctrl + F3)

Select TenPercent and then in the Refers to box type 10% straight over the top of the cell address.

What we have now done is named a constant. This is a better method as it is very unlikely this could be accidentally deleted.

## PASTE NAME DIALOG

You may end up with a Workbook that has many named constants and it is a bit hard to remember them all! Not to worry as Excel has a feature called the Paste name dialog. This can both insert a named constant or range and create a list of all our names within the Workbook. We can see this best if we create some named ranges and some more named constants. Do this using the methods above. When you have created 3 named constants and 3 named ranges try this.

Type 0 in any cell then before pushing Enter push F3 or go to Insert>Name>Paste.

From the Paste name dialog box select TenPercent and click OK

Excel will insert the name for you. This can be very handy when using named ranges and/or constants in formulas.

On a new Worksheet select any cell and push F3 and click the Paste list button.  Excel will create a list of all named ranges and constants in the Workbook. The names will be in one column and what or where they refer to in the other. The only reason we suggested a new Worksheet is so that the list is not pasted over the top of existing data.

## HOW EXCEL CALCULATES

One of the fundamental things that you must know about Formulas and Functions is the method in which Excel performs calculations.  We will not go into any great detail in this, but there are some basics all Excel users need to know.

The main function of Excel is obviously the number crunching side of things and a good spreadsheet is one that returns accurate results 100% of the time. So whilst we may have a spreadsheet that looks very pretty and is formatted to make it look a million dollars, it is the guts of the spreadsheet, or the nuts and bolts, that make it either a workable spreadsheet or an unworkable spreadsheet, not the visual appeal.

### Operators that Excel Recognises

The text below is from the Excel help file:

Calculation operators in formulas

Operators specify the type of calculation that you want to perform on the elements of a formula. Microsoft Excel includes four different types of calculation operators: arithmetic, comparison, text, and reference.

Arithmetic operators

To perform basic mathematical operations such as addition, subtraction, or multiplication; combine numbers; and produce numeric results, use the following arithmetic operators.

 Arithmetic operator Meaning Example + (plus sign) Addition 3+3 – (minus sign) SubtractionNegation 3–1–1 * (asterisk) Multiplication 3*3 / (forward slash) Division 3/3 % (percent sign) Percent 20% ^ (caret) Exponentiation 3^2 (the same as 3*3)

Comparison operators

You can compare two values with the following operators. When two values are compared by using these operators, the result is a logical value, either TRUE or FALSE.

 Comparison operator Meaning Example = (equal sign) Equal to A1=B1 (greater than sign) Greater than A1>B1 < (less than sign) Less than A1= (greater than or equal to sign) Greater than or equal to A1>=B1 <= (less than or equal to sign) Less than or equal to A1<=B1 <> (not equal to sign) Not equal to A1<>B1

Text concatenation operator

Use the ampersand (&) to join, or concatenate, one or more text strings to produce a single piece of text.

 Text operator Meaning Example & (ampersand) Connects, or concatenates, two values to produce one continuous text value "North" & "wind" produce "Northwind"

Reference operators

Combine ranges of cells for calculations with the following operators.

 Reference operator Meaning Example : (colon) Range operator, which produces one reference to all the cells between two references, including the two references B5:B15 , (comma) Union operator, which combines multiple references into one reference SUM(B5:B15,D5:D15)

End of MS Excel Help file

When Excel performs a calculation it does so in the following order:

•  Exponentiation

•  Multiplication and Division

If a formula contained both a multiplication and a division operator Excel would calculate them from left to right. The same would apply for subtraction and addition. We can change the order in which Excel does its calculations by closing the relative function in parenthesis. Let's say we had the formula =10-10*10 the result would be -90 (negative 90). If we then used =(10-10)*10 the result would be 0 (zero). In other words we have forced Excel to change its natural order of calculation. Excel is quite happy to do this.

Some examples of this would be:

•  =5+5*5+5+5 would result in 40

•  =(5+5)*5+5+5 would result in 60

•  =(5+5)*(5+5)+5 would result in 105

So as you can see, we can manipulate any formula to calculate in the order we want, simply by placing the parenthesis in the appropriate places.

We will leave Formulas at this stage to allow you time to let what we have discussed to date sink in. If there are any questions you would like to ask or any particular formulas you would like explained you only need to ask. What we have shown you is what we consider the least you should know about Excel and formulas. Once you have gone over and fully understand these lessons on Excels functions and formulas you will have the foundations on which we can build. You may also discover that you will know the fundamentals of Excel formulas and functions better than a lot of so called experienced users!!

Cell Comments, or notes as they are often called, were first introduced in Excel 97. They are basically the equivalent of sticky notes that have become so popular in offices throughout the world.  They allow us to attach a comment to a cell to inform, remind or explain the content of a cell or range of cells.  We must stress, however that they shouldn't be used too liberally as not only will they loose their impact but they can cause a file size to increase dramatically. As a rule of thumb we would recommend using no more than 50 or so per Workbook. You would have noticed in lessons 4 and 5 that I used cell Comments to help explain the formulas that resided in the cells they were attached to.  As with most features in Excel, there are numerous ways we can insert a cell Comment, the method used is entirely up to the user.

To insert a cell Comment, do one of the following:

•  Right click and select Insert Comment

•  Go to Insert>Comment

•  Push Shift + F2

•  Display the Reviewing Toolbar. Go to View>Toolbars>Reviewing or right click on any visible Toolbar and select Reviewing. Once the Reviewing Toolbar is visible click the first icon on the left (New comment).

Whichever method we use Excel will:

•  Insert the comment into the cell that is active at the time.

•  Place in the user name for the PC being used at the time.

•  Place the mouse insertion point within the comment ready for you to type. This is a cell Comments Edit mode.

The user name of your PC is determined by Excel under the General page tab of the Options dialog box. We can change this by going to Tools>Options and selecting the General page tab and typing whatever we like in the User name box situated at the bottom.

This will not affect any cell Comments that have already been inserted only new ones we insert after making the change.

Let's insert a cell Comment into any cell on any Worksheet using any of the above methods,  we prefer the right click method.  As mentioned before, you will be in Edit mode so we can simply type any text we like. Once you reach the edge of the cell Comment, Excel will automatically drop us down to the next line.  This can also be done at any time by pushing Enter. If you keep typing until you reach the bottom edge of the cell Comment Excel will automatically push the top line out of sight and continue on.

Once you have finished typing and click out of the cell, the comment will automatically do what is known as Hide itself. If the comment is still fully visible you may need to do one or both of the steps below:

•  Display the Reviewing Toolbar. Go to View>Toolbars>Reviewing or right click on any visible Toolbar and select Reviewing. Once the Reviewing Toolbar is visible click the fifth icon on the left (Hide All Comments) this is a toggle key.

•  Go to Tools>Options select the View page tab and ensure the Comment indicator only check box is checked.

In fact it would be a good idea to have the Reviewing Toolbar visible while we go through cell

Comments, so show it and then either drag and dock it, or double click the blue title bar. If you prefer you could also leave it as a floating Toolbar.

You will notice that the cell containing the cell Comment has a small red triangle in the top right corner. This is the Comment indicator, or flag as it is sometimes called. This simply lets us know that there is a comment in the cell. To read the comment simply hover your mouse pointer over the cell and it will display the comment. Once you move your mouse pointer away from the cell the comment will hide itself again.

Many books and other literature will tell you that you should select the cell to display a cell Comment and the cell being active is what displays the comment, this not technically true! A simple way to prove this is to click in the cell directly below the cell with the cell Comment, move your mouse pointer away from the cell and use the Up arrow on the keyboard to activate the cell. You will not see the comment until you hover your mouse pointer over the cell.

### Edit a Cell Comment

Once we have a comment in a cell we can Edit it in much the same way as we can format a cell and/or it's content. This means we can nominate the type of text, the color of the text and/or the comment itself, its size, its outline and even it's shape.

Most of these can be achieved via the Format Comment dialog box and are self explanatory, so we will only explain the little known ones.  However, as with any part of Excel if you would like some detail, you only have to ask!

Ok, the easiest way to Edit a cell Comment is to click in the cell containing the cell Comment, right click and select Edit comment. This will put us in Edit mode, exactly as we were when we first inserted it. The first thing you may notice is the fuzzy outline around the cell Comment and the eight small white boxes or circles (depending on which version of Excel you are using). These white boxes are called the Size handles and are common to all shapes, textboxes, comments and charts etc. All you need to do is hover your mouse pointer over one of them until your mouse pointer changes to an up/down arrow, left click, then drag and release. If you use the Size handles in either corner of the cell Comment the height and width will change in accordance with each other.

Let's now display the Format comment dialog box.  To do this, double click on the outer edge, or right click on it and select Format comment.  Either way, Excel will display the Format comment dialog box.  On this you should see eight page tabs and most of these are purely for visual effect with the exception of Protection and Properties. Protection is will explain is a later lesson. If there is any aspect of this dialog box you would like explained just let us know.

There are a few features of cell Comments that cannot be changed via the Format comment dialog box and these are the shape and 3d effect. For both of these examples you will need to use the Drawing Toolbar.  So if it is not visible go to View>Toolbars>Drawing or right click on any toolbar and select Drawing.  By default the Drawing toolbar will dock itself at the bottom of your screen.

### Change the Shape

•  Select a cell that has a cell Comment, right click and select Edit Comment then select the outer edge.

•  On the Drawing Toolbar go to Draw>Change AutoShape

•  Wave you mouse pointer over the sub menus to see your choices.

•  Select any shape.

Now you will have a comment that has the shape of the AutoShape you chose.

### Give a 3d Effect

•  Select a cell that has a cell Comment, right click and select Edit Comment then select the outer edge.

•  On the Drawing Toolbar go to Draw>3-D. This is the last icon on the right in the shape of a 3-D box. Select any 3-D setting

Now you will have a comment that has the 3-D effect that you have chosen.

•  Select a cell that has a cell Comment, right click and select Edit Comment then select the outer edge.

•  On the Drawing Toolbar go to Draw>Shadow this is the second last icon on the right.

Now you will have a comment that has the shadow effect you chose.

That is about it for cell Comments, but please ask any questions that you may have.  Got any Excel Questions? Free Excel Help

## FIND & REPLACE

As with most Microsoft Office applications Excel has a Find dialog and a Replace dialog. These make it possible to quickly find a particular piece of text or a value in a Worksheet or Worksheets.

There are two rules that apply to both of these dialog boxes and these are:

•  If we only have a single cell selected they search through the entire Worksheet.

•  If we have more than one cell selected, they will search only through the selected range.

The Find dialog box and Replace dialog box are very closely related. They are more often than not used in conjunction with each other. Basically, if you opt for Edit you will be able to use the Find and/or the Replace.  Our recommendation is to forget about the Find box unless you are searching for text or values that reside in cell Comments. We will use cell Comments as our first example, but first we feel it is important to point out that the Look in box within the Find dialog box has three options; Formulas, Values and Comments. The Formulas and Values options can give very misleading results, so I recommend not using them.  We will however, show you an alternative later.

The comments option of the Find dialog box does not have a Replace option and works like this:

•  On a clean Worksheet, type the simple formula =B1+2 in cell A1

•  In A2, type the number 2.

•  In A3, insert a cell Comment and type the number 2 inside it.

•  In A4, type the word Cat, push the space bar and then type cat

•  In A5, insert another cell Comment and type the number 2

•  In A6, type =2+B6

•  With any single cell selected, either go to Edit>Find or push Ctrl + F

•  Type the number 2 in the Find What box. You will notice that there is a Search box that contains the two options By Rows or By ColumnsNote - These options will have very little bearing on a Worksheet unless virtually every cell is filled with data, which is very unlikely! Even then, it will only make the difference of a second or two in the way it searches

•  Have Comments selected in the Look In box, then click Find Next and Excel will take you first to cell A3.

•  Click Find Next again, and you will be taken to cell A5. Note - If you keep clicking Find Next, you will toggle between A3 and A5.

•  What you need to do from here should you wish to replace the number 2 within the cell Comment(s) is click Cancel and edit the comment as we discussed previously.

Let's now use the Edit>Replace dialog to replace text or values in our cells.

•  Again, with any single cell selected, go to Edit>Replace or use Ctrl + H

•  Type the word cat (in lower case) in the Find What box, then type the word dog (lower case) in the Replace With box.

•  Check the Find Entire cells Only box and click Replace. You should get a message come up telling you that Microsoft Excel cannot find a match. This is because we do not have the single word cat in a cell on its own, which is what the Find Entire cells Only option forces it to look for.

•  Deselect (or uncheck) the Find Entire cells Only checkbox and click the Match Case checkbox. Now click the Find Next button and we should be taken straight to cell A4, which contains the two words Cat and cat. One with the uppercase C and one with a lowercase c

•  Click the Replace button and our word cat (with the lowercase c) should be replaced with the word dog. The word Cat (with an uppercase C) will be left unchanged, even if you click the Replace button again.

•  Click Close

We should note here that clicking the Replace button will only ever replace the text or value in the current active cell. Clicking the Replace All button will replace all matching text or values on the entire Worksheet, unless we had more than one cell or a range of cells selected before we activated the Replace dialog.

Let's now assume we want to replace the number 2, but only in cell A1, where it is part of our formula.

•  Select any cell on your Worksheet other than cell A1

•  Push F5 and click Special on the Go To dialog box. This will display what is known as the Go To Special dialog box.

•  Check the Formulas option and leave all the sub-options below this, as it does not matter in this case.

•  Click OK

•  Now push Ctrl + H or go to Edit>Replace. Type 2 in the Find What box, and the number 3 in the Replace With box. Ensure the Find Entire cells Only option is not checked.

•  Click Replace All and then Cancel.

•  If you then click back in cell A1 and look in your formula bar, you should now see the formula = B1+3. If you click in cell A6 you should see =3+B6 in your formula bar.

The reason the Replace All only replaced the number 2 in our formulas was simply because we had more than one cell selected, which is telling Excel to only replace the number 2 in the selected cells only.

Got any Excel Questions? Free Excel Help

## THE DIFFERENT METHODS OF CLEARING EXCEL CELL CONTENTS

Normally when working in Excel, if we want to remove a cell(s) contents we would simply push the Delete key on our keyboard. This would delete the contents of the cell. However, it will not delete the formatting of the cell in any way. What this means is, if we had a cell with a yellow background, blue font and formatted for currency, and the value \$10.00 in the cell.  Pushing Delete would only remove the value 10. All the other cell attributes would remain intact.

Let's try just this so that you can see what we mean.

•  In cell A3, type the value 10. Format the cell for currency of any kind, make it yellow and make the font blue.

•  Click in cell A3 and push Delete.

•  Now type any number in the cell and as you will see, you will still have a yellow cell with blue font and formatted for currency.

•  This time, with cell A3 selected, go to Edit>Clear>All

•  Now type any number in cell A3 and all you will have is the number in black font, with no formatting and no background colour.

•  Click the Undo button to undo the Clear All action.

•  Ensure A3 is still your active cell. Go to Edit>Clear>Formats and cell A3 should now only have the number 10 in the cell without any formatting of any kind.

While these differences may appear subtle, they can be very handy should you have a large range of cells which you have specifically formatted and you only want to clear the contents and not the formatting or vice versa.

Got any Excel Questions? Free Excel Help

## EXCEL PRINTING

As we have stated in previous lessons, we believe the content of a Worksheet is far more important than using a great deal of formatting to pretty it up.

However, when it comes to printing a Worksheet, it is essential that you know how to produce a finished product that a reader can easily relate to.  It is definitely worth spending a small amount of time on getting your printer settings correct, rather than waste time and paper trying to do it quickly. Let’s look at the printing function of Excel in more detail.

There are many different ways that you can print a Workbook.  The three most common are:

•  By going to File>Print

•  By selecting Ctrl + P

•  By selecting the printer icon on your Standard Toolbar

If you print by selecting the printer icon, you must be aware that this option will by-pass the Print dialog box and print straight to your printer using its current print settings.  Use this option only when you are sure of your print settings.

Let us now access the Print dialog box by using either the File>Print option or by selecting Ctrl + P and look at the essential functions of this dialog box in some more detail.

Printer

### Name

In the white box next to Name, you will see the printer that your particular PC is connected to. If you can access more than one printer, selecting the downward pointing arrow to the right of the printer name will enable you to see the other printers you are connected to. If you wish to change printers to print (ie, if you are connected to both a black and white printer and a colour printer, you can decide which printer you wish to use by just clicking the desired printer with your left mouse button.

Status

This is telling you the status of the printer you have selected. The choices are either busy or idle

Type

This is again telling you which type of printer you are connected to as your default

### Where

This is identifying to you the location of your printer. If you are connected to a local printer it will display the port number of your computer. If you are connected to a network printer, it will display the location of the network printer.

### Find Printer

Allows you to select a printer on your network that is not listed in your dialog box.  Sometimes network administrators will bar you from entering this area, but if you have access, you can select the printer you want to use, click OK to return to this menu and print the document.

### Properties

By pressing this button, you will be taken to a sub-menu of Properties. Let’s look at the sheet tabs within this sub-menu. After making a selection on any of these sheet tabs, click OK and your changes will be accepted.

Note:  Some of the options listed here may not be available to you, you may have extra options, or the option names may be slightly different.  This is entirely dependent on the printer you are connected to. Paper

### Paper Size

Under this heading you will see the various paper sizes available to your printer. Have a look at the paper sizes available to you by scrolling through with the horizontal scroll bar beneath the icon window. Clicking on the desired paper size will select it. You will note in this box that there is a custom icon. If you printer supports custom paper sizes, you can click this icon and specify the size you wish to use.

### Paper Source

This box and its downward pointing arrow to the right specify where in your particular printer your paper resides. Different printers have different paper sources, such as upper tray, manual feed or lower tray and you may wish to change your source. For instance, in most business today you will find letterhead stored in an upper tray and followers (white) paper in a lower tray, or A3 paper stored in one tray, and legal in another.

### Media Choice

This box and its downward pointing arrow to the right specify the type of mediums available to you. These could be in the range of standard, bond, special paper, or transparency. Note that if you select transparency, you must have a transparency in your paper tray, otherwise if you print on ordinary paper, the printer’s ink will smear and waste not only ink but paper as well.  About

This will tell you nothing more than the copyright information unique to your particular printer.

Restore Defaults

Pressing this button will restore the defaults on this page tab to their original settings.

Graphics

### Resolution

This option will only apply if you are using a laser printer and true-type fonts. It enables you to change the resolution of your printing. Basically, the higher the resolution, the better quality printing you will get.

### Dithering

Dithering is used for colour printing and black and white printing. It blends pure colours into patterns to simulate a wider range of colours (such as blending red and yellow together to make orange) when used with a colour printer, and will produce grey shading in graphics for black and white printers.

None

Click None if you don’t want any dithering.

Course

Click this if your resolution setting is 300 dots per inch or higher.

Fine

Click this option if your resolution setting is 200 dots per inch or less.

Line Art

Click this option if your graphics include well-defined borders between black, white and grey settings.

Error Diffusion

For printing pictures or photographs without well-defined or sharp edges.

### Intensity

This option has a slide bar that can be dragged by holding down your left mouse button on the arrow and dragging towards either darkest or lightest. It will affect how dark or light the graphics in your document are printed.

### Device Options  Print Quality

The options under this heading will be unique to your printer. Basically, you can change the type of quality you want to use depending on if you want to print a draft, a presentation or whatever.

Back onto the Print Dialog Box now and we will look at Print Range.

### Print Range

There are two options under print range. Select All you would use if you wish to print your entire

Workbook, or Select Page(s) if you wish to only print some of your Workbook. You can either type in the From and To boxes, or you can use the spin button (the tiny upwards and downwards pointing arrows to the right of these boxes) to make a selection. Then click OK.

Print What

There are three options under this heading.

Selection

By selecting this option, Excel will only print the range you have selected.

### Active Sheet

If you select this option, Excel will print the active sheet. This is defined as going from the first cell containing data to the furthest right most cell containing data, and the furthest bottom cell containing data in your Worksheet.

Entire Workbook

This obviously will print the entire Workbook if selected.

### Copies

You can either type the number of copies that you require in this box, or use the spin button to make a selection, then select OK.

### Preview

By pressing this button, you will be able to view your document in Print Preview mode. More about this now in lesson 30.

Got any Excel Questions? Free Excel Help

## EXCEL PRINTING

### Different Views

Excel provides you with lots of different settings that let you adjust the final appearance of the data that you wish to print. There are three different types of views that are available to you to help you see and adjust how the Worksheet will look when you print it. It is entirely up to you which view you work in, you can switch between the different views to view your work in different modes and see the effects before you print it.

The three views available to you are:

•  Normal View

•  Page Break Preview

•  Print Preview

### Normal View

Normal view is the default of Excel. It is the best option for working with your document and for on-screen viewing. This view is available through the View menu on the Standard Worksheet Menu Bar.

### Page Break Preview

This preview will show you the page breaks of your data and will easily allow you to adjust your print area and page breaks. This view is available through the View menu on the Standard Worksheet Menu Bar and is not covered in this lesson.

### Print Preview

If you set your view to Print Preview, you can easily see your columns and margins and adjust them in this mode. All you need to do is hover your mouse over the column handles (located right at the top of your page) until your mouse changes to a cross and drag in whichever direction you require to widen the column, or place your mouse on the margin lines and drag in the same way. This view is available by pressing the Preview button on your Print dialog box, by selecting the Print Preview icon located to the right of your printer icon on the Standard Toolbar, or by selecting Print Preview from the File menu.

Let us now have a look at printing a typical document.

Call up the attached Workbook (NOTE: you may have to extract it from the ZIP first !

•  Try out the different views available to you. Remember, Normal view (which you should already be in since it is the default) and Page Break Preview are available through the View menu on the Standard Worksheet Menu Bar, whilst Print Preview is available to you by selecting the icon next to the printer icon, or by selecting Preview from the Print dialog box or by accessing Print Preview from the File menu.

•  Let us now highlight the range that we wish to print to perform a print by Selection. Select the range A3:J54 on the Automatic Outline worksheet.

•  Now select Print Preview to have a look at your selected range in this mode by using one of the three methods described above.

•  Notice down on the status bar at the bottom of your page you will see the text: Preview:

Page 1 of 2. This is telling you that you are on page 1 of 2 pages.  At the top of your screen are 9 buttons. Let’s have a look at some of these now.

### Next and Previous

Selecting these buttons will take you through the number of pages you have on your screen. Next will take you forwards and Previous will take you to the previous page.

### Zoom

By selecting this button, you will switch between a full-page view of a sheet and a magnified view. The Zoom feature will not affect the size of your printing. It is just an aid to assist with readability. You can switch between a full-page view and a magnified view of a sheet by clicking any area of the sheet. Notice your mouse will change to a magnifying glass when you do this. Place your mouse over the part of the sheet that you wish to magnify and by clicking your mouse button it is magnified.

### Margins

Select the button titled Margins (another toggle button), you will see lines pop up on your screen. Each line depicts a margin. You can change your margins by hovering your mouse over the lines until your mouse changes to a cross, then drag to either widen or shorten. Selecting the Margins button again will hide the margin lines.

### Setup

If you select this button, your Page Setup dialog box will pop up in front of you.

This dialog box can also be accessed via the File menu. You will notice as we go through this box that a few options are greyed out. If you select Page Setup through the File menu, all options will be available to you, so it is a good idea to access it this way while you are learning. This is probably the most important box of the entire printing function, as it is here you make the necessary changes to print your document professionally.

### Orientation

Orientation means the way in which your sheet of paper prints from the printer. Portrait means with the shorter edge at the top of your page and the longer edges at the sides, and the Landscape option means with the longer edges at the top of the page and the shorter edges down the sides.

### Scaling

There are two options under this heading. The first option Adjust to __% of normal size will allow you to reduce or enlarge the print range you have selected. The range varies from shrinking your selection to 10% of normal size, to expanding your selection to 400% of normal size.

The second option under this heading is Fit to __ page(s) high by __ page(s) tall. This will make our selection to fit on however many pages we specify.

Let’s now select Portrait under Orientation and Fit to 1 page(s) wide by 1 page(s) tall under Scaling. Now hit OK and you should be returned to Print Preview mode. You will notice that all our selected data now appears on one page.

If you hit the Setup button again, you will be returned to the Page Setup dialog box.  Note here that under Adjust to __% of normal size you have 77%. This is telling you that Excel had to reduce your selected data to 77% of it’s normal size to fit it all onto a page that is 1 page wide by 1 page tall.

Now select the Landscape button under Orientation and then select the Adjust to __% of normal size option and either type or use the spin button arrows to reach 100%. Select OK again to accept your choice.

Again you will be returned to Print Preview mode and you will notice now that your selected data is again on two pages. If we wanted to, we could select the Fit to 1 page(s) wide by 1 page(s) tall option, to fit all of our data on a landscape page, but in this case we will print on 2 pages.

### Paper Size

You can change your paper size here, as well as in your Print dialog box if you wish by selecting your downward pointing arrow to see the paper sizes available through your printer.

### Print Quality

You can change your print quality here, as well as in your Print dialog box by also selecting the downward pointing arrow to see the ranges available to you.

### First Page Number

The default here is Auto which means your printing will start at page 1. If you wish to print starting at another page number, you can type any number other than 1 in this box.

### Margins

This sheet tab will show you the margins of your page and the margins of any headers or footers you may have. You can type your margins in if you wish, but it is far easier to change your margins using the Margins button in Print Preview mode, as discussed above.

### Centre on Page

This option however, is a very handy feature not available in Print Preview mode. By selecting either horizontal or vertical you will center your selection on your page either horizontally or vertically.

The definition of a Header or Footer is something that is required to appear on every page of your document. As the names suggest, a Header is something that will appear at the top of every page, and a Footer is something that will appear at the bottom of the page. In Excel, you can have only one Header and one Footer in each Worksheet. The Header/Footer Dialog box can be accessed through the Page Setup dialog box, or via the View menu on your Standard Worksheet menu bar.

Let us first create a Header for the data that we wish to print.

•    Click in the white box under Centre Section. As the title suggests, if you type in this box, your Header will be centered, Left Section will left align your text and Right Section will right align your text.

•    Type in the words FOUR YEAR FORECAST in the Centre Section box.

•    Now, highlight your text and click on the A icon above. You will now be familiar with the Format Cells dialog box, and what you are looking at now is a mini version of this.

•    Select Bold under Font Style and 24 under Size. Click OK

•    You will now be taken back to your Header dialog box and you will notice that the words FOUR YEAR FORECAST are indeed bolded and size 24.

•    Select OK

To the right of the second white box is a downward pointing drop down arrow. This contains some built-in headers. If you wanted to, you could select a build-in header, then go to Custom Header to use it for your Worksheet.

Footers work in exactly the same way so let’s put a footer in now

•    Click on Custom Footer

•    Click in the white box under Left Section

•    Select the second icon from the left with a green cross in it. You will notice &[File] appear in the Left Section. This will automatically insert the file name of your Worksheet into the Left Section of your Worksheet.

•    The other icons here (apart from the A which is the mini version of your Format Cells dialog box) will insert information as follows:

•    # Will automatically insert the page numbers for you.

•    ++ Will automatically insert the number of pages in the active Workbook.  This means that if you had Page # of ++ in your footer, you would actually have Page 1 of 12 (or however many pages you had).

•    8/7 This will automatically insert the current date.

•    Clock Will automatically insert the current time.

•    Green Cross Will automatically insert the current file name.

•    Blank Paper Will automatically insert the sheet name of the current Worksheet.

•    Now click in Right Section of your Footer, type the words Printed on then select the Date icon.

•    Now select OK to return you to your Page Setup Dialog Box.

The last section of the Page Setup dialog box that we need to look at is under the Sheet heading  Sheet

The top area of this box is greyed out. If something is greyed out within Excel, this is because the options are not available in the area in which you are in. The options at the top of this box are only available if you access the Page Setup dialog box via the File menu as mentioned above.

The only options we need to look at here are the ones under Print.

### Print

If you select Gridlines the gridlines of your Excel Worksheet will print.

If you select Black and White, your data will be printed in Black and white only (if you have colour in it, it will appear as grey shading).

If you select Draft Quality your data will be printed in draft quality.

If you select Row and Column Headings then the row and column headings (A, B, C, 1, 2, 3 etc) will be printed.

### Page Order

You have two options here; Down then Over and Over then Down. Selecting one of these options will control the way data is numbered and printed when it does not fit on one page.

Let us select OK now to return us to Print Preview mode to have a look at our nearly ready to print Worksheet.

You will notice that you can now see the Header and Footer that we placed in our Worksheet.

Now hit your Next button and you will notice that the row that appears at the top of page 1 (Jan, Feb, 1st Quarter etc) does not appear at the top of page 2. We can easily change this by doing the following.

•  Press your Close button to close you out of your Print Preview mode and return you to your Worksheet.

•  Now with your print range still selected, go to File>Page Setup>Sheet.  You will notice in here that the top half of the box is now NOT greyed out, so all options are accessible. The top option Print Area allows you to select the range that you wish to print if you have not already done so. We have already selected our print area, so we do not need to use this option in our printing.

•  We need to go to Rows to Repeat at Top under Print Titles. Let us press the collapse box (red arrow) to the right of this box, to collapse the dialog box and enable us to select the row we wish to repeat.

•  All we need to do now is to select somewhere in row 3. This will place the reference \$3:\$3 in the Rows to Repeat at Top box.

•  Press    your      collapse            box       button   again    to         expand the        box.

You will note the option here Columns to Repeat at Left. This works the same as for rows, except it will repeat the selected columns on each page. You can also note here that under the heading Print there is an option called Comments. This option is only available if you select your Page Setup dialog box via the File menu and is used to print what are known as Comments (discussed in Excel – Level 2)

•  Select OK

•  Now we are happy with our Worksheet, we can print it by selecting the Print button in Print Preview mode.

Once a document has been saved with it’s print settings, you only need to press the Print icon on the

Standard Toolbar to print. This will by-pass Print Dialog box and send your Worksheet straight to the printer.

As we stated at the beginning of this lesson, printing is an essential part of Excel. Even in these days of a paperless office, we need to be able to efficiently present data that people can understand and use to it’s fullest capacity.  Our personal preference is to use Print Preview first to set up how a worksheet would look, although you need to be aware that not all options in the Page Setup dialog box are available to you by doing it this way. You can access the Page Setup dialog box via the File menu and have all options discussed here available, but at the end of the day, it is up to you which way you use.

### Printing Workbooks

If you have quite a few Workbooks to print, go to File>Open from within Excel, select the Workbook(s) uisng the Ctrl key, then right click and choose Print.

Got any Excel Questions? Free Excel Help

## EXCEL SORTING

Data sorting is an extremely handy and versatile feature within Excel. The sorting feature is found by going to Data>Sort to access the Sort dialog box. Generally, sorting is performed on a list, which is defined as a contiguous (no blank cells) group of data where the data is displayed in columns and/or rows. Excel allows you to sort Worksheet data alphabetically, numerically or chronologically. You can sort by columns, by rows, in an ascending or descending order and from left to right. When you sort within Excel, it will rearrange the contents of the sort area according to the instructions that you give it. Excel will always sort blank cells to the bottom of a list.

There are a few basic rules that you need to follow when setting up your list in the first place. These are:

•  Check that any numbers in your spreadsheet are in a numerical format.

•  Cells containing both text and numbers need to be formatted as text.

•  Dates and times must be formatted correctly.

•  You must unhide any hidden rows or columns (we will cover hiding rows and columns later in this lesson).

•  Make sure you have no leading spaces. This can happen when you push your Space bar before typing into the cell.

•  Enter column labels in one row (use Alt + Enter to put a hard return in if you need to) or use the Orientation feature under Format>Cells-Alignment.

Excel has specific sort orders to arrange data within your Worksheet according to the value (not the format) of the data. If you performed an ascending sort, numbers would be sorted from the smallest negative number through to the largest positive number. If you performed a descending sort, numbers would be sorted in reverse.

### Sorting Alphanumeric Text

If you performed an ascending (lowest to highest) sort on alphanumeric text, Excel will sort your data from left to right, character by character. For example, if a cell contained the text B200, Excel will place the cell after a cell that contains the entry B2 and before a cell that contained the entry B22.

Text that includes numbers and normal text are sorted in the following order:

0 1 2 3 4 5 6 7 8 9 (space) ! " # \$ % & ( ) * , . / : ; ? @ [ \ ] ^ _ ` { | } ~ + < = > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Apostrophes (') and hyphens (-) are ignored, with one exception; if two text strings are the same except for a hyphen, the text with the hyphen is sorted last.

If you are sorting logical values, FALSE will always be sorted before TRUE and if you are sorting error values, they are all equal. We will be covering logical values in the last lesson when we look at the IF function.

As a tip, although it is not really necessary with the fabulous and very handy Undo feature, it is a good idea to save your Workbook prior to performing a sort, just in case.

Let’s have a go at performing some different types of sorts.

### Single Column Sort

•  Open the Workbook Data

•  Make sure you are on the Sorting with Text sheet tab.

•  Click in cell D5.

•  Go to Data>Sort to display the Sort dialog box. You will notice here that when you do this, your list will be highlighted (not including the headings). This is, because you are clicked in a cell within the list, Excel will search in all directions from your active cell for the end of the list. The end of the list is deemed to be the first blank cell encountered in all directions, up, down, left and right. If you manually highlight your data and Excel sees there is data immediately to the left, right, top of bottom Excel will ask if you wish to include the data.

•  Notice in the top box Sort By you have the column heading Staff Payroll No. displayed.

•  Click the drop down arrow to the right of the Sort By box and you will see the other column headings from your list.

•  We wish to leave the default Last Name as our choice as this was the column that we have clicked in.

•  Ensure the Ascending option box is ticked.

•  At the bottom of the Sort dialog box under My List has make sure that Header row is selected. If you had No header row selected, Excel would include the headings in your list as part of the sort operation.

•  Click on OK to sort your data by Last Name

You will notice now that the Last Name column is sorted in alphabetical order, from the lowest value to the highest value.

Let’s reverse the order from Ascending to Descending.

There are two ways you can do this.

•  Stay clicked in cell D5.

•  Go to Data>Sort to display the Sort dialog box.

•  Ensure the Descending option box is ticked.

•  Click on OK to sort your data by Last Name in Descending order.

OR

•  Click the Sort Descending tool, which is the Z on top of the A next to a downward pointing arrow on your Standard toolbar.

By selecting this icon, you can effectively by-pass the Sort dialog box and perform a Descending sort. You will note that to the left of the Sort Descending icon is the Sort Ascending icon. If you have previously performed a sort on a list, Excel will remember the last sort that you did, but be aware that if you are uncertain of the last sort, your list data may not sort as you expect. In other words, if you are using a file or computer that is shared, it is always best to use the Sort dialog box.

### Sorting by Multiple Columns

When you perform a multiple column sort, each column is sorted one at a time. The list will be sorted by the first column then Excel will check each of the entries to see if there are duplicates. If there are, then the duplicates will be sorted by the second column and so forth.

•  Click in cell E5.

•  Select Data>Sort to display the Sort dialog box.

•  Click on the drop down arrow to the right of the Sort by: box to see the other column headings.

•  Click on Department.

•  Select the Ascending option.

•  Select the drop down arrow to the right of the Then By: box.

•  Select Last Name from the list.

•  Select the Ascending option.

•  Click on OK

Now you have performed a sort on more than one column, let us have a look at sorting numbers. These will work just as efficiently as text when performing a sorting operation.

### Sort by More Than 3 Columns

Excels sort feature only allows to nominate up to 3 columns to sort by, here is how to get around this. The key to this is sorting by the last key first and working back to the first key. Say you data is in Column A:E and you want to sort by A, B, C , D then E

1.  Select all of Columns A:E

2.  Go to Data>Sort> sort by C then by D then by E

3.  Click Sort

4.  Now again with Columns A:E selected

5.  Go to Data>Sort> sort by A then by B

6.  Click Sort

### Sorting Numbers

Let’s find out which Department generated the most income during the month of June.

•  Click on the Sorting with Numbers worksheet tab.

•  Click in cell G5.

•  Select Data>Sort.

•  Ensure that the Sort By box has June in it.

•  Select Ascending order.

•  Select OK

•  Now click in cell A5 and we will sort the list by Departments

As you can see, sorting is a very simple operation to perform with either text or numbers. You can also sort from left to right in rows, this is a little trickier, but you will find it a very handy feature to know. Let's have a go at performing a left to right sort on our Sorting with Numbers Worksheet.

•  Highlight the range B5:G12. Quick way – click in B5, move the mouse over cell G12, hold down the shift key and press your left mouse button – quick and easy

•  Go to Data>Sort to display the Sort dialog box.

•  Click on the Options button to see a list of options available to you.

•  Under Orientation select Left to Right.

•  Click on OK to return you to the Sort dialog box.

•  In the Sort by box, click on the downward pointing arrow to the right and select Row 12.

•  Click OK

As you can see, sorting, once mastered, can be a huge benefit to a user. Remember to set up your data in a list. That is with column headings (defined in some way, such as bolded and centered) and without any blank cells, rows or columns. If you don’t, your sorting operation can turn into a nightmare!

Remember the very handy undo key that you can use if you make an error, however, it is a good habit to get into to save your Worksheet first before performing a sort.

## HIDE/SHOW ROW/COLUMNS IN EXCEL

A very handy feature of Excel is its ability to hide rows and columns from a user without it affecting calculations in any way. This can be handy if you wish to hide calculations or certain information from a user. Hiding rows or columns can be performed in two ways, by selecting the row or column you wish to hide and going to Format>Row (or Column) >Hide or by selecting the row or column that you wish to hide, right clicking and selecting Hide

Let’s have a look at this now.

•  On a new Worksheet, click in B2 and type 100. In C2 type 100, in D2 type 100, in E2 type 100, in F2 type 100

•  Click in G2 and use the AutoSum feature on your Standard Toolbar to sum the range B2:F2

•  Select the entire column D by selecting the column reference (the D with the grey background).

•  Go to Format>Column>Hide.

•  You will notice now that column D has disappeared, but the result of your formula, 500 has not changed. This is because you have only hidden the column, not deleted it.

Lets unhide the column now.

•  Highlight the entire columns C and D go to Format>Column>Unhide

•  Notice that you have now unhidden column D

As mentioned above, you can also perform the hide/unhide operation by right clicking and selecting either Hide or Unhide from the shortcut menu. This is my preferred option, but it is up to you which one you use.

Lets have a go at hiding some rows, using the right click option.

•  In B3 type 100, in B4 type 100, in B5 type 100, in B6 type 100, B7 type 100

•  In B8 use the AutoSum feature to sum the range B3:B7

•  Now select the entire row 3 by selecting the row reference.

•  Right click and select Hide

•  Select the entire row 5 by selecting the row reference.

•  Right click and select Hide

You should now have two rows hidden, but your formula result will still be 500.

Lets unhide the rows now.

•  Highlight rows 2 to 7

•  Right click and select Unhide

You can also hide sheets using Format>Sheet>Hide. You need to be aware that the right click option is not available if you wish to hide a sheet. You must do it via Format>Sheet. As with hidden rows and columns you can still reference the hidden sheet via a formula and have it return the correct value. Of course though it is wise to reference the sheet while it is visible and use the mouse pointing method to build your reference and then hide it.

If you go to Format>Sheet>Hide and the UnHide is greyed out this means there are no Worksheets hidden within the Workbook. If there are sheets hidden the Hide will not be greyed out and selecting it will display the Unhide dialog box. Within this box will be the names of all hidden sheets, to unhide one simply select the sheet name from the box and clicks OK or double click it (the sheet name).

## EXCEL AUTO-FORMATTING

Another very handy feature of Excel is it’s ability to use its built-in AutoFormats on your data, and the flexibility that you have in changing these to suit your personal taste. There are many AutoFormats available to you and they are found under Format>AutoFormat. Lets have a look at how this would work with our previous Workbook Data Sorting.

•  Open the Workbook Data Sorting

•  Click on the Sorting with Text sheet tab.

•  Click on cell D5 or any other single cell within your list.

•  Select Format>AutoFormat and the AutoFormat dialog box will pop up in front of you. Note here that as when doing a sort operation, Excel will automatically highlight your whole table for you (it will only do this if there are NO blank columns or rows).

•  Scroll through the list of formats available to you using the vertical scroll bar, or you can use the arrow keys on your keyboard if you prefer.

•  Select List 2 by clicking on it, then select OK

You should note that if you select more than one cell before going to Format>AutoFormat Excel will assume you only want to format the selected cells and not any surrounding data.

By using the Options button on the AutoFormat dialog box, you can make many more formats available to you. The options available to you through this button will be Number, Border, Font, Patterns, Alignment, Width/Height. Note however, that by default all options are selected, which means that all current formatting in your selected table or range will be overridden by the AutoFormats. By deselecting certain options, you will have the ability to go back into your range or table and manually apply the format attributes you have unchecked in the Formats to Apply box. However, we suggest only doing this if really necessary.

•  Make sure you are still selected somewhere in your data.

•  Go to Format>AutoFormats.

•  Select Options.

•  You will notice that the AutoFormats dialog box has now expanded to include Formats to Apply

•  Uncheck the Number option and see how the numbers now look. You will notice the most changes in the Accounting formats (Accounting 1, Accounting 2, Accounting 3, Accounting 4).

•  By unchecking the Border checkbox, you are removing the outline of the cells as shown in the AutoFormats preview window.

•  By unchecking the Font checkbox, you are unchecking the attributes to the font that are applied to the AutoFormat which basically includes font size, font type, colour and bolding, italics etc.

•  By unchecking the Patterns checkbox you will remove the background colour and/or any patterns that may be applied.

•  By unchecking the Alignment checkbox you will change the alignment of your text or number within the cells.

•  By unchecking the Height/Width checkbox you are changing the height and width of the columns and rows. Basically, having this option checked means that your columns and rows are set to AutoFit, which is probably the best option to have.

Once you are happy with your selection, simply click OK to see exactly how your data will look.

If after applying an AutoFormat and adjusting accordingly, you decide you no longer want it, simply select any single cell within your data list, go to Formats>AutoFormats and use the scroll bar to scroll to the very bottom of the list and click None then OK

Note however, that while applying an AutoFormat to your range will override any formatting you have previously applied, removing it does not return it to its original state.

### Extend AutoFormats

By default Excel will automatically extend down any AutoFormats and manual formats. You can change this via Tools>Options - Edit and uncheck the Extend list formats and formulas

Extend list formats and formulas. Automatically formats new data added to the end of a list, or table to match the format of the rest of the list/table. Formulas that are repeated in every row are also copied. To be extended, formats and formulas must appear in at least three of the five last rows preceding the new row

Let’s look at creating and formatting a basic spreadsheet to chart the income of the various Departments within a small organization.

•  Create a new blank Workbook.

•  Click on cell A2.

•  Type in the word Department.

•  Click in cell A3 and type in Administration

•  Click in cell A4 and type in Marketing

•  Click in cell A5 and type in Finance

•  Click in cell A6 and type in Stores

•  Click in cell A7 and type in Total.  Notice here that the contents of the cells A2 and A3 spill over into cells B2 and B3. This is because cells B2 and B3 are empty. Once these adjacent cells have data in them, the data in cells A2 and A3 will appear to be cut off, although this is not really so. If you were to have a formula result that is too wide for a column, the cell would display ####. This is telling you not that your formula is incorrect, just that your column is too narrow for your result to be seen.

•  Click in cell B2 and type in the month January

•  Click back in cell B2 and using your Fill handle, fill to the right until you reach December (cell M2).

•  Click in cell B3 and type in 1000

•  Click in cell B4 and type 1500

•  Click in cell B5 and type 1750

•  Click in cell B6 and type in 2000

•  Click in cell C3 and type in 1750

•  Click in cell C4 and type 1600

•  Click in cell C5 and type 2300

•  Click in cell C6 and type in 1900

•  Now highlight the range B3:C6 and using your Fill handle, fill right until you reach December (column M).

•  Let’s put in the totals in for the months now, by clicking in cell B7, selecting the AutoSum icon (the backward Z on your standard toolbar) , then Enter

•  Click back on cell B7 and using your Fill handle, fill the AutoSum formula to your right until you reach column M (December).

You will notice now that the Department names in cells A2 and A3 appear to be cut off, and the month September in J2 also seems to be cut off. If you click in either of these cells, you will note that the whole cell entry is still there as you can see it in your formula bar. Let’s have a look at quickly best-fitting the width of these columns, so we can see their whole contents.

There are a few different ways to best fit a column. You can go via the Format>Column option on your Worksheet Menu Bar, following this method you can see the options available to you to widen or shorten your columns, or you can double click between the column references on your Worksheet. Let’s try this as this is by far the easiest and quickest way of best-fitting a column.

•  Wave your mouse on the cell border between the A and B column heading (black writing, grey background) until your mouse changes to a black cross with a left and right pointing arrow.

•  Double click with your left mouse button.

•  Now wave your mouse pointer on the cell border between J and K until your mouse changes to a black cross with a left and right pointing arrow.

•  Double click with your left mouse button.

Pretty simple hey!!! If you wanted to stretch or shorten your columns, you could wave your mouse over the desired the column borders until it changes to a black cross, then holding your left mouse button down, drag either left or right to widen or shorten your column.

The same technique will work for widening rows, except that when you wave your mouse over the row border, the black arrow with the left and right pointing arrows will change to a black arrow with an up and down pointing arrow.

Let’s pretty up our Worksheet just a little now by using some basic formatting techniques.  We will not go into this too deeply, as we stated earlier in the course, we believe it is far more important to get the “guts” of the spreadsheet correct, rather than having a pretty Worksheet that does not come up with the goods, so to speak!  We will use some of the options on the Formatting toolbar in this case.  Note that all of these options are available via the Format option on the Worksheet Menu Bar.

•    Highlight the range A2:M2

•    Click the on the B on the Formatting Toolbar. This is your bold key and will bold our highlighted text.

•    Although we have stated before that it is easier to work with text and numbers that are aligned correctly (that is numbers to the right and text to the left of a cell), if you were required to centre them for “looks” sake, you can do so easily.

•    Keep the range A2:M2 selected and select the Center icon on your Formatting toolbar. This will center the contents of your cell. The Center icon is normally four icons to the right of the Bold icon. Remember to wave your mouse over an icon to see what action it will perform if selected.

•    Let us now select the range A7:M7 and bold the totals of the months by selecting the B on the Formatting Toolbar.

•    Now highlight the range A3:A6 and select the I on the Formatting toolbar. This is your “italics” key and will italic the Department names for us.

Let’s give our numbers a dollar value now.

•    Highlight the range B3:M7

•    Select the \$ icon from your Formatting Toolbar.

You will notice that column L is full up with #####. Best fit this column using the technique described above.

When you give a range a dollar value within Excel, it, as a default, will place two decimal places within your cell.  To remove them do the following:

•    Select the range B3:M7

•    Click on the Decrease Decimal Spaces icon on your Formatting toolbar. This is the icon with the .00 and .0 and a blue right pointing arrow on it. If you click it once, you will remove one decimal place, and if you click it again, you will remove the next decimal place.

•    Let us now put a heading on our table. Click in cell A1

•    Type in CY2004 INCOME and click Enter

•    Now click back in cell A1

•    Highlight the range A1:M1

•    Now select the Merge and Center icon on your Formatting toolbar. This will merge and center the words CY2004 INCOME across the cells that you highlighted.

Note here that it is NOT a good idea to use Merge and Center on anything that you may wish to use in a calculation. My advice is to use it to format a heading only. You will run into all sorts of problems if you try to do calculations with a merged cell(s).

Let us now bold our heading and change the font size and cell alignment.

•    Click in cell A1 (note here that your range A1:M1 has now all become cell A1 as indicated by the Name Box.

•    Now change the font to a font of your choice by selecting the appropriate font name from the Font drop down box to the left of the bold icon on your Formatting Toolbar.

•    Once you have selected a font, change it’s size to 26, by selecting this number from the Font size box (located immediately to the left of the bold icon on your Formatting Toolbar, and to the right of the Font Name Box).

Now let’s put some borders on our data.

•    Select the drop down arrow to the right of the Borders icon on the Formatting Toolbar. As a default, the borders icon is the third from the left on your Formatting Toolbar.

•    Select the icon named All Borders with your left mouse button.

If you wished to use different types and widths of lines for your borders, or change the colours of them, you will need to do this via the Format>Cells/Borders option which has a much wider range for you to choose from

In this day and age charts are widely used in business to represent data in another way apart from just digits in a Worksheet. Charts can add colour and style to a presentation and allow the reader to easily identify the trends and patterns that you may wish to relay. Charts can be created in a number of ways, but if you have never created a chart before, the Chart Wizard within Excel is probably the best way to start. It will walk you through the process of setting up a chart prompting you for the information that you need to complete the process. Once you have created your chart, it can very easily be modified to suit your particular taste or needs. The data we will use for our chart is as described in the Previous Lesson.

OK, now we are ready to create our chart. We will only create a basic chart in this lesson, as we go into much more detail during the Excel – Level 2 training course.

Creating a simple chart is easily done by following these steps.

•  We should firstly save our file we created in the previous lesson, so let’s do that now and save it as

•  Highlight the range A2:M7.

•  Select the Chart Wizard icon (the one with the blue, yellow and red bars on the Standard Toolbar.

•  The Chart Wizard dialog box should pop up in front of you and you should be on Step 1 of 4. Notice here the different categories of charts available to you under the heading Chart Type: to the left of the dialog box. To the right of the dialog box are the different chart sub-types. If you wanted a preview of how your data would look in different types of charts, click on the particular chart that you like and click the button Press and Hold to View Sample with your left mouse button. This will give you a basic preview of how your data will look if that particular type of chart were selected.

•  We are actually going to select Column under Chart Type: and we want to have the first subtype selected under Chart Sub Type

•  Select the Next button to move on to Step 2 of 4 of the Chart Wizard.

•  You should have the Data Range sheet tab in front of you. We need to make sure that Rows are selected under Series In:

•  Select the Next button to take you to Step 3 of 4 of the Chart Wizard

•  Step 3 is where you would put in a title to your Chart, so let’s type CY2004 Income in the Chart Title box.

•  Under Category (x) Axis type the word Months. Your X axis is defined as the horizontal axis at the bottom of a chart.

•  Under Category (y) Axis type the word Dollars. Your Y axis is defined as the vertical axis to either the left or right (or both) or your chart.

•  We don’t need to make any further changes in our simple chart, so lets select the Next button to move on to the final step of the Chart Wizard dialog box.

•  In Step 4 of 4 of the Chart Wizard you have two choices. You can select either As a New Sheet, which will place your graph on a new Worksheet and call it Chart1 (you may change this name if you wish), or you can select As an Object In which will place your graph over your data as an object that you can move to its desired location. We are going to select As a New Sheet and Type CY2004 Income where it currently says Chart1.

•  Click Finish.

Your chart should be produced on a separate Worksheet called CY2004 Income. They really are very easy to create and just as easily they can be modified. One thing of great importance to note with charts is that if you change your source data, your chart will update to reflect these changes.

If you wish to modify any part of a chart, you need to select that particular part, then double click to see the options available to you in the particular area that you have selected. For example if you double click on the maroon bars, you will see the option Format Data Series where you can change the colour of your bars, Chart Type where you can change the type of chart you have selected, ie from a bar chart to a pie chart, Source Data which is where, if you wanted, you could change your source data. Add

Trendline which obviously will give you a trendline, and Clear which when selected will delete the particular series you have highlighted.

Let’s have a look at creating a simple pie chart from non-contiguous data (data not joined together) now. This is done in much the same way as charting from contiguous data.

Let’s chart the Total Income for the year by Department

•  Click in cell N2.

•  Type the word Total.

•  Click in cell N3 and select the AutoSum icon from the Standard toolbar, then select Enter

•  Click back in cell N3 and then using the Fill handle, fill down to cell N7

•  Format the Total column so that its formatting is the same as the rest of the table.

•  Click in cell A3 and select the range A3:A6

•  Holding down your Ctrl key, select the range N3:N6

•  Select the Chart Wizard icon from your Standard Toolbar.

•  Select Pie under Chart Type and select the second pie chart under Chart Sub-type

•  Click the Next button to take you through the Wizard to step 2.

•  No changes to make here, so lets select the Next button to move on to step 3.

•  Under Chart Title type in the heading CY2004 Income by Department

•  Select the Next button to take you to the 4th and final step of the Chart Wizard

•  Let’s select As an Object In, then select Finish

You now have a pie chart embedded in your data as an object. This chart can be moved or sized easily. If you wish to move an object, click inside the object (in this case a pie chart) so that it becomes active. You will know it is active when you see 8 handles (squares or circles depending on which version you are using) around the edge of the pie chart. If you then hold your left mouse button down until your mouse pointer changes to a cross with four arrow heads, you can move your pie chart to it’s desired location.

You can also change the size of it easily, by selecting any of the 8 handles around the outside of your object until your mouse changes to a double headed arrow, then drag in the desired direction. Note here that if you select a corner handle, your object will be sized relatively, in other words the width will change relative to the height and vice versa as you drag.

Pie charts can be modified in exactly the same way as all other charts, by double clicking to select the part of the chart you wish to modify.  Note as with all other charts, if you make a change to your source data, your pie chart will update to reflect the changes

## WORKSHEET PROTECTION

In this day and age of computers where we now have many files that have multiple users, you can protect all or part of a Workbook easily. Protecting Workbook data makes it very difficult for specific cell values to be changed, either accidentally or deliberately. Some reasons for protecting your data could be:

•  To direct others to specific cells that they can input into by making it impossible for them to enter data anywhere else on a Worksheet.

•  To prevent accidental deletion, or modification of essential values within a Worksheet that may be needed to perform specific calculations.

•  To prevent accidental deletion, or modification to essential and sometimes very complicated formulas within a Worksheet.

Worksheet protection is a very valuable and useful tool, but using it can sometimes seem a little confusing, as there are actually two separate processes that must be followed to protect data.

The first step is to unlock any cells that will require editing. The second step is to apply Worksheet Protection.

### Enabling Worksheet Protection

Let’s have a look at how we would apply Worksheet protection to the file that we used previously, and how we would unlock the December figures for each Department, so that they can type their own figures in there.

As a default, all cells within Excel are locked by default. However, you can still change or edit these cells because the Worksheet or Workbook is unprotected. The first step to using data protection is to unlock the cells that need to be changed when we apply Worksheet Protection.

•  Open the file if it is not already open.

•  If you need to, move your pie chart out of the way using the technique described above so that you can see the range M3:M6

•  Highlight the range A3:A6 with your mouse, then go to Format>Cells which will display the Format Cells dialog box, and select the Protection tab.

•  You have two options within this box. The first option Locked, if selected, will prevent a user from changing, moving, resizing or deleting the selected cells. The second option Hidden, if selected, will hide the formulas within your Worksheet so that if a cell containing a formula is selected, you will not be able to see what the formula is in the formula bar. Let’s select the Locked option until it appears without a tick., then click on OK to unlock our selected cells (M3:M6).

Now we have unlocked our cells, we can apply Worksheet Protection to our data.

•  Select Tools>Protection/Protect Sheet and the Protect Sheet dialog box will appear.

•  Depending on which version of Excel you are using, the options may be slightly different in the Protect Sheet dialog.  We do not wish to use a password at this stage, and we will just accept the defaults as they are in this case, so just click OK

OK, let’s have a go at using our protected Worksheet.

•  Click in cell L3 and type the number 1234. You will notice that as soon as you start to type, Excel will display a message that tells you the cell or chart you are trying to change is protected and therefore read-only.

•  Now click in cell M3 and type 1234, then Enter. This time your entry will be allowed, as would any entry that you typed in M4, M5, or M6

You will note that when you make a change to either M3, M4, M5, or M6, that the formula in M7 will update. This is because locked cells that contain formulas will still change in accordance with the data that is used to calculate them.

### Disabling Worksheet Protection

You can unprotect a Worksheet in the same way that you protected it in the first place.

•  Go to Tools>Protection.

OK, so we have looked now at Worksheet Protection.  However anyone with a working knowledge of Excel, could figure out how to unprotect a sheet if they wanted to, so Excel offers you the ability to use a password to protect your Sheet. Passwords are case-sensitive. One thing you MUST be aware of when using a password is that if you lose or forget your password, it cannot be recovered, so it might be a good idea to write down your passwords somewhere and the Worksheets that they relate to and store them in a safe place.  It is also a good idea when using a password to use a combination of letters, numbers and symbols.

•  Select Tools>Protection/Protect Sheet

•  Click in the Password box and type in the word password then click OK

•  Now click in N3 and type in 1234 as before you cannot make a change here, and a message box will pop up telling you so.

•  Now click in M3 and type in 5678 and click Enter. As before, no warning will appear and you are able to change cell M3

Let’s try and unprotect our sheet now.

•  Select Tools>Protection/Unprotect Sheet

•  You must now type in the correct password for your sheet to be unprotected. Type in the word passwording, then click on OK

•  You will get an error message from Excel advising you that the password that you typed is incorrect. You will also get a hint from Excel, that maybe the caps lock key could be on, just in case you have typed the right password in the wrong case.

•  Click on OK and we will try again.

•  Select OK and your Worksheet will now be unprotected again.

So remember, if you want to use the Protect facility, you must remember to unlock the cells that you wish to be changed before your apply sheet protection. You can protect a Worksheet with or without a password, but remember that the password does not prevent access to the data, but instead prevents the worksheet being unprotected. Once the protection system is in place, it is impossible for a user to edit, change or delete the contents of a locked cell.

If you try, Excel will display a message advising you of this.

## IF FORMULA

The IF Function is categorised under the Logical category in the Insert Function dialog box (Note:  In earlier versions of Excel, this was known as the Paste Function dialog box). While its uses can vary greatly, the structure of the Function itself is very simple, in that it will return either TRUE or FALSE. This is certainly the most important aspect of this Function.  More often than not, the use of the IF Function is reserved for Level 2 in Excel and beyond. It is however our belief, that it should also be a part of Level 1 as its use is so versatile, but more importantly its structure is an excellent introduction into the logic of Excel and formulas.

### When to Use IF

The IF Function can be used whenever we wish to have the ability to return a particular result that is dependant on another. For example we may want a formula to SUM a range of cells if the value of a particular cell is greater than 100, but if the value of this particular cell is less than 100 we may wish to perform another calculation altogether. This is often referred to as the What-If analysis.  What if this were that value or what if this was another value? While the IF Function can be used on its own, it is often combined with another Function. This combining of Functions in Excel is what is known as Nesting

### What is Nesting

The term nesting in Excel means using the result of one Function as the argument of another. As you may recall, most (not all) of Excels Functions take what are known as arguments. The SUM Function can take up to 30 arguments. These arguments must be number(s), a reference to number(s) or a text value,

e.g. "20". The numbers that are used for one or more of these arguments could be derived from the result of another Function, if they were, it could be that we have nested another Function or Functions as the argument for the SUM Function.

Lets use a simple example to see how this works. Assume we have two columns of numbers, one column of numbers is within the range A1:A10 and the second column of numbers is within the range B1:B10. Now assume we need to find out the SUM of the largest numbers in each of these columns. To do this we could nest two MAX Functions (MAX is the Function used to find the largest number in a range) into the SUM Function, as shown below.

# =SUM(MAX(A1:A10),MAX(B1:B10))

What we have done here is nested two MAX Functions within the SUM Function. The reason it is considered nested is because the result of MAX(A1:A10) is used as the first argument of the SUM Function and the result of MAX(B1:B10) is used as the second argument of the SUM Function. The Functions in their entirety makes up a formula!

In case you have forgotten the syntax for the SUM Function is  SUM(number1,number2,…..) and up to number30.

So in the above example we have used MAX(A1:A10) as number1 and MAX(B1:B10) as number2.

You will probably find the hardest thing about nesting Functions is knowing where to place all the parenthesis. Thankfully we can have the Insert Function dialog box do this for us! Lets use the nested SUM and MAX Function to see this.

•  Place the number1 in cell A1, 2 in A2, 11 in B1 and 12 in B2.

•  Now highlight cells A1:B2 and use the Fill Handle to drag down to row 10

•  This should give you 1 to 10 in A1:A10 and 11 to 20 in B1:B10

•  Now select cell C10 and push Shift + F3 to display the Insert Function dialog box.

•  Select Math & Trig from Or Select a Category: and SUM from the Select a Function: box and click OK

•  You will notice that Excel has assumed we want the range A10:B10 as our number1 argument. This is wrong in this case, so delete it.

•  If you look to the immediate left of the Formula Bar you will see a box where the Name Box is usually placed with SUM written on it and a drop arrow on its right. Click this arrow!

•  You will see a list of the last 10 used Functions. Click More Functions… and our Insert Function dialog box will display again.

•  Select Statistical from the Or Select a Cateogry: and MAX from the Select a Function: box and click OK

Our SUM Function will now have been replaced with the MAX Function. If you look in your formula bar you will see =SUM(MAX(A10:B10))

•  So Excel has already nested the MAX Function as the first argument of the SUM Function. Which is what we want, but the range is wrong, simply delete it.

•  Click the collapse dialog button on the right of the number1 argument box and highlight range A1:10 and then click the expand dialog button.

•  Now we have the range A1:A10 as the first argument of the MAX Function and the result of this MAX Function is being used for the first argument of the SUM Function.

•  What we need to do now is use another MAX Function as the second argument of the SUM Function. This means we have to activate the SUM Function again, at the moment the MAX Function is the active Function.

•  To do this simply click on the word SUM within the Formula bar, and you will see:

=SUM(MAX(A1:A10)) and the SUM Function will again be the active Function.

•  Click within the number2 argument box and then to the left of the name box you will see the MAX Function, click on this. If it does not say MAX simply click the drop arrow and select MAX

•  This will place the MAX Function into the number2 argument of the SUM Function and in the Formula bar you will see =SUM(MAX(A1:A10),MAX(A10:B10)) . Delete the A10:B10 and then using the collapse dialog button and highlight the range B1:B10 and click OK

You should now have the formula: =SUM(MAX(A1:A10),MAX(B1:B10)) and the result of 30. This same principle applies to any Functions that we need to nest together.

There are two rules that apply whenever we nest Functions and these are:

•  The Function that we nest within the argument of another Function must return the data type expected by that argument. This means we could not use a Function that only returned text as the argument of a Function that can only accept numeric values.

•  We can only nest Functions up to seven levels deep. This is explained quite well in the Excel help under: About multiple Functions within Functions, or nesting as it is what we have discussed above.

By now you are probably asking yourself "what has this to do with the IF Function?"  We have used the above example as a sort of primer as we have discussed the SUM and MAX Function before. The other reason is that the IF Function very often has other Functions as its arguments, in other words it is very common to nest Functions when using the IF Function. But before we do nest another Function within it let’s look at the IF Function itself.

# IF

The IF Function, as mentioned above, can be found under Logical in the Or Select a Category: area of the Insert Function Dialog Box. The syntax of the IF Function, is as shown below:

=IF(logical_test,value_if_TRUE,value_if_FALSE)

In a nutshell, the IF Function returns one value if a chosen condition is TRUE and another value if a chosen condition is FALSE. As you can see by the syntax, the IF Function can take three arguments. But it only requires the logical_test argument and at least one of the other two; that is value_if_TRUE or value_if_FALSE. While it may seem a bit confusing by looking at the syntax for the IF Function, it really is a very simple formula to use and apply once you have a basic understanding of it.

Lets use a small example to demonstrate what I mean.

•  In cell A1 type the number1.

Click in any other cell and type =IF(A1>0,2) and push Enter

You will get the result of 2. The reason why we are getting the result of 2 is simply because our first argument, (logical_test which is A1>0) is TRUE and so our IF Function is evaluating to TRUE and so returns the argument for value_if_TRUE which is 2. So in plain English, we are saying IF cell A1 contains a value greater than 0, return the value 2. So in this instance, we have used two of the three arguments for the IF Function. The next logical question should probably be “what value will be returned if cell A1 does not have a value greater than 0?” The easiest to see what value it would return is to:

•  Type the value –1 in cell A1

Your IF Function now should be returning the word FALSE. The reason it is returning FALSE, is simply because our logical test no longer evaluates to TRUE, but to FALSE and as we have not supplied an argument for the value_if_FALSE Excel will by default use the word FALSE

Let’s now go in and edit our IF Function and make it return another value other than FALSE. The way we show you how to edit the IF Function here, can be used on any Function and is an easy way to Edit Formulas and also troubleshoot them.

•  Click in the cell that contains the IF Function.

•  On the Formula bar, wave your mouse pointer over the Fx sign to the left of your Formula baruntil the words Insert Function appear in a Tooltip.  (Note:  The Fx sign may be an = sign in earlier versions of Excel.  If so the words Edit Formula will appear instead of Insert Function)

•  Simply left click on the sign and Excel will automatically display the IF Function dialog box.

•  Using this dialog box, we can now type in a value for our IF Function to return if our logical test is FALSE.   Before you do, if you look down the very bottom of this dialog box, you will see the words Formula result = FALSE

•  Type the number 5 in the Value if FALSE argument box and this should immediately change to say Formula result = 5.  It is not necessary for our Value_if_TRUE or our Value_if_FALSE argument to return a numeric value. We can, if we wish, have it return text or even an entire sentence if we wanted.

•  Click in the Value_if_TRUE argument box and type Yes

•  In the Value_if_FALSE argument box type No

•  Click the OK button.

You will now see that by changing the value in A1 to values less than and greater than 0, your IF Function cell with return either Yes or No to reflect the change.

This is basically all there is to the IF Function, it will do one thing if a logical test is TRUE and another if it is FALSE. Obviously, the example we have used here would be of no practical value to anybody.

So let us now use a more realistic example and also incorporate what we have learnt about nesting.

•  Place the numbers 1 - 10 in cells A1:A10.  We will assume that if the SUM value of these 10 numbers exceeds 100, we would like to return the actual SUM value of the numbers. If on the other hand the SUM value does not exceed 100, we would like to return only the MAXIMUM number within the range.

•  Click in cell A11, push Shift + F3

•  Click Logical within the Or Select a Category: area.

•  Click IF within Select a Function: and click OK

•  Ensure your mouse insertion point is within the Logical_test argument box.

•  Click on the small drop arrow to the left of your Formula Bar. This is where the Name Box would normally be.

As we have used the SUM Function previously, it should be part of the list already. But if not, simply click More Functions and locate it from within the Math & Trig area under Or Select a Cateogry: and click OK

•  By default Excel should automatically have selected the range A1:A10 for you as the first argument of the SUM Function. If not, click the collapse dialog box button highlight the range A1:A10 and click the expand dialog box button.

•  If you now look in your formula bar you should have =IF(SUM(A1:A10))

•  Now click back on the IF within the Formula bar to activate our IF Function again, and we should have for our logical_test SUM (A1:A10). At present the logical_test will be evaluating to TRUE

•  Within the logical_test argument box, click immediately to the right of SUM(A1:A10), so your mouse insertion point is immediately outside the closing parenthesis.

•  Simply type > 100. Now our logical test will evaluate to FALSE

•  Click within the Value_if_TRUE argument box and select the SUM Function again from the box immediately to the left of your formula bar. Again, by default, Excel will automatically place SUM(A1:A10) so within your Formula Bar now, you should have =IF(SUM(A1:A10)>100,SUM(A1:A10)).

•  Again activate the IF Function by clicking on the word IF in the Formula Bar and you will see we now have SUM(A1:A10) in the Value_if_TRUE argument box.

•  Click in the Value_if_FALSE argument box, click the drop arrow to the left of the Formula bar and select MAX. If it is there, it not select More Functions and locate it under the category Statistical

•  Again, by default Excel should automatically use the range A1:A10 as the first argument for the MAX Function.

•  If you now look in the Formula Bar, you should see

# =IF(SUM(A1:A10)>100,SUM(A1:A10),MAX(A1:A10))

Looking at the formula like this is certainly not very easy to read, let alone decipher what its intention is. By far the easiest way to find out what it is supposed to do is to again activate the IF Function by clicking on the word IF in the Formula Bar. Then looking at the structure of the Formula like this, you should see quite clearly what its intention is. Click the OK button.

In plain English, you could say that the formula reads:

If the sum of A1:A10 is greater than 100 return the sum of A1:A10. Otherwise, if not, return the maximum number of A1:A10. The final result of our formula, of course, is 10. If you now change any one of the numbers within the range A1:A10 so that the SUM value of these numbers is greater than 100, you will see that our IF Function is evaluating to TRUE and so returns the SUM value of the numbers.

Another very common outcome of the IF Function is to use empty text as a result.  This is often used in very complex formulas (or what look like very complex formulas) and works like this:

•  Click back in the cell that contains the IF Function.

•  Click in the Formula Bar to the right of the last bracket and backspace out MAX(A1:A10)) in your Formula.

•  In its place, type in ””, so your formula now should read =IF(SUM(A1:A10)>100,SUM(A1:A10),””) • Click Enter.

•  So the logic of our formula now is If the sum of A1:A10 is greater than 100 return the sum of A1:A10. Otherwise, say nothing.

## TWO OTHER USEFUL FUNCTIONS

There are two other very useful Functions in Excel that take no arguments at all. These are the TODAY function and the NOW function. The TODAY Function will return the current date, while the NOW Function will return the current date and time. These can be very useful for a spreadsheet that requires having the current date and/or time. These functions are a bit different than most other Excel Functions in two ways.

•  They are what's known as volatile.

•  They take no arguments.

### Volatile

When the term volatile is applied to an Excel Function it means that the Function is recalculated whenever Excel calculates. To understand this we need to know how, or rather when, a normal Function in Excel calculates. Most Functions in Excel will recalculate whenever any cell on which they are dependent changes. By this we mean if we have the function =SUM(A1:A10) in a cell and we changed the value of any cell within the range A1:A10 our SUM function will recalculate to reflect the change. If there was another formula in a cell that was referencing B1:B10 then it would not recalculate if we changed a cell within the range A1:A10. A volatile Function on the other hand, will recalculate whenever any formula within the entire Workbook recalculates, regardless of cell references. A workbook will also recalculate whenever we open or save

### No Arguments

As you are now aware, most of Excels Functions take at least one argument and others take up to 30 arguments. The TODAY and the NOW Function can take no arguments at all. What this means to the user is we simply add them to a spreadsheet like:

=TODAY()

# =NOW()

In other words we enter them with empty parenthesis. As an alternative to these Functions, if you only need the current date or time then you can these shortcut keys:

Enter the date CTRL+; (SEMICOLON)

## Enter the time CTRL+SHIFT+: (COLON)

This will enter the date or time as a static value.  In other words they will not update, unlike TODAY and NOW. If you are creating a spreadsheet, try not to use too many volatile Functions as this can slow down recalculation.  As an alternative, using the NOW Function as an example, you could place the function into a cell somewhere and then reference that cell with a simple reference like: =A1

We can also control the way Excel calculates by going to Tools>Options and selecting the Calculation tab. Having said this though be very careful when doing this as you can easily inadvertently feed yourself false information. This is particularly true with the option Precision as displayed. My advice is to only change from automatic calculation if you really need to and then only if you are fully aware of the consequences

8