You are on page 1of 75

UNIT-I Introduction to Excel Excel cells are like many calculators arranged in a grid.

Each cell is capable of making mathematical calculations. The calculation can be one such as 1 + 3 or a calculation using values in other cells in the spreadsheet. Referring to other cells requires knowing how Excel refers to cells. A spreadsheet is an address grid with the grid consisting of: Columns labeled by letters A, B, C, X, Y, Z, AA, AB, AC,AX, AY, AZ, BA, BB,IU, IV for 256 possible columns. Rows labeled by numbers 116384 (Office 97 allows more rows). Cells are specified by the intersection of the column letter and row number such as F9. Ranges which are a group of cells specified by the address of the upper left cell and lower right cell separated by a full colon. Excel 2003 Screen Parts

1 2 3 4 5 6 7 8 9 Row 9 10 11 12 13 Column Range 14 A11: A16 15 16

A B C D E F G Field Name 1 Field Name 2 Field Name 3 Field Name 4 Column E Column F Column G Datum 1 Datum 2 Datum 3 Row Range B4:D4 Datum 4

Cell F9

Block range C11: E15

Designing a spreadsheet for data A field is the name of a particular type of data or a property. Design of a grade book or any other data holding spreadsheet demands planning in advance. Below is a chart depicting the structure of some of the data fields which we put in our spreadsheet.

A field is, in a spreadsheet, a column of data. Put the field names in topmost row of the worksheet. Do not have any blank rows or columns. Put the field names from left to right in hierarchical order highest on the left, lower orders to the right. The diagram above partially depicts the hierarchy for the table below.

D First Adjoa

E F

I Lang Kosraen

J K L T1 T2 T3 82 81 80

1 Course Sect Last 3 MS 101 M08 Aldis

Sx St HS Elem F P PICS PCS

2 MS 101 M08 Albert Abenaa F K KHS Lelu 4 MS 101 M08 Elidok Ama 6 MS 101 M08 Jacob Kofi

Pohnpeian 75 74 73 Kosraen 51 49 47

F C CHS Puluwat Puluwatese 93 93 93 M C CHS Iras Mortlockese 67 66 65

5 MS 101 M08 George Kweku M K KHS Malem

Data entry directly in the Gradebook worksheet Open up the Gradebook Excel workbook to the worksheet with grades on it. Scroll down to the bottom of the student list. Click in cell A31 and enter the following data: 31 MS 101 M08 Mensah Kwesi M K KHS Malem Kosraen 87 86 85 Be careful to type the number zero in both MS 101 and M08 (Monday 0800 hours) and not a capital O. After typing an entry, press the Tab key to move to the next cell to the right. To move to the cell to the left press Shift-Tab. FORMATTING Enter in the cars per household data in file carsdata.xls

Suppose we wish to give the first series a long name: CARS PER HOUSEHOLD. This yields

Only the first part of CARS PER HOUSEHOLD is displayed. The cell width needs to be increased. This can be done in one of several ways. 1. Place the cursor between shaded areas A and B at the top of spreadsheet and doubleclick. 2. Place the cursor between shaded areas A and B, click and drag to the right to increase width. 3. Place the cursor within shaded area A, click to highlight the column, right click and choose column width and make it larger. 4. Place the cursor within shaded area A, click to highlight the column and chose Format | Cells.

Methods 3 and 4 can also be used to change other aspects of cell format.

SAVING WORKSHEETS AND WORKBOOKS When you open up Excel it creates a workbook (the master document), which is composed of one or more worksheets. You should save the workbook on your diskette with a name that identifies it as your class or project workbook, e.g. for Economics 102 I might use ecn102cam, by choosing Office Button and Save As. You can save each class session and homework on a separate worksheet within this workbook. When you first open the workbook it puts you in Sheet1. You can rename this to e.g. intro by double-clicking on the Sheet1 tab at the bottom of the screen and typing intro at the rename prompt. Sheet2 might become Ass2 etc. Save results frequently.

PRINTING WORKSHEETS To save paper always do a print preview first (Office Button / Print / Print Preview). For nicer output of a worksheet you can change the column widths if need be by moving the cursor to the vertical line that separates the column headers, e.g. between A and B. This was discussed above under formatting.

For nicer output of a worksheet you can choose Page Layout tab, Scale to Fit group, click on bottom wight arrow which opens up the Page Setup dialgog box. On the Page Tab under Scaling Select the Fit to option. For example if the output is just a bit over a page in print preview then select Fit to 1 page by 1 page.

PRINTING A CHART For nicer output of charts that appear within the worksheet, move the mouse within the chart and click (this creates an additional border around the chart). Then choose Home Button and select Print and the chart is printed on a separate page.

COPY A CHART It is generally easy to copy individual charts to other software such as a word processor.

Highlight the individual chart by clicking within the chart and copy (CTRL-C) Paste special into the software you are using.

Microsoft Office software such as Word may maintain the Excel format of the chart when you read it in, so that it can later be edited. Other software will instead save it as a picture, often as a WIndows meta-file (.wmf).

COPY WORKSHEET CONTENTS AS TEXT This is particularly done to copy data from the spreadsheet into another program such as a word processor.

Highlight the area in the work-sheet to be copied and copy (CTRL-C). Paste into the word processor (CTRL-V) or other software.

This will copy data across and insert it. Interpretation of the data depends on what is copied across (e.g. data or chart) and the software it is copied to (e.g. word processor). As an example, if two columns of data are copied across they might be put into a two-column table in Word.

COPY WORKSHEET CONTENTS AS A PICTURE Rather than print nicely formatted Excel output on paper we may wish to copy it into a word processor or web page. This output may include both the data and some charts. This is a little tricky and may perhaps be deferred to a time when you really have reason to do this.

Highlight the area in the work-sheet to be copied and copy (CTRL-C). Paste-special into the word processor or other software (Edit | Paste Special).

For Microsoft Word one can paste special in a number of different formats. Choose picture which saves the file as a .gif file. This is the best way to maintain good picture quality yet use up relatively little storage space.

Save the Microsoft Word file as a Word document, or for webpage publication as a webpage or html file.

The picture itself does not appear in the file that is saved. The file that is saved instead has a reference to the picture. The picture will be saved with a name such as image001.gif. It is better to give this picture file a more meaningful name, but then you will also need to change the reference in the file that was saved. If you have Adobe Acrobat Exchange (not just the reader) another way to digitally save the Excel output is to print the Excel file to a PDFWRITER which will save the file in pdf form. Other people can then read the output using a pdf viewer such as Adobe Acrobat reader.

Data Form When a spreadsheet is designed for data the menu item Data: Data Form can be used for data entry. Select Data Form from the Data menu. Click on the New button in the upper right corner. Enter the data shown below. Use the Tab key to move to the next field blank. Do NOT use the down arrow key: it will cause the Data form to "go blank." The reason for this is because the down arrow generates a next New record.

Use of the tab key to move from one field to the next has been a standard in the data entry industry for over 30 years. The Tab key will work in Excel, Microsoft Access, and fill-in-theblank fields found on the Internet and all other data entry applications. Financial Tools Data Sorting When a spreadsheet is designed for data the menu item Data: Sort will detect the field names and offer to sort by field name. Select Sort from the Data menu. Set up your sort as follows:

Click on OK. A sort can be done on any column. When done on a test score column, sorting allows determining the high, low, and median score at a glance.

Calculating the average with the AVERAGE function In cell M1 type the characters Avg Click on cell L1, then click on the Format Painter toolbar button , and then click on M1 to transfer the field style to M1. The button may be a different color on your computer Click in the cell M2. In the cell M2 type: =average(J2:L2) The computer screen will look something like the following:

and then press enter after completing the formula. Note that there are NO spaces in a formula. The average function averages all the cells from J2 to L2. J2:L2 is called a "range." A range includes all of the cells between the cells. A range can be a portion of a row, a portion of a column, or a rectangular area of a spreadsheet.

Copying a formula down a column To copy the formula down the Avg column there are at least three methods: 1. For the mouse adept: using the fill handle

Click in M2. the small black square

Roll the cursor over the lower right hand corner of M2, directly over . The cursor should turn into a solid black bold plus

sign. The small black square is called the smart-fill control or the "fill handle". Click directly on the small black square and drag down to fill the formula down the Avg column. The farther one goes off the bottom edge of the spreadsheet the faster the scroll speed. To control the fill speed move only a tiny distance off the bottom edge of the spreadsheet. In some versions of Excel double-clicking the fill handle automatically fills the formula down to the bottom of your data. 2. For the mouse adept: another way. Click in the center of M2, drag down to the bottom of the student list. Then: a. Use the key combination Control-D to fill down. This invokes a non-smart fill down and is useful when Excel insists on creating an undesired series of increasing values during a smartfill. OR b. Use the menu sequence Edit: Fill: Down 3. For those who prefer the keyboard: Click in the center of M2. Release the mouse button. Hold down the shift key and use the down arrow to select the portion of the Avg column with the student list. Then: a. Use the key combination Control-D to fill down. This invokes a non-smart fill down and is useful when Excel insists on creating an undesired series of increasing values during a smartfill. OR b. Use the menu sequence Edit: Fill: Down Other functions Functions that could be put in M2 (or any other column to the right) and filled down include: =average(J2:L2) Finds the mean of the values in the range. =count(J2:L2) The number of cells containing values in the range. =max(J2:L2) Displays the smallest value in the range.

=median(J2:L2) Returns the median of the range. =min(J2:L2) Displays the smallest value in the range. =mode(J2:L2) Returns the most common value in a range. =stdev(J2:L2) Displays the standard deviation of the range. =sum(J2:L2) Returns the sum of the values in a range. Try entering some of these formulas in M2 and filling the result down the M column. Note that all functions begin with an equals sign. Arithmetic operations in cells In the event that one needs to weight a cell differently, arithmetic operators can be used with cell addresses to accomplish this task. The operators are:

Addition + Multiplication * (shift-* asterisk on the keyboard) Subtraction Division / Exponentiation ^ (shift-6 on the keyboard)

Suppose test T1 and test T2 are worth 25% each, and test T3 is 50% of the students grade. Then the following formula would be used in M2: =0.25*J2+0.25*K2+0.50*L2 Type this formula in M2 and fill down. Do not forget the leading equals sign! Remember, there are NO spaces in any formula. Mathematical operators can be combined with functions to perform complex calculations. Suppose that one wanted to toss out the lowest test and find the average of the remaining two tests. The formula to do this would be: =(sum(J2:L2)-min(J2:L2))/2 Enter this formula into M2 and fill down. This formula would work for three tests, it could be generalized to work for any number of tests with the following formula: =(sum(J2:L2)-min(J2:L2))/(count(J2:L2)-1) Enter this formula into M2 and fill down. Be careful when typing parentheses! Point and Select Entry of Formula

