Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
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 4: MAKING THINGS LOOK GOOD

463

 

 

Excel will draw in the line charts, one in each cell.

Here are default sparklines.

Figure 1162 Default sparklines have no labels or markers.

Excel will let you add markers to your sparklines.

With a sparkline selected, the Sparkline Tools De- sign tab will be available in the ribbon. You can toggle on all points by choosing Markers, but a more interesting option is to choose High Point and

Low Point

Figure 1164 Change the color of the markers.

Figure 1163 Choose which points to add to the line.

After you’ve added the high and low point, use the Marker Color dropdown to choose a color for each type of point.

SPARKLINES ARE NOT SCALED TOGETHER

Problem: The vertical scale on the sparklines seems to be wrong. This chart is showing that Chicago and Miami have similar January temperatures.

4

Figure 1165 Monthly temperatures in Miami are not like Chicago.

Strategy: by default, each sparkline has its own vertical scale. This works out great when the sparklines are comparing how different items trend together over time.

Figure 1166 Each sparkline has its own vertical scale.

In Professor Tufte’s first examples, he was comparing unlike variables that had a relationship. This is why

Microsoft chose to keep the axes separate for each line.

When you are comparing items that all have the same scale, you have to force the minimum and maximum axis to be the same.

464

POWER EXCEL WITH MR EXCEL

 

 

At the very least, use the Axis dropdown and choose Same For All Sparklines for both the minimum and maximum value.

Figure 1167 Make all of the axes the same.

If you are going to be labeling sparklines or shading sparklines as described later, you will want to use a Custom Value for both the min and max value options.

WHAT IS THE WIN LOSS SPARKLINE FOR?

Problem: What is the win/loss sparkline used for?

Strategy: The win/loss sparkline shows streaks of wins or losses. You might use it to plot sports teams, stock prices, or bid desk results. In a win/loss sparkline, any positive value (such as 1) is plotted as an upward facing marker. Any negative value (such as -1) is plotted as a downward facing marker. Any zero values get no marker.

If you have some stock closing prices, use =SIGN(Today-Yesterday). If the price went up, the sign is posi- tive and you get a +1. If the price went down, you get a -1.

Figure 1168 Generate +1, 0, -1 with SIGN().

For long Win/Loss Sparklines, increase the column width and row height to show more detail.

Figure 1169 Did those green markers happened after the Kinect debuted?

Living in northeast Ohio, I am used to baseball season ending in June as the Cleveland Indians are elimi- nated from the playoffs. This year, they got off to a stellar start, but were just swept by the Yankees this weekend. The right quarter of this chart is the ballclub that I know and love.

PART 4: MAKING THINGS LOOK GOOD

465

 

 

Figure 1170 Win/Loss sparklines to a great job showing wins and losses.

LABELING SPARKLINES

Problem: I want to add labels to a sparkline.

Strategy: Labels are not built in to sparklines, but you have cells above, below, left and right of each sparkline. If you increase the column width and row height, you can create some interesting labels.

Below, titles appear above each sparkline. Those cells are just text that you can type in the cell and center. The axis max/min to the left is created by typing 100 Alt+Enter, Alt+Enter, Alt+Enter, 0. Make the font small and then adjust the row height until the numbers fit.

For the month labels below the chart, use a fixed-width font like Courier or Courier New. Type each month letter separated by a space. Make the font as small as possible. Center the values. Make the column width wider until the labels line up with the chart.

Figure 1171 Use the labels around the sparkline to add labels.

In the figure to the right, a formula calculates the

 

 

maxandminofeachseries.TheREPT(CHAR(10),4)

 

 

adds four line feeds. With a row height of 55 and an

 

 

8-point font, this works out fine.

 

 

The background for sparklines are transparent

 

 

 

4

so that any text in the cell will appear behind the

 

 

 

sparkline. The title for each sparkline is just text

 

 

 

 

typed in the cell, vertically aligned to the top of the

 

 

cell.

 

 

In the figure below, a sparkline column chart shows

 

 

hourly readings from 7AM to 2PM. Because the la-

 

 

bel for 12 would be twice as wide as the label for

 

 

7AM, a bit of trickery is employed. The label is 7

 

 

followed by Alt+Enter, 8 followed by Alt+Enter, 9

 

 

followed by Alt+Enter, and so on through 2. Use the

 

 

Alignment tab of the Format Cells dialog to turn

 

 

