Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Power excel 2016 with mrexcel Master Pivot Tables, Subtotals, Charts, VLOOKUP, IF, Data Analysis in Excel 2010–2013 (Bill Jelen) (z-lib.org).pdf
Скачиваний:
4
Добавлен:
14.08.2022
Размер:
49.75 Mб
Скачать

PART 3: WRANGLING DATA

237

 

 

Gotcha: Before you try any sort operation, you must select either the entire range or a single cell in that range. If you mistakenly choose two cells in a range, Excel will sort just those selected cells, resulting in a few cells of your data being sorted within records—a disastrous result. Excel now warns you when you attempt to sort a subset of the cells.

SORT DAYS OF THE WEEK

Problem: I have a column with values such as Monday, Wednesday, and so on. When I sort this column in ascending sequence, Friday comes before Monday. The same problem happens with month names, which sort as April, August, December, and so on.

 

Figure 593 Friday is alphabetically before Monday.

 

Strategy: Excel has custom lists built in for months and days. To use them, follow these steps:

 

1.

Select a cell in your data.

 

2.

Select Data, Sort.

 

3.

Choose Sort by Day and Sort on Values. In the Order dropdown, choose Custom List.

 

4.

Choose Sunday, Monday, Tuesday from the Custom List dialog. Click OK.

 

3

Excel will sort the data correctly.

 

Figure 594 Weekdays are sorted correctly.

SORT A REPORT INTO A CUSTOM SEQUENCE

Problem: My manager wants me to sort a report geographically. My annual report typically lists results from the United States first, then Europe, and then Australia. I need to sort so that the coun- tries appear as United States, England, France,

Germany, and Australia.

Figure 595 Sort using a custom list.

238

POWER EXCEL WITH MR EXCEL

 

 

Strategy: You can use a custom list by following these steps:

1. Go to a blank section of the worksheet. Type the countries in the order you want them to appear in a column. Select the range of cells.

2. Choose File, Options, Advanced. Scroll to near the bottom of the dialog.

The Edit Custom Lists button is now found at the bottom of the General category. In Excel 2007, this button was at the top of the first screen of the Options dialog. Click Edit Custom Lists.

3. Provided you selected the data in step 1, the reference box next to the Import button already contains the cells that contain your list. Click Import.

Figure 596 Type the countries in their desired geographic sequence.

Figure 597 Adding a new custom list.

4. Click OK twice.

5. Select Data, Sort. In the Sort dialog, choose Country from the Sort By dropdown. In the Order drop- down, choose Custom List.

6. Excel will again display the Custom Lists dialog. Select the USA, England, France list and click OK. 7. When Excel shows USA, England, France, Germany in the Order dropdown, click OK to sort.

Figure 598 Sort by the custom list.

Results: The data is sorted by the country order.

Additional Details: If there is a value in the column that is not in your custom list, it is sorted alphabeti- cally after the entries in the list. If you sort in descending order, these unlisted entries will come first, in Z–A order.

Gotcha: Excel remembers that the column was most recently sorted by the “USA, England…” custom list. If you click the AZ button, it will automatically sort by using this same custom list. If you need to return to alphabetical order, you will have to select Data, Sort and choose A to Z in the Order dropdown.

PART 3: WRANGLING DATA

 

239

 

 

 

SORT ALL RED CELLS TO THE TOP OF A REPORT

Problem: I’ve read through a 20-page report and marked a dozen cells in red. I need to audit those records and would like to sort the red cells to the top of the report.

Strategy: You can sort by color. Follow these steps:

1. Right-click on one of the red cells.

2. From the context menu, choose Sort, Put Selected Cell Col- or on Top.

Results: Excel will sort the red cells to the top of the report.

Figure 599 Sort the red cells to the top.

 

Figure 601 The red cells come

 

Figure 600 Choose to sort by color.

to the top.

3

Additional Details: Using the context menu as described here works fine if you need to sort by only one color. If you used cells of several different colors and want to sort them in a particular order, you need to select Data, Sort to open the Sort dialog. Then, for the first sort level, you choose Quantity in the Sort By dropdown, Cell Color from the Sort On dropdown, and green from the Order dropdown.