Another way to enter ranges into formulas is to use the mouse to select the cells in the range. Start by typing: =average( Do not forget either the = or the open parentheses, these are necessary to activate the point and select method of range entry. Immediately after typing the open parentheses, click with the mouse in the center of the cell J2 and hold the mouse button down. Roll the mouse slowly to the right (this is called "dragging the mouse") until you reach the center of the cell L2. Release the mouse button. Type a close parentheses: ) and press enter. This method of entry is most useful when working with formulas that refer to data on another sheet. Running summary calculations on a separate worksheet Suppose we want to know the overall average for all students in all of our classes. We could go to the bottom of the student averages in the M column and type =average(M2:M32), but the next time we sorted our data by average the average at the bottom would appear in the middle of the student name list. There is a good chance we would not be able to resort it back to the bottom of the data where it started. The underlying database principle we violated that led to the above problem is that each row of the gradesheet must correspond to a student. The summary calculation of average represented a row that was not a student. The result can be a scrambled worksheet. The way to avoid this problem is to put the summary calculations on another sheet altogether. From the Insert menu choose Worksheet to add a new worksheet to the workbook. A blank sheet called Sheet1 will appear (the number at the end may differ). Click with the RIGHT mouse button (not the left one!) on the name Sheet1 and choose Rename from the menu that appears. Rename the new worksheet Stat. In cell A1 type Overall Average. Adjust the width of the cell to fit the word by moving the cursor between the A and B letters at the top of the column , clicking, and dragging slowly to the right. Format the text and background as you prefer. In the cell B1 type the following: =average( and then click the mouse on the Data tab at the bottom of the worksheet. Carefully drag the mouse from M2 to the bottom of the student averages (probably M32 on the worksheet.) Then type a close parentheses:

) and press enter. The Stat worksheet should be set up something like the following image at this point:

Note the range specification Data!M2:M30 (the one being used in class more likely reads Data!M2:M32). The range specification now includes a reference to a separate worksheet, the Data worksheet. This is one reason giving worksheets a name that conveys meaning is important: it makes formulas such as the above more "readable." If-Then function An Excel Workbook is comprised of one or more worksheets. The workshop workbook is called Gradebook . The grades are on a worksheet called Data. . Some of the titles of other worksheets can be seen to the right of the Data tab. The arrows to the left of the Data tab help us scroll through the tabs. This is necessary only if there are many worksheets in the workbook. If the average function is not already in column Avg, click in cell M2, enter =average(J2:L2) and fill down to the bottom of the list.

Click on the cell M1 and enter the word Pass Click on the cell N1 and enter the word GP Click on the cell O1 and enter the word Grade B C D E F G H I J K L M N O P

1 Course Sect Last First Sx St HS Elem Lang T1 T2 T3 Avg Pass GP Grade The Basic If-Then function The If-Then function consists of three parts: a condition, what to do when the condition is true, what to do when the condition is false. The structure of the function is as follows: =IF(condition,true,false).

Note that the three parts are separated by commas. In the If-Then function letters of the alphabet must be surrounded by quotes, numbers do not need to be surrounded by quotes. In the cell N2 type =IF(M2>69,"Promote","Repeat") Type carefully, computers are extremely literal. The sequence is: equals IF open-parentheses M2 greater-than (shift-period) 69 comma quote Promote quote comma quote Repeat quote close-parentheses Then press the enter key. This function first determines if the value in M2 is greater than 69. If the value is greater than 69, then the student is promoted to the next mathematics course else the value was less than or equal to 69 and the student must repeat the mathematics course. Fill down by any of the previously introduced methods. Take a look at the results, note cases where the condition is met and not met. There are other conditional operators that can be used. Conditional operators include =, >, and <. These operators can be combined as in >= or <=. The nested If-Then function The following is a nested If-Then function. The nested If-Then function parses data in data bins. We will use a nested If-Then function to automatically assign a grade point value to each average. Type the following function into O2 being careful to include each comma and parentheses: =IF(M2<60,0,IF(M2<70,1,IF(M2<80,2,IF(M2<90,3,4)))) This should look something like (the multi-colored parentheses appear only in Excel 97, they help show the nesting structure):

The above is a nest If-Then function. For those who have worked in other computer languages, the above is equivalent to:

If M2 < 60 Then O2 = 0 Else If M2 <70 Then O2 = 1 Else If M2 < 80 Then O2 = 2 Else If M2 < 90 Then O2 = 3 Else O2 = 4 End If End If End If End If Fill the formula down the GP column by the method of your choice. The result is that Excel has calculated the grade as expressed in grade point value for each student. The frequency function, which we will look at later, cannot handle letters, hence the choice to use grade point values here. The Choose function The choose function selects the Nth item from a list. The syntax for choose is =choose(n,firstItem,secondItem,thirdItem,fourthItem,) where n must be a cell address that contains an integer. The Nth item is chosen by the integer. Click in the cell P2. Enter =CHOOSE(O2+1,"F","D","C","B","A") Note the O2+1: there is no zeroth item allowed in choose. The O2+1 converts a GP of 0 to 1 (there is no zeroth element of a list in Excel. Special note for users of Microsoft Works only: In a single encounter with Microsoft Works 4.0 there appears to be a zeroth element in the choose function.) Fill down the grade column. The worksheet should now look something like: A 1 2 3 B C D First E F G H I Lang J K L M T T T Av 1 2 3 g N Pass Promot e O P G Grad P e 3B 2C 4A

Cours Sec Last e t MS 101 MS 101

S S HS Elem x t

M0 Abena KH Albert F K Lelu 8 a S M0 PIC Aldis Adjoa F P PCS 8 S M0 Elidok Ama

Kosraen 83 82 81 82

Pohnpeia Promot 77 77 77 77 n e

4 MS

F C CH Puluw Puluwates 94 92 90 92 Promot

101 5 MS 101

at

e 0F

M0 Georg Kwek KH M K Malem Kosraen 58 59 60 59 Repeat 8 e u S

The Frequency function: An array function Inserting a new worksheet in the workbook 1. From the Insert menu choose Worksheet. 2. Click with the RIGHT mouse button on the tab Sheet1 and choose Rename from the popup menu. 3. Type Dist for the name of this worksheet. 4. Click on OK. On the new worksheet:

In A1 type the word Grade. In B1 type the letters GP In C1 type the word Count. In the cells A2 to A6 enter A, B, C, D, and F. In the cells B2 to B6 enter 4, 3, 2, 1, 0 B C

1 Grade GP Count 4 2A 3B 4C 5D 6F 3 2 1 0

The frequency function tallies the frequency with which a piece of numberical data appears. The frequency function can count the number of occurrences of a number in a list of numbers. The list of numbers is referred to as the data cells. The bins that will accumulate the number of occurences requires a set of index numbers that are referred to as the binIndexCells. The basic frequency function syntax is =FREQUENCY(dataCells:binIndexCells) The syntax if the data and the bins are on different worksheets is =FREQUENCY(workSheetName!dataCells:workSheetName!binIndexCells)

The frequency function we will be using is an "array" function which means it will occupy more than one cell. We must select all of the cells the frequency function will occupy. Select the cells C2 to C6. It ought to look something like this...

Type =frequency( then left click with the mouse on the Data worksheet tab Drag the mouse to select the grade point values column (the numbers only, do not include the label in the first row) on the Data worksheet. The grade point values are likely in column O on the Data worksheet.

10. Type a comma , 11. left click on the Dist worksheet tab 12. Drag the mouse to select B2 to B6 13. Type a close parentheses ).

14. Hold down the control and the shift key, then with the control (Ctrl) and shift key still down, press the enter key. The Control-Shift-Enter key combination tells Excel that the formula is an array and to enter the formula into all the selected cells. If you make an entry error with an array function, you cannot edit an individual cell: the formula is in no one cell. Deleting and reentering the array formula is the easiest way to fix an error in an array formula. 15. When you have done the above, the formula you will have constructed will look like =FREQUENCY(Data!O2:O32,Dist!B2:B6). When viewed in the cell Excel will add brackets to remind you that the formula is an array formula: {=FREQUENCY(Data!O2:O32,Dist!B2:B6)} The reason for using the frequency function is that the function creates a dynamic distribution. Try going to the Grades worksheet and changing a students grade point number by changing the test scores T1 to T3, then return to the Dist worksheet and note that the change is reflected in the counts. UNIT-II Fill data automatically in worksheet cells

Instead of entering data manually on a worksheet, you can use the Auto Fill feature to fill cells with data that follows a pattern or that is based on data in other cells. This article does not explain how to enter data manually or enter data simultaneously on multiple worksheets. For information about how to manually enter data, see the article Enter data manually. What do you want to do?

Automatically repeat values that already are found in the column Use the fill handle to fill data Fill data into adjacent cells by using the Fill command

Fill formulas into adjacent cells Fill in a series of numbers, dates, or other built-in series items Fill data by using a custom fill series Automatically repeat values that already exist in the column If the first few characters that you type in a cell match an existing entry in that column, Excel automatically enters the remaining characters for you. Excel automatically completes only those entries that contain text or a combination of text and numbers. Entries that contain only numbers, dates, or times are not automatically completed. After Excel completes what you started typing, do one of the following:

To accept a proposed entry, press ENTER.

The completed entry exactly matches the pattern of uppercase and lowercase letters of the existing entry.

To replace the automatically entered characters, continue typing. To delete the automatically entered characters, press BACKSPACE.

NOTES

Excel completes an entry only when the cursor is at the end of the current cell contents. Excel bases the list of potential AutoComplete entries on the column that contains the active cell. Entries that are repeated within a row are not automatically completed. Turn off automatic completion of cell values If you don't want Excel to automatically complete cell values, you can turn off this feature. 1. Click the Microsoft Office Button , and then click Excel Options.

2. Click Advanced, and then under Editing options, clear or select the Enable AutoComplete for cell values check box to turn automatic completion of cell values on or off. Use the fill handle to fill data To quickly fill in several types of data series, you can select cells and drag the fill handle To use the fill handle, you select the cells that you want to use as a basis for filling additional cells, and then drag the fill handle across or down the cells that you want to fill. Hide or display the fill handle By default, the fill handle is displayed, but you can hide it, or show it if it's hidden. .

