Manipulating Dates, Times, and Text

Một phần của tài liệu Excel 2013 the missing manual (Trang 135 - 155)

4

So far, you’ve learned how to create a basic worksheet with a table of data in it.

That’s great for getting started, but as power users, professional accountants, and other Excel jockeys quickly learn, some of the most compelling reasons to use Excel involve multiple tables that share information and interact with each other.

For example, say you want to track the performance of your company. You create one table summarizing your firm’s yearly sales, another listing expenses, and a third analyzing profitability and making predictions for the coming year. If you create these tables in different spreadsheets, you must copy the information you want the sheets to share from one location to another, all without misplacing a number or making a mistake. What’s worse is that, with your data scattered in multiple places, you’re missing the chance to use some of Excel’s niftiest charting and analytical tools. But cramming a bunch of tables onto the same worksheet page isn’t the solution. Not only are you likely to lose your spot in the avalanche of data, you’ll face a host of formatting and cell-management problems.

Fortunately, a better solution exists. Excel lets you create spreadsheets with multi- ple pages of data, each of which can conveniently exchange information with other pages. Each page is called a worksheet, and a collection of one or more worksheets is called a workbook (which is also sometimes called a spreadsheet file).

In this chapter, you’ll learn how to manage the worksheets in a workbook. You’ll also take a look at Find and Replace, an Excel tool for digging through worksheets in search of specific data.

Managing Worksheets

WorkshEETs anD

Workbooks Worksheets and Workbooks

Many workbooks contain more than one table of information. For example, you might have a list of your bank account balances and a list of items repossessed from your home in the same financial planning spreadsheet. You might find it a bit challenging to arrange these tables. You could stack them (Figure 4-1) or place them side by side (Figure 4-2), but neither solution is perfect.

FiGuRE 4-1

Stacking tables on top of each other is usually a bad idea.

If you add a new column of data to the top table, you’ll mess up the bottom table. You’ll also have trouble properly resizing or formatting columns because each one contains data from two different tables.

FiGuRE 4-2 You’re somewhat better off putting tables side by side, separated by a blank column, than you are stacking them, but side-by-side columns present their own limitations if you need to add more columns to the first table. It also makes for a lot of side-to-side scrolling.

Most Excel masters agree that the best way to arrange different tables of information is to use separate worksheets for each table. When you create a new workbook, you start with a single worksheet, named Sheet1. However, Excel gives you the ability to add plenty more.

WorkshEETs anD Workbooks  NOTE  In old versions of Excel, every workbook began with three blank worksheets. Excel 2013 abandons

this practice, but you’ll still find the extra worksheets in older spreadsheet files. Often, these worksheets will be left blank—in fact, the person who created the spreadsheet might not even know they’re there.

Adding and Removing Worksheets

When you start a fresh workbook in Excel, you get a single blank worksheet. To add more sheets, you need to click the “New sheet” button, which is a small plus- in-a-circle icon that appears immediately to the right of your last worksheet tab (Figure 4-3). You can also use the Home→Cells→Insert→Insert Sheet command, which works the same way but inserts a new worksheet immediately to the left of the current worksheet. (Don’t panic: page 113 shows how you can rearrange work- sheets after the fact.) Each worksheet contains a fresh grid of cells—from A1 all the way to XFD1048576.

FiGuRE 4-3 Every time you click the “New sheet” button, Excel inserts a new worksheet after the existing one and assigns it a new name. For example, if your workbook has a single worksheet, named Sheet1, Excel adds a new worksheet named—you guessed it—Sheet2.

If you continue adding worksheets, you’ll eventually find that all the worksheet tabs won’t fit at the bottom of your workbook window. Excel uses an ellipsis (…) to indicate the next tab that doesn’t fit. For example, if you workbook has worksheets named Sheet1, Sheet2, and Sheet3, and the tab for Sheet3 doesn’t quite fit into view at the end of the list, you’ll see the ellipsis instead. (You can click it to select Sheet3.) If you have way more worksheets than fit into the tab list, you’ll need to use the scroll buttons, which are immediately to the left of the worksheet tabs) to review the list of worksheets. Figure 4-4 shows the scroll buttons and the ellipsis.