the values sideways, vertical align top, horizontal

 

 

align center. Back in the Home tab, keep reducing

 

 

the font and/or adjusting the column widths until

Figure 1172 A formula in B calculates the label.

all the values show in the cell.

 

 

Figure 1173 Vertical text for the column labels.

466

POWER EXCEL WITH MR EXCEL

 

 

 

SHADE THE NORMAL RANGE IN A SPARKLINE

Problem: The examples in Tufte’s book would often draw a rectangular box to show the expected normal range for a sparkline. This allowed you to see when the sparkline deviated from normal.

Figure 1174 The shading is a semi-transparent rectangle.

Strategy: This functionality is not built in to Excel sparklines, but you can use drawing tools to create a fairly good normal range.

These guidelines provide a rough set of steps for adding the shading:

Use the Axis Scaling settings and use a custom value for both the minimum and maximum value. This allows you to actually know that the sparklines range from exactly 0% to 1.5%.

Copy the real values for one or two sparklines and paste them outside of the data range. You are going to be temporarily changing those values and you want to paste the real values back into the dataset when you are done.

Suppose you want to draw a box for the caution range of 0.5% to 1%. Fill the values for one sparkline with

0.005. Fill the values for the next sparkline with 0.01.

Using Insert, Shapes, Rectangle and draw a rectangle over the sparklines. Make the bottom of the rect- angle line up with the 0.005 sparklines and make the top of the rectangle line up with the 0.01 sparklines.

On the Drawing Tools Format tab, choose Shape Outline, None. Choose Shape Fill, and choose a color for the highlighted area.

Press Ctrl+1 or use the dialog launcher in the Shape Styles group to get to the Format Shape dialog box.

There is a Transparency slider in the Fill category of the dialog box. Change the slider up to 75% transparent. Click Close to close the dialog box.

Adjust the top and bottom of the shape one last time so that they line up with the 0.005 and 0.01 guides in the two temporary sparklines.

Click away from the rectangle shape.

Copy the real values from the temporary area back to the sparkline data.

CONVERT A TABLE OF NUMBERS TO A VISUALIZATION

Problem: My manager’s eyes glaze over when he sees a table of numbers. Is there anything I can do to help him spot trends in the data?

Figure 1175 Help your manager to understand this data.

PART 4: MAKING THINGS LOOK GOOD

467

 

 

Strategy: You can use one of the three new data visualization tools on the Conditional Formatting menu: data bars, color scales, and icon sets.

Adding a data bar to a range adds an in-cell bar chart to each cell. You can see which cells have the largest values by seeing which cells have the most color.

To add data bars, you select a range of numbers and then select Home, Conditional Formatting,

Data Bars, choose a color. Excel offers six gradients and six solid. You can choose More Rules to add any of 16 million colors.

Figure 1176 Choose a color for the data bars

Below, you can see that Wednesday is the busiest day. Calls fall of on Friday for everyone except Missy. Missy is consistently the strongest performer.

Figure 1177 Easily spot trends in the data.

Gotcha: You should not include any total cells in your selection when applying conditional formatting.

4

The relative size of the totals would make all the detail numbers receive small bars. Below, the 904 in cell

G6 makes all the cells in B2:F5 look relatively the same.

Figure 1178 Don’t include totals in a visualization.

Additional Details: You can use color scales to apply a mix of colors to a range. Excel offers built-in three-color scales such as red-yellow-green as well as two-color scales. The two-color scales look better than three-color scales when printed in monochrome. You can also use More Rules to design your own color scheme. Below, the largest numbers are in the darker green, and the smallest numbers are in the lighter yellow.

468

POWER EXCEL WITH MR EXCEL

 

 

Figure 1179 Each cell is lighter or darker based on size.

The final new visualization is icon sets.

In Excel 2010, there are 20 sets of icons. Some have three symbols, others have four, and some have five.

Figure 1180 Twenty icon sets are available.

Note that for many of these sets you need to print in color in order for the reader to differentiate the symbols. If you are printing in monochrome, the arrows or power bars are good choices.

After you choose an icon set, Microsoft will display the icon at the left of each cell. Since numbers are usu- ally right-aligned, the number from B2 and the icon from C2 are too close together and many will think that they go together.

I’ve begun using Ctrl+1 to visit the Format Cells dialog. On the Alignment tab, use a horizontal alignment of Right (Indent). You can then increase the indent to 2 or 3 to move the numbers closer to their icons.