1.

Click the Microsoft Office Button

, and then click Excel Options.

2. Click Advanced, and then under Editing options, clear or select the Enable Fill handle and cell drag-and-drop check box to hide or show the fill handle. 3. To avoid replacing existing data when you drag the fill handle, make sure that the Alert before overwriting cells check box is selected. If you don't want to see a message about overwriting nonblank cells, you can clear this check box. Use Auto Fill Options to change how the selection is filled After you drag the fill handle, the Auto Fill Options button appears so that you can change how the selection is filled. For example, you can choose to fill just cell formats by clicking Fill Formatting Only, or you can choose to fill just the contents of a cell by clicking Fill Without Formatting. Turn Auto Fill Options on or off If you don't want to display the Auto Fill Options button every time you drag the fill handle, you can turn it off. Likewise, if the Auto Fill Options button does not appear when you drag the fill handle, you might want to turn it on. 1. Click the Microsoft Office Button , and then click Excel Options.

2. Click Advanced, and then under Cut, Copy, and Paste, clear the Show Paste Options buttons check box. Fill data into adjacent cells by using the Fill command You can use the Fill command to fill the active cell or a selected range with the contents of an adjacent cell or range, or you can quickly fill adjacent cells by dragging the fill handle . Fill the active cell with the contents of an adjacent cell 1. Select an empty cell that is below, to the right, above, or to the left of the cell that contains the data that you want to use to fill the empty cell. 2. On the Home tab, in the Editing group, click Fill, and then click Down, Right, Up, or Left.

TIP To quickly fill a cell with the contents of an adjacent cell, you can press CTRL+D to fill from the cell above or CTRL+R to fill from the cell to the left. To fill a cell with the contents of a cell below it (that is, to fill up), on theHome tab, in the Editing group, click Fill, and then click Up. To fill a cell with the contents of a cell to the right (fill left), on the Home tab, in the Editing group, click Fill, and then click Left. Drag the fill handle to fill data into adjacent cells 1. Select the cells that contain the data that you want to fill into adjacent cells. 2. Drag the fill handle across the cells that you want to fill. , and then click

3. To change how you want to fill the selection, click Auto Fill Options the option that you want.

NOTE If you drag the fill handle up or to the left of a selection and stop in the selected cells without going past the first column or the top row in the selection, Excel deletes the data within the selection. You must drag the fill handle out of the selected area before releasing the mouse button. Fill formulas into adjacent cells 1. Select the cell that contains the formula that you want to fill into adjacent cells. 2. Drag the fill handle across the cells that you want to fill. , and then click

3. To choose how you want to fill the selection, click Auto Fill Options the option that you want.

NOTE If automatic workbook calculation is not enabled, formulas will not recalculate when you fill cells. To check your workbook calculation options, do the following: 1. Click the Microsoft Office Button the Formulas category. 2.

, click Excel Options, and then click

Under Calculation options, look under Workbook Calculation. Automatic Formulas automatically recalculate. Formulas recalculate, unless the formula is

Automatic except for data tables Manual

in a data table.

Formulas never recalculate automatically.

Recalculate workbook before saving This option is available only if Workbook Calculation is set toManual. If this check box is selected, formulas do not automatically recalculate until you save the workbook. Note that several other actions can cause the workbook to be saved, such as using the Send To command.

Tips

You can also fill the active cell with the formula of an adjacent cell by using the Fill command (on the Home tab in the Editing group) or by pressing CTRL+D to fill a cell below or CTRL+R to fill a cell to the right of the cell containing the formula. You can automatically fill a formula downward, for all adjacent cells that it applies to, by double-clicking the fill handle of the first cell that contains the formula. For example, cells A1:A15 and B1:B15 contain numbers, and you type the formula =A1+B1 in cell C1. To copy that formula into cells C2:C15, select cell C1 and double-click the fill handle.

Fill in a series of numbers, dates, or other built-in series items Using the fill handle, you can quickly fill cells in a range with a series of numbers or dates, or with a built-in series for days, weekdays, months, or years. 1. 2. 3. Select the first cell in the range that you want to fill. Type the starting value for the series. Type a value in the next cell to establish a pattern.

For example, if you want the series 1, 2, 3, 4, 5..., type 1 and 2 in the first two cells. If you want the series 2, 4, 6, 8..., type 2 and 4. If you want the series 2, 2, 2, 2..., you can leave the second cell blank. More examples of series that you can fill When you fill a series, the selections are extended as shown in the following table. In this table, items that are separated by commas are contained in individual adjacent cells on the worksheet. INITIAL SELECTION 1, 2, 3 9:00 Mon Monday Jan EXTENDED SERIES 4, 5, 6,... 10:00, 11:00, 12:00,... Tue, Wed, Thu,... Tuesday, Wednesday, Thursday,... Feb, Mar, Apr,...

Jan, Apr Jan-07, Apr-07 15-Jan, 15-Apr 2007, 2008 1-Jan, 1-Mar Qtr3 (or Q3 or Quarter3) text1, textA 1st Period Product 1 4. 5.

Jul, Oct, Jan,... Jul-07, Oct-07, Jan-08,... 15-Jul, 15-Oct,... 2009, 2010, 2011,... 1-May, 1-Jul, 1-Sep,... Qtr4, Qtr1, Qtr2,... text2, textA, text3, textA,... 2nd Period, 3rd Period,... Product 2, Product 3,...

Select the cell or cells that contain the starting values. Drag the fill handle across the range that you want to fill.

To fill in increasing order, drag down or to the right. To fill in decreasing order, drag up or to the left. Tips

You can also specify the type of series by using the right mouse button to drag the fill handle over the range and then clicking the appropriate command on the shortcut menu. For example, if the starting value is the date JAN-2007, click Fill Months for the series FEB-2007, MAR-2007, and so on; or click Fill Years for the series JAN-2007, JAN-2008, and so on. If the selection contains numbers, you can control the type of series that you want to create. Fill cells with a series of numbers 1. On the Home tab, in the Editing group, click Fill, and then click Series.

2.

Under Type, click one of the following options:

Linear Creates a series that is calculated by adding the value in the Step value box to each cell value in turn.

Growth Creates a series that is calculated by multiplying the value in the Step value box by each cell value in turn.

Date Creates a series that fills date values incrementally by the value in the Step value box and dependent on the unit specified under Date unit.

AutoFill

Creates a series that produces the same results as dragging the fill

handle.

You can suppress series AutoFill by holding down CTRL as you drag the fill handle of a selection of two or more cells. The selected values are then copied to the adjacent cells, and Excel does not extend a series.

Fill data by using a custom fill series To make entering a particular sequence of data (such as a list of names or sales regions) easier, you can create a custom fill series. A custom fill series can be based on a list of existing items on a worksheet, or you can type the list from scratch. You cannot edit or delete a built-in fill series (such as a fill series for months and days), but you can edit or delete a custom fill series. NOTE A custom list can only contain text or text mixed with numbers. For a custom list that contains numbers only, such as 0 through 100, you must first create a list of numbers that is formatted as text. Format numbers as text 1. Select enough cells for the list of numbers that you want to format as text. 2. On the Home tab, in the Number group, click the arrow on the Number Format box, and then click Text.

TIP You might have to click More to see the Text format in the list. 3. In the formatted cells, type the list of numbers.

Use a custom fill series based on an existing list of items 1. On the worksheet, select the list of items that you want to use in the fill series.

2.

Click the Microsoft Office Button

, and then click Excel Options.

3. Click Popular, and then under Top options for working with Excel, click Edit Custom Lists. 4. Verify that the cell reference of the list of items that you selected is displayed in the Import list from cellsbox, and then click Import. The items in the list that you selected are added to the Custom lists box. 5. Click OK twice.

6. On the worksheet, click a cell, and then type the item in the custom fill series that you want to use to start the list. 7. 1. Drag the fill handle across the cells that you want to fill. , and then click Excel Options. Use a custom fill series based on a new list of items Click the Microsoft Office Button

2. Click Popular, and then under Top options for working with Excel, click Edit Custom Lists. 3. In the Custom lists box, click NEW LIST, and then type the entries in the List entries box, starting with the first entry. Press ENTER after each entry. 4. When the list is complete, click Add, and then click OK twice.

5. On the worksheet, click a cell, and then type the item in the custom fill series that you want to use to start the list. 6. 1. Drag the fill handle across the cells that you want to fill. , and then click Excel Options. Edit or delete a custom fill series Click the Microsoft Office Button

2. Click Popular category, and then under Top options for working with Excel, click Edit Custom Lists. 3. In the Custom lists box, select the list that you want to edit or delete, and then do one of the following:

To edit the fill series, make the changes that you want in the List entries box, and then click Add.

To delete the fill series, click Delete.

Sorting Data in Microsoft Excel When one of the Scripting Sons was six years old he played flag football at the Kirkland Boys and Girls Club. The coach of the team had decided that his son was going to be the star running back, and therefore focused exclusively on showing all the other kids how to block. The only thing the Kirkland team did in the practices preceding their first game was work on blocking; after all, the better the rest of the players blocked the more touchdowns the coachs son could score. At the teams first game Kirkland kicked off; the return man on the opposing team caught the ball and ran untouched into the end zone. Not only did he run untouched, but he also ran without anyone pursuing him: all the Kirkland kids were busy blocking. Turns out that the coach had neglected to fill the players in on one important facet of flag football: when the other team has the ball, youre supposed to run after them and try to grab the ball carriers flag. Oops. So what prompted that trip down memory lane? Oh, nothing reallywell, except the fact that were now five months into the Office Space column and we still havent shown you how to sort data in Microsoft Excel. But that wasnt because we were overlooking such an important and fundamental part of Office scripting, its just that well, OK, maybe it was because we were overlooking such an important and fundamental part of Office scripting. But well make up for that, starting right now. In order to keep things simple were going to assume that we have a basic spreadsheet: Division North America Europe Africa Asia South America Employees 698 453 712 381 833 Sales Total 44,000,000 51,000,000 33,000,000 48,000,000 72,000,000

The actual spreadsheet itself looks something like this:

Parameter Key 1