WorkshEETs anD Workbooks

FiGuRE 4-4

Using the scroll buttons, you can move between worksheets. The scroll buttons control only which tabs you see—you need to click a tab to move to the worksheet you want to work on.

 TIP  If you have a huge number of worksheets and they don’t all fit in the strip of worksheet tabs, there’s an easy way to jump around. Right-click the scroll buttons to pop up a list of all your worksheets, then move to the worksheet you want by clicking its name.

Removing a worksheet is just as easy as adding one. Simply move to the sheet you want to get rid of, and then choose Home→Cells→Delete→Delete Sheet (you can also right-click a tab, and then choose Delete). Excel won’t complain if you ask it to remove a blank worksheet, but if you try to remove a sheet that contains data, Excel displays a warning message asking for your confirmation. Also, if you’re down to one last worksheet, Excel won’t let you remove it. Doing so would create a tough existential dilemma for Excel—a workbook that holds no worksheets—so the program prevents you from taking this step.

 WARNING  Be careful when you delete a worksheet, because you can’t use Undo (Ctrl+Z) to reverse this change!

Excel starts you off with one worksheet for each workbook, but changing this setting is easy. You can configure Excel to start with up to 255 worksheets. Select File→Op- tions, and then choose the General section. Under the heading “When creating new workbooks,” change the number in the “Include this many sheets” box, and then click OK. This setting takes effect the next time you create a new workbook.

WorkshEETs anD Workbooks  NOTE  Although Excel limits you to 255 sheets in a new workbook, it doesn’t limit the number of worksheets

you can add after you create a workbook. Ultimately, the only factor that limits the number of worksheets your workbook can hold is your computer’s memory. But today’s computers can easily handle even the most ridiculously large, worksheet-stuffed workbook.

Moving Between Worksheets

To move from one worksheet to another, you have a few choices:

• Click the worksheet tabs at the bottom of Excel’s grid window (just above the status bar).

• Press Ctrl+Page Down to move to the next worksheet. For example, if you’re currently in Sheet1, this key sequence jumps you to Sheet2 (assuming your sheets are in order).

• Press Ctrl+Page Up to move to the previous worksheet. For example, if you’re currently in Sheet2, this key sequence takes you to Sheet1.

Excel keeps track of the active cell in each worksheet. That means that if you’re in cell B9 in Sheet1, and then move to Sheet2, when you jump back to Sheet1, you’ll automatically return to cell B9.

 TIP  Excel includes some interesting viewing features that let you look at two different worksheets at the same time, even if these worksheets are in the same workbook. You’ll learn more about custom views in Chapter 7.

Hiding Worksheets

Deleting worksheets isn’t the only way to tidy up a workbook or get rid of information you don’t want. You can also hide a worksheet temporarily.

When you hide a worksheet, its tab disappears, but the worksheet itself remains part of your workbook file, available whenever you choose to unhide it. You can’t print a hidden worksheet, either.

To hide a worksheet, right-click the worksheet tab, and then choose Hide. (Or, for a more long-winded approach, choose Home→Cells→Format→Hide & Unhide→Hide Sheet.)

To redisplay a hidden worksheet, right-click any worksheet tab, and then choose Unhide. The Unhide window appears along with a list of all hidden sheets, as shown in Figure 4-5. Select a sheet from the list, and then click OK to unhide it. (Once again, the ribbon can get you to the same window—point yourself to Home→Cells→ Format→Hide & Unhide→Unhide Sheet.)

WorkshEETs anD Workbooks

FiGuRE 4-5

This workbook contains two hidden worksheets. To restore one, select it from the list, and then click OK. Unfortunately, if you want to show multiple hidden sheets, you must tap the Unhide Sheet command multiple times—Excel has no shortcut for unhiding multiple sheets at once.

Naming and Rearranging Worksheets

The standard names Excel assigns new worksheets—Sheet1, Sheet2, Sheet3, and so on—aren’t very helpful for identifying what they contain. They become even less helpful if you start adding new worksheets, since the new sheet numbers (Sheet2, and so on) don’t necessarily indicate the position of the sheets, just the order in which you created them.

