Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 124 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
124
Dung lượng
5,47 MB
Nội dung
FIGURE 14-18 Excel offers several pasting options. Using the Paste Special Dialog box For maximum flexibility in what gets pasted, choose Home ➪ Clipboard ➪ Paste (bottom half of button)➪Paste Special to display the Paste Special dialog box (see Figure 14-19). You also can right-click and select Paste Special to display this dialog box. This dialog box has several options, which I explain in the following list. Excel actually has several different Paste Special dialog boxes. The one displayed depends on what’s copied. This section describes the Paste Special dialog box that appears when a range or cell has been copied. FIGURE 14-19 The Paste Special dialog box. NOTE NOTE 329 Essential Worksheet and Cell Range Operations 14 20 046913 ch14.qxp 5/2/07 9:07 PM Page 329 For the Paste Special command to be available, you need to copy a cell or range. (Choosing Home ➪ Clipboard ➪ Cut doesn’t work.) n All: Pastes the cell’s contents, formats, and data validation from the Windows Clipboard. n Formulas: Pastes values and formulas, with no formatting. n Values: Pastes values and the results of formulas (no formatting). The destination for the copy can be a new range or the original range. In the latter case, Excel replaces the original formulas with their current values. n Formats: Copies only the formatting. n Comments: Copies only the cell comments from a cell or range. This option doesn’t copy cell contents or formatting. n Validation: Copies the validation criteria so the same data validation will apply. Data validation is applied by choosing Data ➪ Data Tools ➪ Data Validation. n All Using Source Theme: Pastes everything, but uses the formatting from the document theme of the source. This option is relevant only if you’re pasting information from a different work- book, and the workbook uses a different document theme than the active workbook. n All Except Borders: Pastes everything except borders that appear in the source range. n Column Widths: Pastes only column width information. n Formulas And Number Formats: Pastes all values, formulas and number formats (but no other formatting). n Values And Number Formats: Pastes all values and numeric formats, but not the formulas themselves. In addition, the Paste Special dialog box enables you to perform other operations, described in the follow- ing sections. Performing mathematical operations without formulas The option buttons in the Operation section of the Paste Special dialog box let you perform an arithmetic operation. For example, you can copy a range to another range and select the Multiply operation. Excel multiplies the corresponding values in the source range and the destination range and replaces the destina- tion range with the new values. This feature also works with a single copied cell, pasted to a range. Assume that you have a range of values, and you want to increase each value by 5 percent. Enter 105% into any blank cell and copy that cell to the Clipboard. Then select the range of values and bring up the Paste Special dialog box. Select the Multiply option, and each value in the range is multiplied by 105 percent. If the destination range contains formulas, the formulas are also modified. In many cases, this is not what you want. Skipping blanks when pasting The Skip Blanks option in the Paste Special dialog box prevents Excel from overwriting cell contents in your paste area with blank cells from the copied range. This option is useful if you’re copying a range to another area but don’t want the blank cells in the copied range to overwrite existing data. WARNING WARNING TIP TIP 330 Making the Numbers Work with Excel Part III 20 046913 ch14.qxp 5/2/07 9:07 PM Page 330 Transposing a range The Transpose option in the Paste Special dialog box changes the orientation of the copied range. Rows become columns, and columns become rows. Any formulas in the copied range are adjusted so that they work properly when transposed. Note that you can use this check box with the other options in the Paste Special dialog box. Figure 14-20 shows an example of a horizontal range (A1:F1) that was transposed to a vertical range (A3:A8). FIGURE 14-20 Transposing a range changes the orientation as the information is pasted into the worksheet. If you click the Paste Link button in the Paste Special dialog box, you create formulas that link to the source range. As a result, the destination range automatically reflects changes in the source range. Using Names to Work with Ranges Dealing with cryptic cell and range addresses can sometimes be confusing. (This confusion becomes even more apparent when you deal with formulas, which I cover in Chapter 15.) Fortunately, Excel allows you to assign descriptive names to cells and ranges. For example, you can give a cell a name such as Interest_ Rate, or you can name a range JulySales. Working with these names (rather than cell or range addresses) has sev- eral advantages: n A meaningful range name (such as Total_Income) is much easier to remember than a cell address (such as AC21). n Entering a name is less error-prone than entering a cell or range address. n You can quickly move to areas of your worksheet either by using the Name box, located at the left side of the Formula bar (click the arrow to drop down a list of defined names) or by choosing Home ➪ Editing ➪ Find & Select ➪ Go To (or F5) and specifying the range name. n Creating formulas is easier. You can paste a cell or range name into a formula by using Formula Autocomplete, a new feature in Excel 2007. n Names make your formulas more understandable and easier to use. A formula such as =Income — Taxes is more intuitive than =D20 — D40. TIP TIP 331 Essential Worksheet and Cell Range Operations 14 20 046913 ch14.qxp 5/2/07 9:07 PM Page 331 Creating range names in your workbooks Excel provides several different methods that you can use to create range names. Before you begin, however, you should be aware of some important rules about what is acceptable: n Names can’t contain any spaces. You may want to use an underscore character to simulate a space (such as Annual_Total). n You can use any combination of letters and numbers, but the name must begin with a letter. A name can’t begin with a number (such as 3rdQuarter) or look like a cell reference (such as QTR3). If these are desirable names, you can precede the name with underscore: _3rd Quarter and _QTR3. n Symbols, except for underscores and periods, aren’t allowed. n Names are limited to 255 characters, but it’s a good practice to keep names as short as possible yet still meaningful and understandable. Excel also uses a few names internally for its own use. Although you can create names that override Excel’s internal names, you should avoid doing so. To be on the safe side, avoid using the following for names: Print_Area, Print_Titles, Consolidate_Area, and Sheet_Title. Using the New Name dialog box To create a range name, start by selecting the cell or range that you want to name. Then, choose Formulas ➪ Defined Names ➪ Define Name. Excel displays the New Name dialog box, shown in Figure 14-21. Note that this is a resizable dialog box. Drag a border to change the dimensions. FIGURE 14-21 Create names for cells or ranges by using the New Name dialog box. Type a name in the box labeled Name (or use the name that Excel proposes, if any). The selected cell or range address appears in the box labeled Refers To. Use the Scope drop-down to indicate the scope for the name. The scope indicates where the name will be valid, and it’s either the entire workbook, or a particular sheet. If you like, you can add a comment that describes the named range or cell. Click OK to add the name to your workbook and close the dialog box. Using the Name box A faster way to create a name is to use the Name box (to the left of the Formula bar). Select the cell or range to name, click the Name box, and type the name. Press Enter to create the name. (You must press Enter to actually record the name; if you type a name and then click in the worksheet, Excel doesn’t create the name.) If a name already exists, you can’t use the Name box to change the range to which that name refers. Attempting to do so simply selects the range. 332 Making the Numbers Work with Excel Part III 20 046913 ch14.qxp 5/2/07 9:07 PM Page 332 The Name box is a drop-down list and shows all names in the workbook. To choose a named cell or range, click the Name box and choose the name. The name appears in the Name box, and Excel selects the named cell or range in the worksheet. Using the Create Names From Selection dialog box You may have a worksheet that contains text that you want to use for names for adjacent cells or ranges. For example, you may want to use the text in column A to create names for the corresponding values in column B. Excel makes this task easy to do. To create names by using adjacent text, start by selecting the name text and the cells that you want to name. (These items can be individual cells or ranges of cells.) The names must be adjacent to the cells that you’re naming. (A multiple selection is allowed.) Then, choose Formulas ➪ Defined Names ➪ Create From Selection. Excel displays the Create Names From Selection dialog box, shown in Figure 14-22. The check marks in this dialog box are based on Excel’s analysis of the selected range. For example, if Excel finds text in the first row of the selection, it proposes that you create names based on the top row. If Excel didn’t guess correctly, you can change the check boxes. Click OK, and Excel creates the names. FIGURE 14-22 Use the Create Names From Selection dialog box to name cells using labels that appear in the worksheet. If the text contained in a cell would result in an invalid name, Excel modifies the name to make it valid. For example, if a cell contains the text Net Income (which is invalid for a name because it contains a space), Excel converts the space to an underscore character. If Excel encounters a value or a numeric formula where text should be, however, it doesn’t convert it to a valid name. It simply doesn’t create a name — and does not inform you of that fact. If the upper-left cell of the selection contains text and you choose the Top Row and Left Column options, Excel uses that text for the name of the entire data excluding the top row and left column. So, before you accept the names that Excel creates, take a minute to make sure that they refer to the correct ranges. If Excel creates a name that is incorrect, you can delete or modify it by using the Name Manager (described next). Managing names A workbook can have any number of names. If you have many names, you should know about the Name Manager, shown in Figure 14-23. CAUTION CAUTION NOTE NOTE 333 Essential Worksheet and Cell Range Operations 14 20 046913 ch14.qxp 5/2/07 9:07 PM Page 333 FIGURE 14-23 The Name Manager is new in Excel 2007. The Name Manager is a new feature in Excel 2007. The Name Manager appears when you choose Formulas ➪ Defined Names ➪ Name Manager (or press Ctrl+F3). The Name Manager has the following features: n Displays information about each name in the workbook. You can resize the Name Manager dialog box and widen the columns to show more information. You can also click a column head- ing to sort the information by the column. n Allows you to filter the displayed names. Clicking the Filter button lets you show only those names that meet a certain criteria. For example, you can view only the worksheet level names. n Provides quick access to the New Name dialog box. Click the New button to create a new name without closing the Name Manager. n Lets you edit names. To edit a name, select it in the list and then click the Edit button. You can change the name or the Refers To range or edit the comment. n Lets you quickly delete unneeded names. To delete a name, select it in the list and click Delete. Be extra careful when deleting names. If the name is used in a formula, deleting the name causes the formula to become invalid. (It displays #NAME?.) However, deleting a name can be undone, so if you find that formulas return #NAME? after you delete a name, choose Undo from the Quick Access Toolbar (or press Ctrl+Z) to get the name back. If you delete the rows or columns that contain named cells or ranges, the names contain an invalid refer- ence. For example, if cell A1 on Sheet1 is named Interest and you delete row 1 or column A, the name Interest then refers to =Sheet1!#REF! (that is, to an erroneous reference). If you use Interest in a for- mula, the formula displays #REF. The Name Manager is useful, but it has a shortcoming: It doesn’t let you display the list of names in a worksheet range so you can view or print them. Such a feat is possible, but you need to look beyond the Name Manager. TIP TIP CAUTION CAUTION NEW FEATURE NEW FEATURE 334 Making the Numbers Work with Excel Part III 20 046913 ch14.qxp 5/2/07 9:07 PM Page 334 To create a list of names in a worksheet, first move the cell pointer to an empty area of your worksheet — the list is created at the active cell position and overwrites any information at that location. Press F3 to dis- play the Paste Name dialog box, which lists all the defined names. Then click the Paste List button. Excel cre- ates a list of all names in the workbook and their corresponding addresses. Adding Comments to Cells Documentation that explains certain elements in the worksheet can often be helpful. One way to document your work is to add comments to cells. This feature is useful when you need to describe a particular value or explain how a formula works. To add a comment to a cell, select the cell and then choose Review ➪ Comments ➪ New Comment. Alternatively, you can right-click the cell and choose Insert Comment from the shortcut menu. Excel inserts a comment that points to the active cell. Initially, the comment consists of your name. Enter the text for the cell comment and then click anywhere in the worksheet to hide the comment. You can change the size of the comment by clicking and dragging any of its borders. Figure 14-24 shows a cell with a comment. FIGURE 14-24 You can add comments to cells to help clarify important items in your worksheets. Cells that have a comment display a small red triangle in the upper-right corner. When you move the mouse pointer over a cell that contains a comment, the comment becomes visible. You can control how comments are displayed. Access the Advanced tab of the Excel Options dia- log box. In the Display section, an option lets you turn off the comment indicators if you like. Formatting comments If you don’t like the default look of cell comments, select the comment text and use the Home ➪ Font and Home ➪ Alignment groups to make changes to the comment’s appearance. For even more formatting options, right-click the comment’s border and choose Format Comment from the shortcut menu. Excel responds by displaying the Format Comment dialog box, which allows you to change many aspects of its appearance. You also can display an image inside of a comment. Select the Colors and Lines tab in the Format Comment dialog box. Click the Color drop-down list in the Fill section and select Fill Effects. In the Fill Effects dialog box, click the Picture tab and then click the Select Picture Button to specify a graphics file. Figure 14-25 shows a comment that contains a picture. TIP TIP TIP TIP 335 Essential Worksheet and Cell Range Operations 14 20 046913 ch14.qxp 5/2/07 9:07 PM Page 335 FIGURE 14-25 This comment contains a graphic image. Reading comments To read all of the comments in a workbook, choose Review ➪ Comments ➪ Next. Click this command repeatedly to cycle through all the comments in a workbook. Choose Review ➪ Comments ➪ Previous to view the comments in reverse order. Hiding and showing comments If you want all cell comments to be visible (regardless of the location of the cell pointer), choose Review ➪ Comments ➪ Show All Comments. This command is a toggle; select it again to hide all cell comments. To toggle the display of an individual comments, select its cell and then choose Review ➪ Comments ➪ Show/Hide Comment. Editing comments To edit a comment, activate the cell, right-click, and then choose Edit Comment from the shortcut menu. When you’ve made your changes, click any cell. Deleting comments To delete a cell comment, activate the cell that contains the comment and then choose Review ➪ Comments ➪ Delete. Or, right-click and then choose Delete Comment from the shortcut menu. Summary This chapter taught essential skills dealing with worksheets, cells, and ranges. Among the wide variety of skills covered, you learned to create, copy, move, rename, and change the view of worksheets. You also learned to work with rows and columns within sheets, performing actions including resizing, inserting, and deleting rows and columns. The chapter moved on to teach you about cells and ranges, covering how to make various kinds of selections, to naming ranges and adding comments to cells. The next chapter moves on to covering formulas and functions to perform calculations. 336 Making the Numbers Work with Excel Part III 20 046913 ch14.qxp 5/2/07 9:07 PM Page 336 F ormulas are what make a spreadsheet program so powerful. If it weren’t for formulas, a spreadsheet would simply be a glorified word-processing docu- ment that has great support for tabular information. You use formulas in your Excel worksheets to calculate results from the data stored in the worksheet. When data changes, those formulas calculate updated results with no extra effort on your part. This chapter introduces formulas and functions and helps you get up to speed with this important element. Understanding Formula Basics A formula is entered into a cell. It performs a calculation of some type and returns a result, which is displayed in the cell. Formulas use a variety of opera- tors and worksheet functions to work with values and text. The values and text used in formulas can be located in other cells, which makes changing data easy and gives worksheets their dynamic nature. For example, you can see multiple scenarios quickly by changing the data in a worksheet and letting your formulas do the work. A formula can consist of any of these elements: n Mathematical operators, such as + (for addition) and * (for multiplication) n Cell references (including named cells and ranges) n Values or text n Worksheet functions (such as SUM or AVERAGE) When you’re working with a table, a new feature in Excel 2007 enables you to create formulas that use column names from the table — which can make your formulas much easier to read. I discuss table formulas later in this chapter. (See the section “Using Formulas in Tables.”) NEW FEATURE NEW FEATURE 337 IN THIS CHAPTER Understanding formula basics Entering formulas and functions into your worksheets Understanding how to use references in formulas Correcting common formula errors Tips for working with formulas Introducing Formulas and Functions 21 046913 ch15.qxp 5/2/07 9:07 PM Page 337 After you enter a formula, the cell displays the calculated result of the formula. The formula itself appears in the Formula bar when you select the cell, however. Following are a few examples of formulas: =150*.05 Multiplies 150 times 0.05. This formula uses only values and isn’t all that useful because it always returns the same result. You may as well just enter the value 7.5 into the cell. =A1+A2 Adds the values in cells A1 and A2. =Income–Expenses Subtracts the value in the cell named Expenses from the value in the cell named Income. =SUM(A1:A12) Adds the values in the range A1:A12. =A1=C12 Compares cell A1 with cell C12. If they are identical, the formula returns TRUE; otherwise it returns FALSE. Formulas always begin with the equal sign so that Excel can distinguish them from text. Using operators in formulas Excel lets you use a variety of operators in your formulas. Operators are symbols that indicate the type of math- ematical operation you want the formula to perform. Table 15-1 lists the operators that Excel recognizes. In addition to these, Excel has many built-in functions that enable you to perform additional calculations. TABLE 15-1 Operators Used in Formulas Operator Name + Addition - Subtraction * Multiplication / Division ^ Exponentiation & Concatenation = Logical comparison (equal to) > Logical comparison (greater than) < Logical comparison (less than) >= Logical comparison (greater than or equal to) <= Logical comparison (less than or equal to) <> Logical comparison (not equal to) You can, of course, use as many operators as you need to perform the desired calculation. NOTE NOTE 338 Making the Numbers Work with Excel Part III 21 046913 ch15.qxp 5/2/07 9:07 PM Page 338 [...]... Interpretation (U.S Settings) 6-18-07 June 18, 2007 6-18 -2007 June 18, 2007 6/18/07 June 18, 2007 6/18 /2007 June 18, 2007 6-18/07 June 18, 2007 June 18, 2007 June 18, 2007 Jun 18 June 18 of the current year June 18 June 18 of the current year 6/18 June 18 of the current year 6-18 June 18 of the current year 18-Jun -2007 June 18, 2007 2007/6/18 June 18, 2007 As you can see in Table 16-1, Excel is rather... date serial number for June 1, 2007, is 392 34 Noon (halfway through the day) is represented internally as 392 34. 5 The serial number equivalent of one minute is approximately 0.0006 944 4 The formula that follows calculates this number by multiplying 24 hours by 60 minutes, and dividing the result into 1 The denominator consists of the number of minutes in a day (1 ,44 0) =1/( 24* 60) Similarly, the serial number... Work with Excel Choose Your Date System: 1900 or 19 04 E xcel actually supports two date systems: the 1900 date system and the 19 04 date system Which system you use in a workbook determines what date serves as the basis for dates The 1900 date system uses January 1, 1900, as the day assigned to date serial number 1 The 19 04 date system uses January 1, 19 04, as the base date By default, Excel for Windows... together For example, assume that Book1 uses the 19 04 date system and contains the date 1/15/1999 in cell A1 Assume that Book2 uses the 1900 date system and contains a link to cell A1 in Book1 Book2 displays the date as 1/ 14/ 1995 Both workbooks use the same date serial number ( 347 13), but they’re interpreted differently One advantage to using the 19 04 date system is that it enables you to display negative... cell B2 and the result is multiplied by cell B4: =(B2-B3)*B4 If you enter the formula without the parentheses, Excel computes a different answer Because multiplication has a higher precedence, cell B3 is multiplied by cell B4 Then this result is subtracted from cell B2, which isn’t what was intended The formula without parentheses looks like this: =B2-B3*B4 It’s a good idea to use parentheses even when... cell address Or you can use a handy shortcut: the F4 key When you’ve entered a cell reference (by typing it or by pointing), you can press F4 repeatedly to have Excel cycle through all four reference types 350 Introducing Formulas and Functions For example, if you enter =A1 to start a formula, pressing F4 converts the cell reference to =$A$1 Pressing F4 again converts it to =A$1 Pressing it again displays... June 18, 2007, you can simply enter the date by typing June 18, 2007 (or any of several different date formats) Excel interprets your entry and stores the value 39251, the date serial number for that date It also applies the default date format so that the cell contents may not appear exactly as you typed them Depending on your regional settings, entering a date in a format, such as June 18, 2007, may... moving border around cell A1, and the cell reference appears in cell A3 and in the Formula bar In addition, Excel displays Point in the status bar 4 Type a plus sign (+) A solid-color border replaces the faint border, and Enter reappears in the status bar 344 Introducing Formulas and Functions 5 Press the up arrow again, which puts the moving border around cell A2, and adds that cell address to the formula... rather intelligent when it comes to recognizing dates entered into a cell It’s not perfect, however For example, Excel does not recognize any of the following entries as dates: n June 18 2007 n Jun-18 2007 n Jun-18 /2007 Rather, it interprets these entries as text If you plan to use dates in formulas, make sure that Excel can recognize the date you enter as a date; otherwise, the formulas that refer... A1 If this value is less than 100,000, the formula returns cell A1 multiplied by 5 percent Otherwise it returns what’s in cell A1, multiplied by 7.5 percent 341 15 Part III Making the Numbers Work with Excel New Functions in Excel 2007 E xcel 2007 contains five new functions: n IFERROR — Used to check for an error, and display a message or perform a different calculation n AVERAGEIF — Used to calculate . Figure 14- 23. CAUTION CAUTION NOTE NOTE 333 Essential Worksheet and Cell Range Operations 14 20 046 913 ch 14. qxp 5/2/07 9:07 PM Page 333 FIGURE 14- 23 The Name Manager is new in Excel 2007. The. file. Figure 14- 25 shows a comment that contains a picture. TIP TIP TIP TIP 335 Essential Worksheet and Cell Range Operations 14 20 046 913 ch 14. qxp 5/2/07 9:07 PM Page 335 FIGURE 14- 25 This comment. Manager. TIP TIP CAUTION CAUTION NEW FEATURE NEW FEATURE 3 34 Making the Numbers Work with Excel Part III 20 046 913 ch 14. qxp 5/2/07 9:07 PM Page 3 34 To create a list of names in a worksheet, first move