Description This is the first column we want to sort by. As you recall, we created a range consisting of cell A1 and gave that range the object reference objRange2; that object reference is what we pass to the Sort method. This indicates whether we want the data sorted in ascending or descending order. To sort in ascending order we use the constant xlAscending, with a value of 1. If we wanted to sort the data in descending order we would use the constant xlDescending, with a value of 2. This is the second column we want to sort by. In this first script were only sorting by column A; thus we dont specify anything for this parameter. To indicate that, we simply type a blank space followed by a comma. This parameter is used only when dealing with PivotTables. Therefore, we do the old blank-space-followedby-a-comma trick. You cant leave this out because, as we noted, the order of the parameters is crucial. Order 2 must be the fifth parameter or the script will likely fail. And Order 2 can be the fifth parameter only if you include this blank fourth parameter. The sort order for Key 2. Again, we leave this blank because we dont have a second sort key for this script. The third column we want to sort by. For this script, we leave this blank.

Order 1

Key 2

Type

Order 2 Key 3

Order 3 Header

The sort order for Key 3. Because there is no third sort column we leave this blank. This tells the script whether or not our data has a header row. It does, so we use the constant xlYes, which has a value of 1. If the data didnt have a header row we would use the constant xlNo, with a value of 2.

As you can see, we simply call the Sort method followed by a bunch of crazy-looking parameters. These parameters, in order (which is very important) consist of the following items:

See? Not too terribly complicated. When we run the script we should get something that looks like this:

About using Microsoft Query to retrieve external data Microsoft Query is a program for bringing data from external sources into other Microsoft Office programs in particular, Microsoft Excel. By using Query to retrieve data from your corporate databases and files, you don't have to retype the data you want to analyze in Excel. You can also update your Excel reports and summaries automatically from the original source database whenever the database is updated with new information. Types of databases you can access You can retrieve data from several types of databases, including Microsoft Access, Microsoft SQL Server, and Microsoft SQL Server OLAP Services. You can also retrieve data from Excel lists and from text files.

In Excel, you can also retrieve data from Web pages, but you don't need Query to do this. For information about retrieving data from Web pages, see Excel Help. Selecting data from a database You retrieve data from a database by creating a query, which is a question you ask about data stored in an external database. For example, if your data is stored in an Access database, you might want to know the sales figures for a specific product by region. You can retrieve a part of the data by selecting only the data for the product and region you want to analyze and omitting the data you don't need.

Columns selected in Query Wizard Selected columns brought into Excel Updating your worksheet in one operation After you have external data in an Excel workbook, whenever your database changes, you can refresh the data to update your analysis without having to recreate your summary reports and charts. For example, you can create a monthly sales summary and refresh it every month when the new sales figures come in. Using Query to retrieve data Bringing external data into Excel with Query takes three steps: First you set up a data source to connect to your database, then you use the Query Wizard to select the data you want, and finally you return the data to Excel where you can format it, summarize it, and create reports from it.

Graphical Options Note that Office 97 does things a little differently in a slightly different order with dialog boxes that, unfortunately, look very different. Design for charting is like designing for data. Include a field name row at the top of the data. Make the leftmost ("first") column a column of labels. The Dist worksheet is set up this way already. Grade GP Count A B C D F 4 3 2 1 0 5 7 8 6 3

Column chart What many call a "bar chart" Excel calls a "Column chart" or column graph. To make a column chart, select the cells A1 to A6. Hold down the Control (Ctrl) key and select the cell C1 to C6. The control key allows the selection of non-adjacent data. Always include all label rows and columns in the selection, this will cause automatic labeling of the chart axes. Click on the Chart wizard button in the tool bar . This button has slightly different appearance in Excel 95 and Excel 97. From here on forward the two versions differ significantly. This document will follow the Excel 95 version. Excel 95 only: Drag the mouse to form a small dotted line square on the worksheet to set the location of the chart on the worksheet. Releasing the mouse should cause a chart wizard dialog box to pop up. Excel 97 ONLY: Excel 97 skips the above step and the next step altogether. Excel 97 automatically creates a "default" chart size that can be changed later. Excel 97 relegates step 1 below to a tab hidden in the new step one. Click on Next to leave step 1. Click on Column chart option in the middle of the top row of step 2 and then on Next. Click on format option 1 in the upper left corner of step 3 for a basic column chart and then on Next.

The dialog box for step 4 is the first of two options dialog boxes that are important. This is where one can specify whether the data is in rows or columns. If one has more than one label row or column, this is the place to specify multiple label rows or columns. We have only one label column if we used the Control key properly. Excel should have chosen the following set-up:

The series radio buttons should be set as follows:

Click on Next. In step 5 options dialog box select No under "Add a legend?" For a single data set a legend is unnecessary. If desired, type in a chart title, x-axis and y-axis label. Click on finish. Excel 97 ONLY: This is step 3 in Excel 97 and the dialog box differs in the extreme from Excel 95. Turning off the Legend requires clicking on the Legend tab and clicking on the check mark to the left of the words "Show legend" to turn the check mark off. If the Pie chart option had been taken at step 2, then a pie chart would have been the result. The pie chart option 7 includes percentages. Pie chart for population Enter the following data below the grade distribution on the Dist tab. State Kosrae Yap Pop 7354 11128

Chuuk 52870 Pohnpei 33372

Excel 95: To make a pie chart, select the data including the field names row and the labels column.

Click on the Chart wizard button in the tool bar. Drag the mouse to set the location of the chart on the worksheet. Click on Next. Click on pie chart option and then on Next. Click on option 7 for a basic labeled pie chart and then on Next. This first of two options dialog boxes is important. This is where one can specify whether the data is in rows or columns. If one has more than one label row, this is the place to specify multiple label rows. It is likely that no adjustments need to be done for this graph: Excel will likely "guess" correctly based on the existence of a field name row and the labels column. Click on Next when done. In this second options dialog box select No under "Add a legend?" For a single data set a legend is unnecessary. Type in a chart title. Click on finish. Other types of charts: Population Pyramid Age 0-4 5-9 Female Male -7117 7545 -7158 7932

10-14 -7288 7656 15-19 -5893 6532 20-24 -4703 4489 25-29 -3528 3514 30-34 -3407 3393 35-39 -2949 3049 40-44 -2456 2975 45-49 -1660 1941 50-54 -1160 1111 55-59 -1091 998 60-64 65-69 70-74 75-79 80-84 85-89 -965 1013 -669 639 -627 542 -281 263 -176 137 -58 41

90-94 95-99

-30 -8

26 4

There are many types of charts available. The math teacher is likely to find the x-y scatter diagrams useful for graphing functions. Put the x values in the first column and the y-values or a function in the second column. Excel will, with a little thought, make specialty graphs that are not immediately evident from an inspection of the chart wizard. In attempt to stretch thinking, the following will produce a population pyramid type chart. Select the data including the field names row and the labels column. Note the use of negative values for the first column. Click on the Chart wizard button in the tool bar. Drag the mouse to set the location of the chart on the worksheet. Click on Next. Click on Bar chart option and then on Next. Click on option 8 for then on Next. This first of two options dialog boxes is important. This is where one can specify whether the data is in rows or columns. If one has more than one label row, this is the place to specify multiple label rows. It is likely that no adjustments need to be done for this graph: Excel 95 will likely "guess" correctly based on the existence of a field name row and the label column. Click on Next when done. In this second options dialog box select Yes under "Add a legend?" The wizard may already have selected yes. For two or more data columns a legend is informative. A field name row is necessary for Excel to correctly set up the legend. Type in a chart titled, x-axis, and y-axis labels. Click on finish. Excel 95: Double-click on the chart to select the chart. A hashed line should appear around the chart, or, alternatively, the chart should appear in its own window. Excel is now in graphing mode. The menus are different in graphing mode. This modality (regular versus graphing) is a source of confusion for many learning to use Excel. From the Format menu choose Chart Type. Click on the Options button in the Chart Type dialog box. Click on the Options tab at the top of the Format Bar Group dialog box.

Set the Overlap to 100 and the gap width to 0. Click on OK. Click outside the area of the graph to turn off the hash mark border. This also takes Excel out of the graphing mode and into the regular mode.

Excel 97: Instead of double clicking on the chart to select the chart as noted above, single click on the chart. Then go to the Chart menu and then double click on the actual population bars in the chart. This brings up the format data series dialog box. Click on the options tab. Set the Overlap to 100 and the gap width to 0. click on OK. Excel 97 may make a mess of the graph labels. Double click on the offending labels and set their font size and style to reasonable values. Intermediate Excel: Subtotals Using Excel to generate subtotals by course and section Suppose we wanted to know whether our course averages differed from one section to the next or wanted to know the relative performance of the students by state or gender. Excel can sort and summarize such data using subtotals. In order for Excel to generate subtotals the data must be sorted by the criterion to be summarized. Click in cell A1 of the Grades sheet of the Gradebook workbook. Do not select any cells: sort will make the presumption that only the selected cells are to be sorted and will mix up the data. Choose Sort from the Data menu. Excel should have detected the field names and the radio button "My List has Header Row" should already have been selected by Excel. Good initial design for data is important to proper sorting and subtotaling.

Sort by Course and Then By Sect and Then By Last (name). Click on OK. Set up the subtotals Choose Subtotals from the Data menu in Excel.

Set at "At Each Change in" to Sect by clicking on the downward pointing triangle on the right side of the "At Each Change in" list box.

Set the "Use Function" list box to Average. In the "Add Subtotal to:" list click on the check boxes next to T1, T2, T3, Avg, and GP. Scroll the list box to see T1, T2, T3, Avg, and GP. Click on OK.

Note the change in the worksheet: a new panel has appeared on the left, the subtotals control panel. There are three levels shown at the top by three numbered buttons. Click on button number 1 to see only the Grand Average.

Click on button number 2 to see the individual section averages. Note the buttons with the plus signs that appear. Clicking on a plus sign button opens up the details for a single section. After clicking on a plus button, a minus button appears. Click on the minus button to collapse the section. Click on button number 3 to see the list of all students. Suppose we now wanted to see the overall student averages by state. Changing a subtotals view is a three phase process. 1. Remove the existing subtotals 2. Resort by state (the new criteria) 3. Reapply the subtotals. The key concept here is that the sort order must mirror the "subtotal at each change in" choice. Subtotals subtotal at each change as Excel moves down the list. If the states are not in alphabetic order, then at each and every change of state from row to row Excel will insert a subtotal. Subtotals on one field cannot be resorted on another without removing all existing subtotals first, hence the first step of removing the subtotals.