For example, if you’re on Sheet 3 and you add a new worksheet (by choosing Home→Cells→Insert→Insert Sheet), then the worksheet tabs read: Sheet1, Sheet2, Sheet4, Sheet3. (That’s because the Insert Sheet command inserts the new sheet just before your current sheet.) Excel doesn’t expect you to stick with these auto- generated names. You can rename them by right-clicking the worksheet tab and selecting Rename, or by just double-clicking the sheet name. Either way, Excel highlights the worksheet tab, and you can type a new name directly in the tab.

Figure 4-6 shows worksheet tabs with better names.

FiGuRE 4-6

Your worksheet names can have up to 31 characters and include letters, numbers, some symbols, and spaces. Remember, though, that the longer the worksheet name, the fewer worksheet tabs you’ll see at once, and the more you’ll need to scroll to see the rest of the tabs.

For convenience’s sake, try to keep your names brief by using titles like Sales13, Purchases, and Jet_Mileage.

WorkshEETs anD Workbooks  NOTE  Excel reserves a small set of worksheet names that you can never use. To witness this problem, try

to create a worksheet named History. Excel doesn’t let you, because it uses the History worksheet as part of its change-tracking feature (page 685). Use this Excel oddity to impress your friends.

Sometimes Excel refuses to insert new worksheets exactly where you’d like them.

Fortunately, you can easily rearrange any of your sheets just by dragging their tabs from one place to another, as shown in Figure 4-7.

FiGuRE 4-7

When you drag a worksheet tab, a tiny page appears beneath the arrow cursor. As you move the cursor around, you’ll see a black triangle appear, in- dicating where the worksheet will land when you release the mouse button.

 TIP  You can use a similar technique to create copies of a worksheet. Click the worksheet tab and begin dragging, just as you would to move the worksheet. Before you release the mouse button, press the Ctrl key (you’ll see a plus sign [+] appear). Keep holding the Ctrl key until you release the mouse button, at which point Excel creates a copy of the worksheet in the new location. The original worksheet remains in its original location.

Excel gives the new worksheet a name with a number in parentheses. For example, a copy of Sheet1 is named Sheet1 (2). As with any other worksheet tab, you can change this name.

GEM IN THE ROUGH

Colorful Worksheet Tabs

Names aren’t the only thing you can change when it comes to newly added worksheets. Excel lets you modify a worksheet tab’s background color, too. This minor convenience has no effect on your data or printout, but it can help you quickly find an important worksheet if it has lots of neighbors.

To change the background color of a worksheet tab, right-click the tab, and then select Tab Color (or move to the appropriate worksheet and select Home→Cells→Format→Tab Color). A list of color choices appears; click the color you want.

WorkshEETs anD

Workbooks Moving Worksheets from One Workbook to Another

Once you get the hang of creating worksheets for different types of information, your Excel files can quickly fill up with more sheets than the bedding department at Macy’s. What happens when you want to shift some of these worksheets around?

For instance, you may want to move (or copy) a worksheet from one Excel file to another. Here’s how:

1. Open both spreadsheet files.

The file that contains the worksheet you want to move or copy is called the source file; the other file (the one where you want to place the worksheet copy) is the destination file.

2. Go to the source workbook.

Remember, you can move from one window to another using the Windows task bar, or by choosing the file’s name from the ribbon’s View→Windows→Switch Windows list.

3. Right-click the worksheet you want to transfer, and then, from the shortcut menu that appears, choose Move or Copy.

To transfer multiple worksheets at once, hold down the Ctrl key, and then select all the worksheets you want to move or copy. Excel highlights all the worksheets you select (and groups them together). Right-click the selection, and then choose Move or Copy.

When you move or copy a worksheet, Excel launches the Move or Copy window (shown in Figure 4-8).

4. Choose the destination file from the “To book” drop-down list.

The “To book” menu shows all the currently open workbooks (including the source workbook).

FiGuRE 4-8

Here, you’re about to move the selected worksheet into the Simple- Expenses.xlsx workbook. (The source workbook isn’t shown.) The SimpleExpenses workbook already contains three worksheets (named Sheet1, Sheet2, and Sheet3). Excel inserts the new worksheet just before the first sheet. Because you didn’t turn on the “Create a copy”

