1 / 64

MS Excel 2003

MS Excel 2003. Part 2. Creating and Using Lists. What is a list?. A list is essentially an organized collection of information. More specifically, a list consists of a row of headers (descriptive text) followed by additional rows of data, which can be values or text.

emelda
Télécharger la présentation

MS Excel 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MS Excel 2003 Part 2

  2. Creating and Using Lists

  3. What is a list? • A list is essentially an organized collection of information. • More specifically, a list consists of a row of headers (descriptive text) followed by additional rows of data, which can be values or text. • You can also think of a list as a database table that is stored in a worksheet. • People often refer to the columns in a list as fields and to the rows as records.

  4. List Example

  5. Designing a List • The following are some guidelines to keep in mind when creating lists: • Insert descriptive labels (one for each column) in the first row of the list. This is the header row. • Each column should contain the same type of information. For example, don’t mix dates and text in a single column. • Don’t use any empty rows within the list. For list operations, Excel determines the list boundaries automatically, and an empty row signals the end of the list. • Select the upper-left data cell and choose Window➪Freeze Panes to make sure that the headings are visible when the list is scrolled. • You can preformat entire columns to ensure that the data has the same format. For example, if a column contains dates, format the entire column with the desired date format.

  6. Entering Data into a List • Entering data into a list can be done in three ways: ✦ Manually, using all standard data entry techniques ✦ By importing it or copying it from another file ✦ By using a dialog box • There’s really nothing special about entering data into a list. You just navigate through the worksheet and enter the data into the appropriate cells. • If you prefer to use a dialog box for your data entry, Excel accommodates you. To bring up a data entry dialog box, move the cell pointer anywhere within the list and choose Data➪Form. Excel determines the extent of your list and displays a dialog box showing each field in the list.

  7. Entering Data into a List (Contd.)

  8. Entering data with the Data Form dialog box • When the Data Form dialog box appears, the first record in the list is displayed. • To enter a new record, click the New button to clear the fields. Then you can enter the new information into the appropriate fields. Use Tab to move among the fields. • When you click New (or Close), the data that you entered is appended to the bottom of the list. You also can press Enter, which is equivalent to clicking on the New button.

  9. Other uses for the Data Form dialog box • You can use the Data Form dialog box for more than just data entry. You can edit existing data in the list, view data one record at a time, delete records, and display records that meet certain criteria. • The dialog box contains a number of additional buttons, which are described as follows: ✦ Delete: Deletes the displayed record. ✦ Restore: Restores any information that you edited. You must click this button before you click on the New button. ✦ Find Prev: Displays the previous record in the list. If you entered a criterion, this button displays the previous record that matches the criterion. ✦ Find Next: Displays the next record in the list. If you entered a criterion, this button displays the next record that matches the criterion. ✦ Criteria: Clears the fields and lets you enter a criterion upon which to search for records.

  10. Filtering a List • Filtering a list is the process of hiding all rows in the list except those that meet some criteria that you specify. For example, displaying students who live in Peshawar only. • Excel provides two ways to filter a list: • ✦ AutoFilter for simple filtering criteria • ✦ Advance Filter for more-complex filtering

  11. Using autofiltering • To autofilter a list, start by moving the cell pointer anywhere within the list. • Then choose Data➪Filter➪AutoFilter. Excel analyzes your list and adds drop-down arrows to the field names in the header row. • When you click the arrow in one of these drop down lists, the list expands to show the unique items in that column. • Select an item, and Excel hides all rows except those that include the selected item. In other words, the list is filtered by the item that you selected. • After you filter the list, the status bar displays a message that tells you how many rows qualified. In addition, the drop-down arrow changes color to remind you that the list is filtered by a value in that column. • To move out of AutoFilter mode and remove the drop-down arrows from the field names, choose Data➪Filter➪AutoFilter again. This removes the check mark from the AutoFilter menu item and restores the list to its normal state.

  12. Autofiltering

  13. Creating Dynamic Lists with PivotTables

  14. Creating Dynamic Lists with PivotTables • Excel worksheets let you gather and present important data, but the standard worksheet can’t be changed from its original configuration easily. That means you cannot easily exchange the data of rows and columns. • You can use an Excel tool to reorganize and redisplay your data dynamically. You can create a PivotTable, or dynamic worksheet, that lets you reorganize and filter your data on the fly. • To create a PivotTable, you must have your data collected in a list.

  15. Creating Dynamic Lists with PivotTables (Contd.) • Consider the following data. To create a PivotTable, you must have your data collected in a list in which every row represents a cell in the body of the finished PivotTable. Once you have created a list, you can click any cell in that list, open the Data menu, and click PivotTable and PivotChart Report to launch the PivotTable and PivotChart Wizard.

  16. Creating Dynamic Lists with PivotTables (Contd.)

  17. Creating Dynamic Lists with PivotTables (Contd.) • On this wizard page, you identify the data source for your PivotTable and whether you want to create a PivotTable by itself or a PivotTable and a PivotChart. Clicking Next accepts the default choices and moves you to the second wizard screen.

  18. Creating Dynamic Lists with PivotTables (Contd.) • On this screen, you verify that the wizard has correctly identified the cells with the data for your PivotTable. If not, you can click the Collapse Dialog button in the Range box, select the cells that contain your data, and then expand the dialog box to continue. Once the proper cell range is listed in the Range box, click Next to move to the final wizard screen.

  19. Creating Dynamic Lists with PivotTables (Contd.) • This wizard screen asks whether you want to create your PivotTable in a new or an existing worksheet. Because the data lists used to create PivotTables are usually quite long, it is often best to create the PivotTable in a new worksheet. Clicking Finish closes the wizard; creates a new worksheet in your workbook; and adds a PivotTable, the PivotTable toolbar, and the Pivot Table Field List dialog box to that worksheet.

  20. Creating Dynamic Lists with PivotTables (Contd.)

  21. Creating Dynamic Lists with PivotTables (Contd.) • To assign a field, or column in a data list, to an area of the PivotTable, you drag the field head to the desired area on the PivotTable outline. For example, you can drag the Week field head to the Drop Row Fields Here box, drag the Day field head to the Drop Row Fields Here box, drag the Hour field head to the Drop Column Fields Here box, and then drag the Sales field head to the Drop Data Items Here box to populate the body of the PivotTable with data. After you drop a field head in the Drop Data Items Here box, the PivotTable fills with data.

  22. Creating Dynamic Lists with PivotTables (Contd.)

  23. To format PivotTable data • Select the cells in the PivotTable data area. • On the Format menu, click Cells. • Use the controls in the Format Cells dialog box to format the cells in the PivotTable, and click OK. To apply a predefined format to a PivotTable • If the PivotTable toolbar is hidden, right-click any toolbar and then, from the shortcut menu that appears, click PivotTable. • Click any cell in the PivotTable. • On the PivotTable toolbar, click the Format Report button. • Click the desired AutoFormat.

  24. To apply a predefined format to a PivotTable

  25. Editing PivotTables • After you have created a PivotTable, you can edit it to control how your data is displayed. • To open a PivotTable for editing, you click any cell in the PivotTable and then, if necessary, display the fields available for the PivotTable by clicking the Show Field List button on the PivotTable toolbar. • While the PivotTable Field List dialog box is open, you can drag any field name from the dialog box to the active PivotTable. Dragging a field name to the Drop Page Fields Here box doesn’t change how the data in your PivotTable is arranged, but it does let you filter your PivotTable based on the contents of the field. • Clicking a field head’s down arrow displays a list of values in the field. Clicking any of these values and then clicking OK limits the data shown in the PivotTable to data gathered on the selected weekday. • To remove a filter from a PivotTable, click the down arrow of the field head used to filter the PivotTable, click (All), and then click OK.

  26. Functions and Formulas

  27. Understanding Relative Reference Format • When you use a cell reference in a formula, Excel looks at the cell address relative to the location of the formula. • For example, suppose that you have the formula =A1*2 in cell A3. To Excel, this formula says, “Multiply the contents of the cell two rows above this one by 2.” This is called the relative reference format, and it’s the default format for Excel. • This means that if you copy this formula to cell A4, the relative reference is still “Multiply the contents of the cell two rows above this one by 2,” but the formula changes to =A2*2 because A2 is two rows above A4. • This way of handling copy operations will save you incredible amounts of time when you’re building your worksheet models.

  28. Understanding Absolute Reference Format • When you refer to a cell in a formula using the absolute reference format, Excel uses the physical address of the cell. • You tell the program that you want to use an absolute reference by placing dollar signs ($) before the row and column of the cell address. • Talking about the old example, Excel interprets the formula =$A$1*2 as “Multiply the contents of cell A1 by 2.” • No matter where you copy or move this formula, the cell reference doesn’t change. The cell address is said to be anchored.

  29. Naming Formulas • Follow these steps to name a formula: • Choose Insert, Name, Define Name to display the New Name dialog box. • Enter the name you want to use for the formula in the Name text box. • In the Refers To box, enter the formula exactly as you would if you were entering it in a worksheet. • Click OK.

  30. Functions • Excel has various function categories, including the following: • Text • Logical • Information • Lookup and reference • Date and time • Math and trigonometry • Statistical • Financial • Database and table

  31. Typing a Function into a Formula • Whether you use a function on its own or as part of a larger formula, here are a few rules and guidelines to follow: • You can enter the function name in either uppercase or lowercase letters. Excel always converts function names to uppercase. • Always enclose function arguments in parentheses. • Always separate multiple arguments with commas. (You might want to add a space after each comma to make the function more readable. Excel ignores the extra spaces.) • You can use a function as an argument for another function. This is called nesting functions. For example, the function AVERAGE(SUM(A1:A10), SUM(B1:B15)) sums two columns of numbers and returns the average of the two sums

  32. Using the IF() Function (The Simplest Case) • Let’s start with the simplest version of the IF() function: • IF(logical_test, value_if_true) • logical_test: A logical expression—that is, an expression that returns TRUE or FALSE (or their equivalent numeric values: 0 for FALSE and any other number for TRUE). • value_if_true: The value returned by the function if logical_test evaluates to TRUE. • For example, consider the following formula: =IF(A1 >= 1000, “It’s big!”)

  33. IF() Function (Handling a FALSE Result) • IF(logical_test, value_if_true, value_if_false) • logical_test: A logical expression. • value_if_true: The value returned by the function if logical_test evaluates to TRUE. • value_if_false: The value returned by the function if logical_test evaluates to FALSE. • For example, consider the following formula: =IF(A1 >= 1000, “It’s big!”, “It’s not big!”)

  34. IF() Function (Avoiding Division by Zero) • Excel displays the #DIV/0! error if a formula tries to divide a quantity by zero. To avoid this error, you can use IF() to test the divisor and ensure that it’s nonzero before performing your division. • For example, the basic equation for calculating gross margin is (Sales – Expenses)/Sales. To make sure that Sales isn’t zero, use the following formula: • =IF(Sales <> 0, (Sales - Expenses)/Sales, “Sales are zero!”)

  35. Performing Multiple Logical Tests • Excel offers several techniques for performing two or more logical tests: nesting IF() functions, the AND() function, and the OR() function.

  36. Nesting IF() Functions • When building models using IF(), it’s common to come upon a second fork in the road when evaluating either the value_if_true or value_if_false arguments. • For example, consider the variation of our formula that outputs a description based on the value in cell A1: =IF(A1 >= 1000, “Big!”, “Not big”) • What if you want to return a different string for values greater than, say, 10,000? In other words, if the condition A1 > 1000 proves to be true, you want to run another test that checks to see if A1 > 10000. • You can handle this scenario by nesting a second IF() function inside the first as the value_if_true argument: =IF(A1 >= 1000, IF(A1 >= 10000, “Really big!!”, “Big!”), “Not big”) • For example, if you want to return the description Small for a cell value less than 100, you would use this version of the formula: • =IF(A1 >= 1000, “Big!”, IF(A1 < 100, “Small”, “Not big”))

  37. The AND() Function • It’s often necessary to perform an action if and only if two conditions are true. • The AND() result is calculated as follows: • If all the arguments return TRUE (or any nonzero number), AND() returns TRUE. • If one or more of the arguments return FALSE (or 0), AND() returns FALSE. • You can use the AND() function anywhere you would use a logical formula, but it’s most often pressed into service as the logical condition in an IF() function. • In other words, if all the logical conditions in the AND() function are TRUE, IF() returns its value_if_true result; if one or more of the logical conditions in the AND() function are FALSE, IF() returns its value_if_false result. Here’s an example: • =IF(AND(B2 > 0, C2 > 0), “1000”, “No bonus”)

  38. The OR() Function • The OR() result is calculated as follows: • If one or more of the arguments return TRUE (or any nonzero number), OR() returns TRUE. • If all of the arguments return FALSE (or 0), OR() returns FALSE. • As with AND(), you use OR() wherever a logical expression is called for, most often within an IF() function. • This means that if one or more of the logical conditions in the OR() function are TRUE, IF() returns its value_if_true result; if all of the logical conditions in the OR() function are FALSE, IF() returns its value_if_false result. • Here’s an example: =IF(OR(B2 > 0, C2 > 0), “1000”, “No bonus”)

  39. Working with Lookup Functions • In many worksheet formulas, the value of one argument often depends on the value of another. Here are some examples: • In a formula that calculates an invoice total, the customer’s discount might depend on the number of units purchased. • In a formula that charges interest on overdue accounts, the interest percentage might depend on the number of days each invoice is overdue. • The usual way to handle these kinds of problems is to look up the appropriate value.

  40. Understanding Lookup Tables • The table—more properly referred to as a lookup table—is the key to performing lookup operations in Excel. • The most straightforward lookup table structure is one that consists of two columns (or two rows): • Lookup column—This column contains the values that you look up. For example, if you were constructing a lookup table for a dictionary, this column would contain the words. • Data column—This column contains the data associated with each lookup value. In the dictionary example, this column would contain the definitions. • In most lookup operations, you supply a value that the function locates in the designated lookup column. It then retrieves the corresponding value in the data column.

  41. The CHOOSE() Function • The simplest of the lookup functions is CHOOSE(), which enables you to select a value from a list. Specifically, given an integer n, CHOOSE() returns the nth item from the list. Here’s the function’s syntax: • CHOOSE(num, value1[, value2,...]) • Num: Determines which of the values in the list is returned. If num is 1, value1 is returned; if num is 2, value2 is returned (and so on). num must be an integer (or a formula or function that returns an integer) between 1 and 29. • value1, value2...: The list of up to 29 values from which CHOOSE selects the return value. The values can be numbers, strings, references, names, formulas, or functions. • For example, consider the following formula: =CHOOSE(2,”Surface Mail”, “Air Mail”, “Courier”) • The num argument is 2, so CHOOSE() returns the second value in the list, which is the string value Air Mail.

  42. Looking Up Values in Tables • CHOOSE() does have its drawbacks: • The lookup values must be positive integers. • The maximum number of data values is 29. • Only one set of data values is allowed per function. • Excel can use a wider variety of lookup values (negative or real numbers, strings, and so on), and it can also accommodate multiple data sets that each can have any number of values (subject, of course, to the worksheet’s inherent size limitations). • Excel has two functions that meet these criteria: VLOOKUP() and HLOOKUP().

  43. The VLOOKUP() Function • The VLOOKUP() function works by looking in the first column of a table for the value you specify. (The V in VLOOKUP() stands for vertical.) • It then looks across the appropriate number of columns (which you specify) and returns whatever value it finds there. • Here’s the full syntax for VLOOKUP(): • VLOOKUP(lookup_value, table_array, col_index_num) • lookup_value: This is the value you want to find in the first column of table_array. You can enter a number, string, or reference. • table_array: This is the table to use for the lookup. You can use a range reference or a name. • col_index_num: If VLOOKUP() finds a match, col_index_num is the column number in the table that contains the data you want returned (the first column—that is, the lookup column—is 1, the second column is 2, and so on).

  44. The VLOOKUP() Function (Contd.) • If VLOOKUP() doesn’t find a match in the lookup column, it returns #N/A. • If col_index_num is less than 1, VLOOKUP() returns #VALUE!; if col_index_num is greater than the number of columns in table, VLOOKUP() returns #REF!.

  45. VLOOKUP Example

  46. The HLOOKUP() Function • The HLOOKUP() function is similar to VLOOKUP(), except that it searches for the lookup value in the first row of a table. (The H in HLOOKUP() stands for horizontal.) • If successful, this function then looks down the specified number of rows and returns the value it finds there. • Here’s the syntax for HLOOKUP(): • HLOOKUP(lookup_value, table_array, row_index_num) • lookup_value: This is the value you want to find in the first row of table_array. You can enter a number, string, or reference. • table_array: This is the table to use for the lookup. You can use a range reference or a name. • row_index_num: If HLOOKUP() finds a match, row_index_num is the row number in the table that contains the data you want returned (the first row—that is, the lookup row—is 1, the second row is 2, and so on).

  47. HLOOKUP Example

  48. Math & Statistical Functions

  49. The ROUND() Function • The rounding function you’ll use most often is ROUND(): • ROUND(number, num_digits) • number: The number you want to round • num_digits: An integer that specifies the number of digits you want number rounded to, as explained here:

More Related