Phase one: Choose Subtotals from the Data menu and then click on the Remove All button. Phase two: Choose Sort from the Data menu. Sort by State and Then By Sect and Then By Last Click on OK. Phase three: Set up the subtotals. Choose Subtotals from the Data menu in Excel. Set at "Each Change In" to State by clicking on the downward pointing triangle on the right side of the Each Change In list box. Set the Use Function list box to Average. In the "Add Subtotal to:" list the check boxes may still be checked from the earlier exercise. If they are not checked, then click on the check boxes next to T1, T2, T3, Avg, and GP. Scroll the list box to see T1, T2, T3, Avg, and GP. Click on OK.

Other subtotal functions Subtotals functions include sum (the additive total), count (how many items), the average, the maximum value in the subset, the minimum value in the subset, and standard deviations among

other specialized functions. The sum and average functions are the most commonly needed functions. On the worksheet tab labeled Inventory is an example of an inventory spreadsheet demonstrating the use of the Sum function to tally up the value of property in the A204 laboratory. Click on the Subtotal control panel numbered buttons to explore the different levels of this spreadsheet. Filtering Filtering allows one to display subsets of the data based on specific condition. Suppose we want to display only the students who will be on the deficiency list, those with an average less than 70. Start filtering by removing the subtotals. Choose Subtotals on the Data menu and then click on the "Remove All" button. Choose Sort on the Data menu and sort by last name and then by first name. Click on OK. Scroll to the top of the worksheet. From the Data menu choose Filter. On the submenu that pops up choose Autofilter. Small grey buttons with triangles in them should appear in the top row of your spreadsheet.

Click on the grey button in the M (Avg) column to see a "drop-down" list of options. This list includes preset values one can select to filter the data. Choose (Custom), the third item down the list. The following dialog box should appear:

Use the little "down triangle" button to the right of the equals sign in the first blank under the word "Avg" to choose a less than < sign.

Either select 70 from the drop down list in the next box or type 70 in the next blank box as seen above. Click on OK. The result is a list of students who are deficient (below 70). If one chooses print with a filter on then only the names shown will print. Getting back all of your data: Choose Filter again from the Data menu and this time select "Show All" on the submenu. Filters are another powerful use of Excel provided that your spreadsheet is set up in database format (field names in row one and no blank rows, one physical item per row in rows two and higher). Assets larger or smaller than a given number could be displayed, or students with a TOEFLs above or below a specific point could be shown. The "Top ten" filter option can display just that, the "top ten" in a category. Pivot tables Using Excel to set up a pivot table to study course versus gender grade averages. This section presumes that the worksheet named Dist has already been inserted in the workbook during work on the frequency function. Pivot tables are easiest to set up when the spreadsheet is designed for data. Field names should be in row one of the table, with data below. There should be no blank rows within the data. Pivot tables (known in Microsoft Access as a cross-tab table) groups data by two categories, producing summary information such as average, sum, or count according to two or more categorizations. As a part of this process, pivot tables have the ability to take categories in data rows and turn them into field names. The result feels like a "rotation" of the data, hence the name Pivot table. As an example, the data on the left below is pivoted to produce the result on the right. A B C DE F G M 70 H Grand Total 72.5

1 State Sex T3 2 Pohnpei F 80 3 Pohnpei M 65 4 Pohnpei F 70 5 Pohnpei M 75 6 Chuuk F 95 7 Chuuk M 60 8 Chuuk F 70 9 Chuuk M 75

Average of T3 Sex F State Chuuk Pohnpei Grand Total 75

82.5 67.5 75 78.75 68.75 73.75

The result are averages based on state and sex. The data in the Sex column, F and M, has become field names in a new row one of a table. The data has, in a sense, been "pivoted" or "rotated" up out of a column and tabulated across as field names in a new table (hence the use of term "crosstab" by Microsoft Access). To start a pivot table in the Gradebook workbook, click anywhere inside the field row or the data rows of the Grades worksheet. Do not select a cell, just have the cursor in a cell inside the data to be pivot tabled. Choose Pivot Table from the Data menu. Click on Next in the first dialog box. The default Microsoft Excel List or Database is usually selected and is the correct selection. Click on Next in the second dialog box. If the spreadsheet is designed properly for data then Excel will have correctly detected the data range. Dialog box three presents the screen where choices are made as to row and column groups.

Drag and drop the button marked State (St) from the right hand area of the dialog box to the area marked Row. Drag and drop the button marked Sex (Sx) from the right hand side to the Column area. Drag and drop the button marked Avg from the area on the right to the Data area.

Double click on the Avg button in the Data layout area at the center of the screen. From the PivotTable Field pop-up dialog box choose the function average. Note that all of the basic functions are available including sum, average, and count among others. These are the same functions we encountered on the first day. Click on OK.

Click on Next. The next dialog requests a location for the pivot table. Click on the Dist worksheet tab (created during the frequency function lesson). Click in A15 (below the chart if one exists in the gradebook). Click on Finish.

The data in the resulting PivotTable summarizes averages by state and sex for the fictional College of Micronesia-FSM spreadsheet. To make the data more presentable: Select the data in the pivot table by dragging the mouse across the number data. Choose Cells on the Format menu.

The dialog box should open to the Number tab. If not, click on the tab marked Number. Click on the item Number in the Category list box. Note the default number of decimal places is preset to 2. This can be changed. For now, click on OK and the numbers in the table will be displayed to two decimal places. Graphing Pivot Tables The data in a pivot table can be graphed to produce charts as was covered in the second session. Be careful to select only the state and sex breakdown data and not the grand total data. Look carefully at the diagram below and the note following the diagram.

Making the selection shown must be done by dragging from C20 to A16. Dragging from A16 to C20 is not possible as A16 is a button that activates when clicked.

Note that in the particular chart shown has been adjusted by rotating the chart 180 from the initial position. This was done by double-clicking on the chart and then choosing 3-D View from the Format menu. In the 3-D View dialog box the rotation was set to 200 (initial rotation was 20). Pivot tables are best produced by good data designs. In turn, good data designs are produced by considering the pivot table implications. Good design requires that each data row be a single object or instance, not a an aggregate of data. Gradebooks almost naturally generate good data designs: a single student in a single class per row (a "student-seat"). In other applications forethought may be necessary. In a study of lizards, for example, proper design of a good table is likely to involve listing each individual lizard in its own row. This would be as opposed to a table where each row was a location and the data was the number of lizards in that location. The following fictitious table is not well thought out from a pivot table perspective. For example, although the original tallies might have indicated the number of females with tails, the resulting table has lost that information. The design is also prone to typographic errors that result in internally inconsistent data: examine the sum of the number of males and females on trees. Location Beach Pond River Rock Tree Number Number Number Num w/ of lizards of Females of Males tail 2 6 8 7 10 1 3 5 5 6 1 3 3 2 5 0 5 4 7 9

A better design would have been: Location Sex With Tail Tree F 1

Tree Tree Tree Tree Tree Tree Tree Tree Tree Tree Pond Pond Pond Pond Pond Pond

F F F F

1 1 1 1

M 0 M 1 M 1 M 1 M 1 M 1 F F F 0 1 1

M 1 M 1 M 1

and so forth. The resulting table can be subtotaled or pivoted to obtain accurate summary information. Although the original data table will be lengthy, most reports will use the results of subtotal calculations and pivot tables. The table may have typographic errors, but the totals will at least be consistent with the data, there will not be any internally conflicting data. Typos will also not likely affect counts the way they can in the earlier table. UNIT-III Related worksheet functions Excel provides many other statistical, financial, and engineering worksheet functions. Some of the statistical functions are built-in and others become available when you install the Analysis ToolPak. Accessing the data analysis tools The Analysis ToolPak includes the tools described below. To access these tools, click Data Analysis on the Tools menu. If the Data Analysis command is not available, you need to load the Analysis ToolPak add-in program. Anova The Anova analysis tools provide different types of variance analysis. The tool to use depends on the number of factors and the number of samples you have from the populations you want to test. Anova: Single Factor This tool performs a simple analysis of variance on data for two or more samples. The analysis provides a test of the hypothesis that each sample is drawn from the same

underlying probability distribution against the alternative hypothesis that underlying probability distributions are not the same for all samples. If there were only two samples, the worksheet function, TTEST, could equally well be used. With more than two samples, there is no convenient generalization of TTEST and the Single Factor Anova model can be called upon instead. Anova: Two-Factor With Replication This analysis tool is useful when data can be classified along two different dimensions. For example, in an experiment to measure the height of plants, the plants may be given different brands of fertilizer (for example, A, B, C) and might also be kept at different temperatures (for example, low, high). For each of the 6 possible pairs of {fertilizer, temperature} we have an equal number of observations of plant height. Using this Anova tool we can test: 1. 2. 3. Whether heights of plants for the different fertilizer brands are drawn from the same underlying population; temperatures are ignored for this analysis. Whether heights of plants for the different temperature levels are drawn from the same underlying population; fertilizer brands are ignored for this analysis. Whether having accounted for the effects of differences between fertilizer brands found in step 1 and differences in temperatures found in step 2, the 6 samples representing all pairs of {fertilizer, temperature} values are drawn from the same population. The alternative hypothesis is that there are effects due to specific {fertilizer, temperature} pairs over and above differences based on fertilizer alone or on temperature alone.