checkbox, Excel removes the worksheet from the source workbook when it completes the transfer.

WorkshEETs anD Workbooks  TIP  Excel also lets you move worksheets to a new workbook, which it automatically creates for you. To do

so, choose “(new book)” in the “To book” list. The resulting workbook has only the worksheets you transferred to it.

5. Specify where you want to insert the worksheet.

Choose a destination worksheet from the “Before sheet” list. Excel places the copied worksheets just before the worksheet you select. If you want to place the worksheets at the end of the destination workbook, select “(move to end).”

Of course, you can always rearrange the worksheets after you transfer them, so you don’t need to worry too much about getting the perfect placement.

6. If you want to copy the worksheet, turn on the “Create a copy” checkbox at the bottom of the window.

With this option turned off, Excel copies a worksheet to the destination workbook and removes the original from the source workbook. If you do turn this option on, you’ll end up with a copy of the worksheet in both workbooks.

7. Click OK.

This final step closes the Move or Copy window and transfers the worksheet(s).

 NOTE  If Excel encounters a worksheet name conflict, it adds a number in parentheses after the moved sheet’s name. For example, if you try to copy a worksheet named Sheet1 to a workbook that already has a Sheet1, Excel names the copied worksheet Sheet1 (2).

Grouping Worksheets

As you saw in previous chapters, Excel lets you work with more than one column, row, or cell at a time. The same holds true for worksheets. You can select multiple worksheets and perform an operation on all of them at once. The process of select- ing multiple sheets is called grouping, and it’s helpful if you need to hide or format several worksheets (for example, to make sure all your worksheets start with a bright yellow first row), and you don’t want the hassle of selecting them one at a time. Grouping sheets doesn’t let you do anything you couldn’t do ordinarily—it’s just a nifty timesaver.

Here are some operations—all of which are explained in detail below—that you can simultaneously perform on worksheets grouped together:

• Move, copy, delete, or hide the worksheets.

• Apply formatting to individual cells, columns, rows, or even entire worksheets.

• Enter new text, change text, or clear cells.

• Cut, copy, and paste cells.

• Adjust some page layout options, like paper orientation (on the Page Layout tab).

• Adjust some view options, like gridlines and the zoom level (on the View tab).

WorkshEETs anD

Workbooks To group worksheets, hold down Ctrl while clicking multiple worksheet tabs. When you finish, release the Ctrl key. Figure 4-9 shows an example.

FiGuRE 4-9 In this example, you grouped Sheet2 and Sheet3. When you group worksheets, their tab colors change from gray to white. Also, in workbooks with groups, the title bar of the Excel window includes the word [Group] at the end of the file name.

 TIP  As a shortcut, you can select all the worksheets in a workbook by right-clicking any tab, and then choosing Select All Sheets.

To ungroup worksheets, right-click one of the tabs and then select Ungroup Sheets, or just click one of the worksheet tabs that isn’t in your group. You can also remove a single worksheet from a group by clicking it while holding down Ctrl. However, this technique works only if the worksheet you want to remove from the group is not the currently active worksheet.

MANAGING GROUPED SHEETS

As your workbook grows, you’ll often need better ways to manage the collection of worksheets you’ve accumulated. For example, you might want to temporarily hide a number of worksheets, or move a less important batch of them from the front (that is, the left side) of the worksheet tab holder to the end (the right side). And if a workbook’s got way too many worksheets, you might even want to relocate several of them to a brand-new workbook.

You can easily perform an action on a group of worksheets. For example, you can drag a group of selected worksheets from one location to another using the worksheet tab holder. To delete or hide a group of sheets, just right-click one of the worksheet tabs in your group, and then choose Delete or Hide. Excel then deletes or hides all the selected worksheets (provided that action leaves at least one visible worksheet in your workbook).

 NOTE  Excel keeps track of print and display settings on a per-worksheet basis. In other words, when you set the zoom to 50 percent in one worksheet, it doesn’t affect the zoom in another worksheet. However, when you make the change for a group of worksheets, that change affects all the sheets in the same way.

Một phần của tài liệu Excel 2013 the missing manual (Trang 135 - 155)

Tải bản đầy đủ (PDF)

(1.020 trang)