You set the next sort level by clicking the Copy Level button and then choosing yellow from the Order dropdown. You click Copy Level for each additional color you need to specify.

Figure 602 Four levels for one column.

If you have many colors in a column, you might use several sort levels to specify how to sort the first col- umn.

Additional Details: You can also sort by font color or cell icon. Amazingly, sorting by color will even work if your colors have been assigned through conditional formatting.

240

POWER EXCEL WITH MR EXCEL

 

 

 

SORT PICTURES WITH DATA

Problem: My manager wants me to add employee pictures to the department phone list. I need the pictures to sort with the data.

Strategy: By default, this will work. Each picture has a property that will cause it to move but not size with cells. To see the property, select the picture and press Ctrl+One. There are 16 categories in the left bar of the Format Picture dialog. Near the bottom, choose Properties. The

Move But Don’t Size with Cells should already be selected.

Select one cell in column A and sort with the AZ button. The pictures should move with the names.

Figure 604 The pictures will sort with the rows.

Figure 603 Sort the list alphabetically.

Gotcha: I am guessing that you wouldn’t be looking up this topic unless the sort already failed for you. I’ve had to troubleshoot this before and it always comes down to one issue.

The process of inserting and resizing pictures is a mind-numbing process. You must be certain that every picture is completely contained within one cell. If the picture extends by even one pixel over the top edge of a cell, it will not be sorted correctly.

Figure 605 This picture is a few pixels too high. It will not sort..

QUICKLY FILTER A LIST TO CERTAIN RECORDS

Problem: I have 10,000 records in the worksheet. I need to be able to quickly find records that match a criterion, such as all East ABC records.

Figure 606 Find records within this data set.

Strategy: You can find records that match a criterion by using the Filter feature.

Toggle on the Filter command by using either Home, Sort & Filter, Filter or selecting Data, Filter icon.

As you can see below, the Filter button is three times larger than the Advanced Filter icon, which I take

PART 3: WRANGLING DATA

241

 

 

as evidence that Microsoft someday hopes to add enough power to Filter to eliminate the need for the Advanced Filter.

Figure 607 AutoFilter is now just Filter.

To filter your data set, follow these steps:

1. Make sure your data has a heading row. Select one cell within the data. Select Data, Filter. Excel will add a dropdown to each heading.

Figure 608 Filter dropdowns.

2. Select the Product dropdown. Before you can select ABC, you have to first uncheck (Select All).

3

Figure 609 Uncheck Select All, then choose ABC.

3. Click the ABC check box. Click OK. You will now see just the ABC records. 4. Open the Region dropdown. Uncheck (Select All). Check East. Click OK.

You will now have only the East, ABC records. Notice the Funnel icon appears on all columns that have a filter applied.

Figure 610 Excel hides the other rows.

To clear a filter, open the dropdown and choose Clear Filter from Field.

Additional Details: Excel will detect if your column is text, numeric, or dates. Each column type includes a flyout with new options.

242

POWER EXCEL WITH MR EXCEL

 

 

The Date filters appear in a tree view, so you can turn on/off entire months rather than clicking all 30 dates that fall in a month. The Date Filter flyout menu offers many choices that seem like they were bor- rowed from Quickbooks.

Figure 611 Date columns offer many new choices.

Numeric columns offer a Top 10 filter, plus new choices such as Above Average.

Figure 612 New number filters.

The Top 10 Filter option allows you to specify the top or bottom “n” items or “n%” of items. The Top 10 feature was in previous versions of Excel, but all the other value filters in the figure above are new in Excel

2007.

If you have used cell colors, font colors, or icon sets, you can use the Filter by Color fly-out menu to show records that have a certain color.

Figure 613 Filter by color.

Gotcha: In order for the Date Filters or Number Filters options to appear, your data needs to be predominantly dates or numbers. If you have too many blank cells or too many text cells, Excel will treat the column as text and not offer these filter options in the dropdown.