Anova: Two-Factor Without Replication This analysis tool is useful when data are classified on two different dimensions as in the Two-Factor case With Replication. However, for this tool we assume that there is only a single observation for each pair (for example, each {fertilizer, temperature} pair in the example above. Using this tool we can apply the tests in steps 1 and 2 of the Anova: Two-Factor With Replication case but do not have enough data to apply the test in step 3. Correlation The CORREL and PEARSON worksheet functions both calculate the correlation coefficient between two measurement variables when measurements on each variable are observed for each

of N subjects. (Any missing observation for any subject causes that subject to be ignored in the analysis.) The Correlation analysis tool is particularly useful when there are more than two measurement variables for each of N subjects. It provides an output table, a correlation matrix, showing the value of CORREL (or PEARSON) applied to each possible pair of measurement variables. The correlation coefficient, like the covariance, is a measure of the extent to which two measurement variables vary together. Unlike the covariance, the correlation coefficient is scaled so that its value is independent of the units in which the two measurement variables are expressed. (For example, if the two measurement variables are weight and height, the value of the correlation coefficient is unchanged if weight is converted from pounds to kilograms.) The value of any correlation coefficient must be between -1 and +1 inclusive. You can use the correlation analysis tool to examine each pair of measurement variables to determine whether the two measurement variables tend to move together that is, whether large values of one variable tend to be associated with large values of the other (positive correlation), whether small values of one variable tend to be associated with large values of the other (negative correlation), or whether values of both variables tend to be unrelated (correlation near zero). Covariance The Correlation and Covariance tools can both be used in the same setting, when you have N different measurement variables observed on a set of individuals. The Correlation and Covariance tools each give an output table, a matrix, showing the correlation coefficient or covariance, respectively, between each pair of measurement variables. The difference is that correlation coefficients are scaled to lie between -1 and +1 inclusive, Corresponding covariances are not scaled. Both the correlation coefficient and the covariance are measures of the extent to which two variables vary together. The Covariance tool computes the value of the worksheet function, COVAR, for each pair of measurement variables. (Direct use of COVAR rather than the Covariance tool is a reasonable alternative when there are only two measurement variables, i.e. N=2.) The entry on the diagonal of the Covariance tools output table in row i, column i is the covariance of the i-th measurement variable with itself; this is just the population variance for that variable as calculated by the worksheet function, VARP. You can use the covariance tool to examine each pair of measurement variables to determine whether the two measurement variables tend to move together that is, whether large values of one variable tend to be associated with large values of the other (positive covariance), whether small values of one variable tend to be associated with large values of the other (negative covariance), or whether values of both variables tend to be unrelated (covariance near zero).

Finance Functions Microsoft Excel provides a series of functions destined to perform various types of financially related operations. These functions use common factors depending on the value that is being calculated. Many of these functions deal with investments or loan financing. The Present Value is the current value of an investment or a loan. For a savings account, a customer could pledge to make a set amount of deposit on a bank account every month. The initial value that the customer deposits or has in the account is the Present Value. The sign of the variable, when passed to a function, depends on the position of the customer. If the customer is making deposits, this value must be negative. If the customer is receiving money (lottery installment, family inheritance, etc), this value should be positive. The Future Value is the value the loan or investment will have when the loan is paid off or when the investment is over. For a car loan, a musical instrument loan, a financed refrigerator, a boat, etc, this is usually 0 because the company that is lending the money will not take that item back (they didn't give it to the customer in the first place, they only lend him or her some money to buy the item). This means that at the end of the loan, the item (such as a car, boat, guitar, etc) belongs to the customer and it is most likely still worth something. The Future Value of an Investment

To calculate the future value of an investment, you can use the FV() function. The syntax of this function is: FV(Rate, Periods, Payment, PresentValue, PaymentType)

Practical Learning: Calculating the Future Value

1. Start a new workbook and fill up Sheet1 as follows:

2. Save it as Business

3. Double-click Sheet1 to put its label into edit mode. Type Future Value and press Enter 4. Click cell C8 and, on the main menu, click Insert -> Function... 5. In the Paste Function dialog box, in the Function Category list, click Financial. In the Function Name list, double-click FV and move the FV window so you can see the values on the worksheet 6. Click the box to the right of Rate and, on the worksheet, click cell C5 and type /12 7. In the FV window, click the box to the right of Nper and, on the worksheet, click cell C7 8. In the FV window, click the box to the right of Pmt and type 9. On the worksheet, click cell C6 10. In the FV window, click the box to the right of Pv and type 11. On the worksheet, click cell C4 12. Since this is a loan, the payments are expected at the end of the month. Therefore, in the FV window, click the box to the right of Type and type 0

13. Click OK The Number of Periods of an Investment

To calculate the number of periods of an investment or a loan, you can use the NPER() function. Its syntax is: NPER(Rate, Payment, PresentValue, FutureValue, PaymentType); Here is an example:

Investment or Loan Payment

The PMT() function is used to calculate the regular payment of loan or an investment. Its syntax is: PMT(Rate, NPeriods, PresentValue, FutureValue, PaymentType) In the following example, a customer is applying for a car loan. The cost of the car will be entered in cell C4. It will be financed at a rate entered in cell C6 for a period set in cell C7. The dealer estimates that the car will have a value of $0.00 when it is paid off.

Practical Learning: Calculating the Monthly Payments of a Loan

1. Double-click Sheet3 to put it in edit mode. Type Payments Amount and press Enter 2. Complete the worksheet as follows

3. Click cell C8 and type =PMT( 4. Click cell C6 and type /12, 5. Click cell C7 and type ,6. Click cell C4 and type , 7. Click cell C5 8. Type ,0) and, on the Formula Bar, click the Enter button

9. Suppose that, during the evaluation, a customer decides that she doesn't need a brand new car anymore. Also, she thinks that a 5-year car loan is too long. Furthermore, she wants to make a $4500.00 down payment to reduce the monthly payments. On the other side of the desk, the salesperson who wants to make a juicy commission on this loan has decided to increase the interest rate. Change the new values of the worksheet as follows and see the result

10. Save the workbook

The Amount Paid As Interest During a Period

When a customer is applying for a loan, an investment company must be very interested to know how much money it would collect as interest. This allows the company to know whether the loan is worth giving. Because the interest earned is related to the interest rate, a company can play with the rate (and also the length) of the loan to get a fair (?) amount. The IPMT() function is used to calculate the amount paid as interest on a loan during a period of the lifetime of a loan or an investment. It is important to understand what this function calculates. Suppose a customer is applying for a car loan and the salesperson decides (or agrees with the customer) that the loan will be spread over 5 years (5 years * 12 months each = 60 months). The salesperson then applies a certain interest rate. The IPMT() function can help you calculate the amount of interest that the lending institutionwould earn during a certain period. In essence, you can use it to know how much money the company would earn in the 3rd year, or in the 4th year, or in the 1st year. Based on this, this function has an argument called Period, which specifies the year you want to find out the interest earned in. The syntax of the IPMT() function is: IPMT(Rate, Period, NPeriods, PresentValue, FutureValue, PaymentType) The Rate argument is a fixed percent value applied during the life of the loan. The PresentValue is the current value of the loan or investment. It could be the marked value of the car, the current mortgage value of a house, or the cash amount that a bank is lending. The FutureValue is the value the loan or investment will have when the loan is paid off. The NPeriods is the number of periods that occur during the lifetime of the loan. For example, if a car is financed in 5 years, this value would be (5 years * 12 months each =) 60 months. When passing this argument, you must remember to pass the right amount. The Period argument represents the payment period. For example, it could be 3 to represent the 3rd year of a 5 year loan. In this case, the IPMT() function would calculate the interest earned in the 3rd year only. The PaymentType specifies whether the periodic (such as monthly) payment of the loan is made at the beginning (1) or at the end (1) of the period. The FutureValue and the PaymentType arguments are not required.

Practical Learning: Calculating the Monthly Payments of a Loan

1. To add a new worksheet, on the main menu, click Insert -> Worksheet 2. Double-click the new Sheet1 tab to put it in edit mode. Type Periodic Interest Earnedand press Enter 3. Move the new worksheet to be the most right 4. Complete the worksheet as follows

5. Click cell C9 and type =IPMT( 6. Click cell C5 and type /12, 7. Click cell C6 and type , 8. Click cell C7 and type ,9. Click cell C4 and type , 10. Click cell C8 and type , 11. Type ,0) and, on the Formula Bar, click the Enter button

12. Save the workbook The Amount Paid as Principal

While the IPMT() function calculates the amount paid as interest for a period of a loan or an investment, the PPMT() function calculates the actual amount that applies to the balance of the loan. This is referred to as the principal. Its syntax is: PPMT(Rate, Period, NPeriods, PresentValue, FutureValue, PaymentType) The arguments are the same as described in the previous sections. Practical Learning: Evaluating the Amount Paid As Principal

1. Change the Periodic Interest Earned worksheet as follows

2. Click cell C10 and type =PPMT( 3. Click cell C5 and type /12, 4. Click cell C6 and type , 5. Click cell C7 and type ,6. Click cell C4 and type , 7. Click cell C8 and type , 8. Type ,0) and, on the Formula Bar, click the Enter button

9. Save the workbook The Present Value of a Loan or an Investment

The PV() function calculates the total amount that a future investment is worth currently. Its syntax is: PV(Rate, NPeriods, Payment, FutureValue, PaymentType) The arguments are the same as described earlier. The Interest Rate

Suppose a customer comes to a car dealer and wants to buy a car. The salesperson would first present the available cars to the customer so the customer can decide what car he likes. After this process and during the evaluation, the sales person may tell the customer that the monthly payments would be $384.48. The customer may then say, "Wooooh, I can't afford that, man". Then the salesperson would ask, "What type of monthly payment suits you". From now on, both would continue the discussion. Since the salesperson still wants to make some money but without losing the customer because of a high monthly payment, the salesperson would need to find a reasonable rate that can accommodate an affordable monthly payment for the customer. The RATE() function is used to calculate the interest applied on a loan or an investment. Its syntax

is: RATE(NPeriods, Payment, PresentValue, FutureValue, PaymentType, Guess) All of the arguments are the same as described for the other functions, except for the Guess. This argument allows you to give some type of guess for a rate. This argument is not required. If you omit it, its value is assumed to be 10.

Practical Learning: Calculating the Interest Rate

1. To add a new worksheet, on the main menu, click Insert -> Worksheet 2. Double-click the new Sheet1 tab to put it in edit mode. Type Interest Rate and press Enter 3. Move the new worksheet to be the most right 4. Change the Interest Rate worksheet as follows

5. Click cell C8 and type =-RATE( 6. Click cell C7 and type , 7. Click cell C6 and type ,8. Click cell C4 and type , 9. Click cell C5 and type ,0)*12 and, on the Formula Bar, click the Enter button

10. To use the ABS() function, change the function in cell C14 to =ABS(RATE(C7,C6,-C4, C5, 0)*12) and press Enter 11. Save the workbook The Internal Rate of Return

The IRR() function is used to calculate an internal rate of return based on a series of investments. Its syntax is: IRR(Values, Guess) The Values argument is a series (also called an array or a collection) of cash amounts that a customer has made on an investment. For example, a customer could make monthly deposits in a savings or credit union account. Another customer could be running a business and receiving different amounts of money as the business is flowing (or losing money). The cash flows don't have to be the same at different intervals but they should (or must) occur at regular intervals such as weekly (amount cut from a paycheck), bi-weekly (401k directly cut from paycheck), monthly (regular investment), or yearly (income). The Values argument must be passed as a collection of values, such as a range of selected cells, and not an amount. Otherwise you would receive an error. The Guess parameter is an estimate interest rate of return of the investment.

Practical Learning: Calculating the Internal Rate of Return

1. To add a new worksheet, on the main menu, click Insert -> Worksheet 2. Double-click the new Sheet1 tab to put it in edit mode. Type Internal Rate of Return and press Enter 3. Move the new worksheet to be the most right 4. Change the worksheet as follows

5. Click cell D12 and type =IRR( 6. Select cells D4:D10 and, on the Formula Bar, click the Enter button

7. In cell D11, type 12 and click cell D12 8. In the Formula Bar, change the function to =IRR(D4:D10, D11) and press Enter (you shouldn't need any significant difference unless you change the range of cells such as D4:D8) 9. Save the workbook

The Net Present Value

The NPV() function uses a series of cash flows to calculate the present value of an investment. Its syntax is: NPV(Rate, Value1, Value2, ...) The Rate parameter is the rate of discount during one period of the investment. As the NPV() function doesn't take a fixed number of arguments, you can add a series of values as Value1, Value2, etc. These are regularly made payments for each period involved. Because this function uses a series of payments, any payment made in the past should have a positive value (because it was made already). Any future payment should have a negative value (because it has not been made yet).

Practical Learning: Calculating the Net Present Value

1. To add a new worksheet, on the main menu, click Insert -> Worksheet 2. Double-click the new Sheet1 tab to put it in edit mode. Type Net Present Value and press Enter 3. Move the new worksheet to be the most right 4. Change the worksheet as follows

5. Click cell C14 and type =-NPV( 6. Click cell C13 and type , 7. Select cells C4:C12 and, on the Formula Bar, click the Enter button

8. To use the ABS() function, change the function in cell C14 to =ABS(NPV(C13,C4:C12))and press Enter 9. Save the workbook

Date Functions Many, if not most, worksheets use dates in one manner or another. This page describes a number of worksheet functions related to dates. The downloadable workbook contains all of these functions as well as VBA functions that perform the same tasks. Many of these formulas are array formulas and must be entered with CTRL SHIFT ENTER rather than just ENTER. They will not work correctly if you do not use CTRL SHIFT ENTER. See the array formulas page for an in-depth discussion of array formulas and how to use them.

Is A Year A Leap Year? The following formula tests whether the year in B11 is a leap year and returns either TRUE or FALSE.

=DAY(DATE(B11,2,29))=29 Day Of Year The following formula returns the current day of the year in A1. =A1-DATE(YEAR(A1),1,1)+1 Days In A Month The following formula returns the number of days in the month in C16 and year in B16. This works because the 0th day of the next month is the last day of the current month. =DAY(DATE(B16,C16+1,0)) First Day Of Month The following formula returns the date of the first day of the month using the year in B21 and month inC21. =DATE(B21,C21,1) Last Day Of Month The following formula returns the date of the last day of the month using the year in B27 and month inC27. This works because the 0th day of the next month is the last day of the current month. =DATE(B27,C27+1,0) First Weekday Of Month The following formula returns the first weekday (Monday - Friday) of the month where cell B84 is the year and C84 is the month. Change the values within the CHOOSE function if your work week is other than Monday through Friday. The values in the CHOOSE function are the number of days to add to the date based on the weekday. So, the first 1 in the CHOOSE list indicates that for Sunday, add one day. For Monday - Friday, add 0 days. For Saturday, add 2 days. Adjust these values to fit your work week. =DATE(B84,C84,1)+CHOOSE(WEEKDAY(DATE(B84,C84,1)),1,0,0,0,0,0,2) Last Weekday Of Month The following formula returns the last weekday (Monday - Friday) of the month where cell B89 is the year and C89 is the month. Change the values within the CHOOSE function if your work week is other than Monday through Friday. The values in the CHOOSE function are the number of days to add to the date based on the weekday. So, the first 1 in the CHOOSE list indicates that for Sunday, add one day.

For Monday - Friday, add 0 days. For Saturday, add 2 days. Adjust these values to fit your work week. =DATE(B89,C89+1,0)-CHOOSE(WEEKDAY(DATE(B89,C89+1,0)),2,0,0,0,0,0,1) Count Of Day-Of-Week In Period The following array formula counts the number of day of week in an interval. The start date is in B33, the end date is in C33 and the day of the week (1 = Sunday, 2 = Monday, ..., 7 = Saturday) is in D33. For example, you can calculate the number of Mondays between 15-Janary-2011 and 15-April-2011 (equals 13). =SUM(--(WEEKDAY(ROW(INDIRECT(WEEKDAY(B33)&":"&C33B33+WEEKDAY(B33))))=D33)) Count Of Day-Of-Week In A Month The following array formula counts the number of days of the week in one month. With any date of the month in question in cell B38 and the day of week (1 = Sunday, 2 = Monday, ..., 7 = Saturday) inC38. For example, you can calculate the number of Mondays in January-2011 (equals 5). =SUM(--(WEEKDAY(ROW(INDIRECT(WEEKDAY(DATE(YEAR(B38),MONTH(B38),1))& ":"&DATE(YEAR(B38),MONTH(B38)+1,0)DATE(YEAR(B38),MONTH(B38),1)+WEEKDAY(DATE(YEAR(B38),MONTH(B38),1)))))=C38)) Nth Day Of Week In A Month The following array formula will return the Nth (e.g. first, second, etc) day of week (1 = Sunday, 2 = Monday, ..., 7 = Saturday) for the year specified in cell B43, the month in C43, day of the week inD43, and Nth in E43. For example, you can find the date of the 3rd Monday of January-2011 (equals 17-Jan2011). =DATE(B43,C43,1+((E43-(D43>=WEEKDAY(DATE(B43,C43,1))))*7)+(D43WEEKDAY(DATE(B43,C43,1)))) Nth Day Of Week In A Year The following array formula will return the Nth (e.g. first, second, etc) day of week (1 = Sunday, 2 = Monday, ..., 7 = Saturday) for the year specified in cell B48, the day of week in C48, and Nth in D43. For example, you can find the date of the 10th Monday of 2011 (equals 7-March-2011). =DATE(B48,1,1+(D48-(C48>=WEEKDAY(DATE(B48,1,1))))*7)+C48WEEKDAY(DATE(B48,1,1)) Next Nth Day Of Week The following formula will return the date of the next Nth day of week (Sunday = 1, Monday = 2, ..., 7 =

Saturday) from the start date. The start date is specified in cell B53, the N in C53, and day of week in D53. For example, you can find the date of the 6th Monday following 14-January-2011 (equals 21February-2011). =B53+D53-WEEKDAY(B53)+(7*(D53<WEEKDAY(B53)))+(7*(C53-1)) Previous Nth Day Of Week The following formula will return the date of the previous Nth day of week (Sunday = 1, Monday = 2, ..., 7 = Saturday) from the start date. The start date is specified in cell B59, the N in C59, and day of week in D59. For example, you can find the date of the 6th Monday before 14-January-2011 (equals 6December-2010). =B59+D59-WEEKDAY(B59)+(7*(D59<WEEKDAY(B59)))-(7*C59) Next Workday Following A Date The following array formula returns the next workday (Monday - Friday) following a date. The start date is in cell B64. Change the values in the CHOOSE function if your work week is something other than Monday through Friday. =B64+CHOOSE(WEEKDAY(B64),1,0,0,0,0,0,2) Previous Workday Following A Date The following formula returns the previous workday (Monday - Friday) before a date. The start date is in cell B69. Change the values in the CHOOSE function if your work week is something other than Monday through Friday. =B69-CHOOSE(WEEKDAY(B69),2,0,0,0,0,0,1) First Day Of Week In A Month And Year The following formula returns the date of the first day of week in a month and year. B94 contains the year, C94 contains the month, and D94 contains the day of week (Sunday = 1, Monday = 2, ..., 7 = Saturday). For example, the first Thursday in February, 2011 is 3-February-2011. =DATE(B94,C94,1+((1-(D94>=WEEKDAY(DATE(B94,C94,1))))*7)+(D94WEEKDAY(DATE(B94,C94,1)))) Last Day Of Week In A Month And Year The following formula returns the date of the last day of week in a month and year. B100 contains the year, C100 contains the month, and D100 contains the day of week (Sunday = 1, Monday = 2, ..., 7 = Saturday). For example, the last Thursday in February, 2011 is 24-February-2011.

=DATE(B100,C100,1+((1-(D100>=WEEKDAY(DATE(B100,C100,1))))*7)+ (D100WEEKDAY(DATE(B100,C100,1))))+(7*(SUM(-(WEEKDAY(ROW(INDIRECT("1:"&DATE(B100,C100+1,0)-DATE(B100,C100,1)+1)))=D100))1)) Year Quarter The following array formula returns the quarter number of a month in cell B74 and the month in which quarter 1 begins in cell C74. For example, if quarter 1 begins in July, January is in the 4th quarter. =IF(B74<C74,INDEX(ROUNDUP(ROW(INDIRECT("1:12"))/3,0),(13C74)+B74,1),ROUNDUP((B74-C74+1)/3,0)) Easter The following formula returns date of Easter for the year in cell B79. This is valid for years 1901 through 2099. =FLOOR("5/"&DAY(MINUTE(B79/38)/2+56)&"/"&B79,7)-34

Create a macro

Method One: Excel 2007 and 2010 1. 1

Click the Developer tab on the Ribbon at the top of the screen. If the tab is not showing up on your screen, you can add it as follows:
o o

For Excel 2010: click the File Tab then select options. On the left hand side of the Excel options dialog box, click Customize Ribbon. Then, on the right hand side box select Developer. For Excel 2007: click the Microsoft Office button, then Excel Options. In the Popular category, under Top Options for Working with Excel, select Show Developer Tab in Ribbon. 2. 2

Change the security settings. In the Code group of the Developer tab, click Macro Security. Under Macro Settings, click Enable All Macros, then click OK.
o

Note that this security setting is not ideal for basic use. When you've finished creating your macro, go back and unclick Enable All Macros. 3. 3

Click Record Macro. You'll find it on the Developer tab under Code. 4. 4

Name your macro. The first character of the name must be a letter; after that, you can use characters, numbers and underscores. Macro names cannot have spaces.
o

Don't use the same name for your macro as an existing cell reference. 5. 5

Set a shortcut for your macro (optional). Type a letter in the Shortcut Key box. A lowercase letter will translate to CTRL + letter; an uppercase letter will be CTRL + SHIFT + letter. 6. 6

Choose where to store your macro. In the Store Macro In list, select the workbook where you want to store the macro. If you want it to be available whenever you run Excel, select Personal Macro Workbook. 7. 7

Describe your macro. Write this in the Description box. 8. Click OK to start recording your macro. 9. Perform the actions you want the macro to record. 10. 10 Stop recording. Go to the Developer tab, click Code, then click Stop Recording 9 8

Method Two: Excel 2003 1. 1

Change the security level. Switch the security level from Medium to Low. Click Tools -> Options -> Security. Click Macro Security and select Security Level. Select Low.

2.

Start recording your macro. Navigate to Tools -> Macro -> Record New Macro. 3. 3

Name your macro. The character of the name must be a letter; after that, you can use symbols, numbers or underscores. No spaces are allowed.
o

Don't use the same name for your macro as an existing cell reference. 4. 4

Code a shortcut for your macro (optional). Enter a letter in the Shorcut Key box. A lowercase letter will make the shortcut CTRL + letter; uppercase will be CTRL + SHIFT + letter. 5. 5

Choose where to store your macro. In the Store Macro box, select a location for your macro. Click Personal Macro Workbook if you want it to be available whenever you open Excel. 6. 6

Write a description of your macro. When you're done, click OK. 7. 7

Record your macro. Remember, Record Macro is still on. Carry out the actions that you want Excel to record as your macro. 8. 8 Click Stop Recording. You can find this option on the Stop Recording toolbar.

UNIT -IV Using Microsoft Access Start by Creating a Blank Database

1. 2. 3. 4.

5.

6.

Click on the Start menu and select New Office Document. The New Office Document window appears. Click on Blank Database and then click OK. The File New Database window appears. Using the Save In text box, select the folder in which the file will be stored. In the File name text box, type a name for the database. This should be descriptive. Ideally, it should be one word, or if two words, should not contains spaces. Ensure that the Save As Type text box displays Microsoft Access Databases. Click the Create button. This will create a blank database with the name you selected, in the folder you specified. It will also open the Database window in which the word Database will be displayed in the title bar, along with the name of the database. Maximize the Database window. The Database window contains two main panes: the left pane contains the names of the various objects available in the database, and the right pane shows the actions that the user may instruct the database manager to carry out.

Create a Table 7. Before creating a table, it is wise to determine the record layout. If enough thought is not put into this aspect of the design, a good deal of time may be wasted and a great deal of frustration encountered. 8. To create a table, double-click on the icon named Create Table in Design view. This opens the table design window with a blank table. In the upper pane of this window, the user will create the design for a record. In the lower pane of the window, the user will specify details for each field. The upper pane has three headings: Field Name, Data Type, and Description. The upper pane is divided into rows. Each row will hold the definition of one field. The insertion point appears in the left column of the first row. 9. Type the first field name (avoid spaces where possible). If this is the Primary Key, click on the Primary Key button. Use the <Tab> key to move the insertion point to the Data Type column. The insertion point moves to the Data Type column where a drop-down list appears and the type Text appears as the default data type. a. If this is indeed the default data type, simply click in the Field Size text box in the lower pane, delete the field size (50) that appears there, and type the field size (that is, the number of characters that the database will be allowed to store for this field). Click in the Description column in the upper pane, in the same row in which the field name was typed, and type a description. It is a good idea to show the number of characters allowed for a text type.

b.

10. 11. 12.

If the default data type is NOT text, click on the drop-down list arrow, select the data type, and then type in the description. c. After typing the description, use the <Tab> button to move the insertion point to the next row. Repeat step 9 for each field in the table. Click on the Save button (the diskette button) to save the table. The Save As dialog box appears. Type a name for the table in the text box shown and click OK.

Entering Data 13. Click on the drop-down arrow of the View button on the Toolbar. This displays the views of the table that are available. So far, the design view had been in use. 14. Click on the datasheet view button. This will change the table view to datasheet view. In this view, all of the fields of a blank record are displayed. 15. Enter the first record by typing in the first field, then using the <Tab> key to move the insertion point to the next field. Continue to use the <Tab> key until information for all of the records has been entered. 16. Press the <Tab> key to move the insertion point to the second record. Table A table allows the user to store a collection of data about a specific topic like Customers or Orders

Query

A query allows the user to view, change, and analyze data in different ways like combining data from two different tables (Customers and Orders) to create a users own custom view (London Orders for April) Can also be used as the source of records for forms, reports, and data access pages.

Form A form allows a user to enter/change/update data to table(s)

Report format in the way you want it

UNIT -V Import, export, and link data between Access and Excel You can share data between Access and Excel in many ways. You can copy data from an openworksheet and paste it into an Access datasheet, import a worksheet into an Access database, or simply load an Access datasheet into Excel using the Analyze it with Excel command. This topic explains in detail how to exchange data between Access and Excel by importing, exporting, or linking to data. In this article
o o o o o

Import data from Excel Getting started with the import operation Other ways to bring Excel data into Access Link to data in Excel Getting started with the link operation Export Access data to Excel Getting started with the export operation Other ways to bring Access data into Excel Troubleshooting

Import data from Excel If your goal is to store some or all data in one or more Excel worksheets in Access, you should import the contents of the worksheet into a new or existing Access database. When you import data, Access creates a copy of the data in a new or existing table, without altering the source Excel file. Here are some common scenarios where you might want to import Excel data into Access:

You are a long-time user of Excel, and you are now thinking of moving to Access. You might start by importing your Excel worksheets into one or more new Access databases. You are a manager who receives reports in Excel format from your employees. You want to merge the reports with an existing database to update the contents of the database. You are a manager, and your employees send you weekly reports as Excel files. You want to automate the import operation, to save time. You are developing an application where you need to write code to import Excel data into Access. If this is the first time you are importing data from Excel, you should know the following:

Do not look for a way to save an Excel worksheet as an Access database. Microsoft Excel does not provide "save as" functionality to create an Access database with Excel data. To start the import operation, an Access database must already be open. If you want to import the data into a new database, you must create a blank database (that does not contain any tables, forms, or reports) before starting the importing operation. Data that is imported from a worksheet is stored in a new or existing table in the current database. If you are not familiar with tables or how a database is structured, see About tables (MDB) and About designing a database. When you open an Excel worksheet in Access (in the File Open dialog box, change the Files of Type list box to Microsoft Office Excel Files, and select the file you want), Access creates a link to the worksheet instead of importing its data. Linking to a worksheet is different from importing a worksheet into a database. For more information about linking, see the section Link to data in Excel, later in this topic. Getting started with the import operation Step 1: Identify the data that you want to import Step 2: Identify the destination database and table Step 3: Preparing the data for the import operation Step 4: Things you should know before importing certain data types and elements Step 5: Start the import operation

Step 6: Review the imported data and the error log table and take corrective action Other ways to bring Excel data into Access In addition to importing, you can use the following techniques to bring data from Excel into Access:

Link to Excel data. Linking does not create a copy of the data in Access, but lets you use Access to view data in an Excel worksheet. For more information about how to link to a worksheet, see the section Link to data in Excel, in this topic. Cut or copy data from Excel and paste it into an Access table. For more information about how to cut or copy data in a worksheet, see Excel Help. Import data by writing code. You can write a macro or a Visual Basic for Applications (VBA) procedure to import data programmatically. For more information about how to do this, see Import data programmatically. Export Microsoft Excel data to an Extensible Markup Language (XML) file which can then be imported into Access. For more information about how to import XML data, see the section "Import data and schema from XML" in the Import or link data and objects topic.

Link to data in Excel If you don't want to maintain a copy of the data in your Access database, you can instead link to the Excel worksheet. Linking lets you connect to data in Excel without importing it, so that you can view the data in Access. You can update the data in the worksheet when you are working in Excel and your changes will be shown when you view the linked table in Access. When you link to a worksheet or a named range, Access creates a new table that is linked to the source cells. Linking has an advantage over importing when you change data in the Excel worksheet, the linked table in Access updates to reflect those changes. If this is the first time you are linking to an Excel worksheet, you should know the following:

You cannot create a link to an Access database from within Excel. You cannot link Excel data to an existing table in the database. When you create a link, Access creates a new table, often referred to as a linked table. The table shows the data in the source worksheet or named range, but it doesn't actually store the data in the database. A database can have multiple linked tables. Any change that you make to the data in Excel will be automatically reflected in the linked table. When you open an Excel worksheet in Access (In the File Open dialog box, change the Files of Type list box to Microsoft Office Excel Files, and select the file you want), Access creates a blank database, and automatically starts the Link Spreadsheet Wizard.

For more information on linking, see About linking data and database objects. Getting started with the link operation Step 1: Identify the data that you want to link Step 2: Identify the destination database and table Step 3: Preparing the data for the link operation Step 4: Things you should know before linking to certain data types and elements Step 5: Start the link operation Step 6: Review the linked table and take corrective action

Export Access data to Excel Often, you will come across situations where your data is stored in Access, but you need to move or copy it to Excel. For example, you might want to distribute your report to a group of users who prefer to view it in Excel. Or, you might want to analyze your Access data by taking advantage of the analysis features of Excel. In such situations, export the contents of your Access database to an Excel worksheet. You can export the following to Excel:

The data in a table, query, form, or report. The following illustration shows how the Catalog report in the Northwind Traders sample database will look after it has been exported to Excel:

All or some of the rows and columns in a datasheet view

The following illustration shows how a portion of the Employee table in datasheet view will look after it has been exported to Excel:

NOTE You cannot export multiple objects in a single export operation. However, you can merge the data in different worksheets and worksheets after completing the individual export operations. For more information, seeMerge workbooks and Move (cut) or copy cells or cell data in Excel Help. Getting started with the export operation Step 1: Identify the data that you want to export Step 2: Decide where to start the export operation Step 3: Identify the destination file for the export operation Step 4: Things you should know before exporting certain data types and controls Step 5: Start the export operation Step 6: Review the Excel worksheet Other ways to bring Access data into Excel In addition to exporting, you can use the following techniques to bring data into Excel from Access.

Cut or copy data from Access and paste it into an Excel worksheet. For more information about how to do this, see the section "Copy or move records or data from multiple fields in Microsoft Access to another application" in the topic Copy or move data. Export data by using code. You can write a macro or a Visual Basic for Applications (VBA) procedure to export data programmatically. For more information about how to do this, see Export data programmatically. Load Access data in an instance of Excel.

You might also like