Visualization is the presentation of abstract concepts or data in visual terms through some sort of graphical imagery. A traffic light, for example, is a visualization of the abstract concepts of stop and go.
In the business world, visualizations help us to communicate and process the meaning of data faster than simple tables of numbers. Excel offers a wide array of features that can be used to add visualizations to dashboards and reports.
In this chapter, you explore some of the formatting techniques that you can leverage to add layers of visualizations and turn your data into meaningful views.
When you enter a number into a cell, you can display that number in a variety of different formats. Excel has quite a few built-in number formats, but sometimes there are none that are exactly what you need.
This chapter describes how to create custom number formats, and it provides many examples that you can use as is or adapt to your needs.
The Number group on the Home tab of the Ribbon contains several controls for applying common number formats quickly. The Number Format drop-down control gives you quick access to 11 common number formats. In addition, the Number group contains some buttons. When you click one of these buttons, the selected cells take on the specified number format. Table 21.1 summarizes the formats that these buttons perform in the U.S. English version of Excel.
TABLE 21.1 Number-Formatting Buttons on the Ribbon
Button Name | Formatting Applied |
---|---|
Accounting Number Format | Adds a dollar sign to the left, separates thousands with a comma, and displays the value with two digits to the right of the decimal point. This is a drop-down control, so you can select other common currency symbols. |
Percent Style | Displays the value as a percentage, with no decimal places. This button applies a style to the cell. |
Comma Style | Separates thousands with a comma and displays the value with two digits to the right of the decimal point. It's like the Accounting Number Format but without the currency symbol. This button applies a style to the cell. |
Increase Decimal | Increases the number of digits to the right of the decimal point by one. |
Decrease Decimal | Decreases the number of digits to the right of the decimal point by one. |
Another way to apply number formatting is to use shortcut keys. Table 21.2 summarizes the shortcut key combinations that you can use to apply common number formatting to the selected cells or range. Notice that these are the shifted versions of the number keys along the top of a typical keyboard.
TABLE 21.2 Number-Formatting Keyboard Shortcuts
Key Combination | Formatting Applied |
---|---|
Ctrl+Shift+~ | General number format (that is, unformatted values). |
Ctrl+Shift+! | Two decimal places, thousands separator, and a hyphen for negative values. |
Ctrl+Shift+@ | Time format with the hour, minute, and AM or PM. |
Ctrl+Shift+# | Date format with the day, month, and year. |
Ctrl+Shift+$ | Currency format with two decimal places. (Negative numbers appear in parentheses.) |
Ctrl+Shift+% | Percentage format with no decimal places. |
Ctrl+Shift+^ | Scientific notation number format with two decimal places. |
For maximum control of number formatting, you can use the Number tab in the Format Cells dialog box. You can access this dialog box in any of several ways:
The Number tab in the Format Cells dialog box contains 12 categories of number formats from which to choose. When you select a category from the list box, the right side of the dialog box changes to display appropriate options.
Here are the number format categories, along with some general comments:
2.00E+05 = 200,000
. You can choose the number of decimal places to display to the left of E.When you apply number formatting, you are giving Excel instructions using a format string. A number format string is a code that tells Excel how you want the values in a given range to appear cosmetically.
To see this code, follow these steps to apply basic number formatting:
Number formatting strings consist of different individual number formats separated by semicolons. In this case, you see two different formats: the format to the left of the semicolon and the format to the right of the semicolon.
#,##0_);(#,##0)
By default, any formatting to the left of the first semicolon is applied to positive numbers, and any formatting to the right of the first semicolon is applied to negative numbers. So, with this choice, positive numbers will be formatted as a simple number, and negative numbers will be formatted with parentheses, like the following:
1,982
(1,890)
You can edit the syntax in the Type input box so that the numbers are formatted differently. For example, try changing the syntax to the following:
+#,##0;-#,##0
When this syntax is applied, positive numbers will start with the +
symbol, and negative numbers will start with a −
symbol, like so:
+1,200
-15,000
This comes in handy when formatting percentages. For instance, you can apply a custom percent format by entering the following syntax into the Type input box:
+0%;-0%
This syntax gives you percentages that look like the following:
+43%
-54%
You can get fancy and wrap your negative percentages with parentheses using the following syntax:
0%_);(0%)
This syntax gives you percentages that look like the following:
43%
(54%)
Formatting numbers to appear in thousands or millions helps present values without inundating your audience with overlarge numbers. To show your numbers in thousands, highlight them, right-click, and select Format Cells.
After the Format Cells dialog box opens, click the Custom category to get to the screen shown in Figure 21.1. In the Type input box, enter the following syntax:
#,##0,
After you confirm your changes, your numbers will automatically appear in the thousands place.
The beautiful thing here is that this technique doesn't change or truncate your numeric values in any way. Excel is simply applying a cosmetic effect to the number. Figure 21.2 illustrates this. Compare the values you see in the formula bar versus what is shown in the cells.
The selected cell has been formatted to show in thousands. You see 118k. But if you look in the formula bar above it, you'll see the real unformatted number (117943.60578). The 118k you are seeing in the cell is a cosmetically formatted version of the real number shown in the formula bar.
If needed, you can indicate that the number is in thousands by adding “k”
to the number syntax.
#,##0,"k"
This would show your numbers like this:
118k
318k
You can use this technique on both positive and negative numbers.
#,##0,"k"; (#,##0,"k")
After applying this syntax, your negative numbers also appear in thousands.
118k
(318k)
Need to show numbers in millions? Easy. Simply add two commas to the number format syntax in the Type input box.
#,##0.00,, "m"
Note the use of the extra decimal places (.00
). When converting numbers to millions, it's often useful to show additional precision points, as in the following example:
24.65 m
In addition to formatting positive and negative numbers, Excel allows you to provide a format for zeros. You do this by adding another semicolon to your custom number syntax. By default, any format syntax placed after the second semicolon is applied to any number that evaluates to zero.
For example, the following syntax applies a format that shows n/a
for any cells that contain zeros:
#,##0_);(#,##0);"n/a"
You can also use this to suppress zeros entirely. If you add the second semicolon but don't follow it with any syntax, cells containing zeroes will appear blank.
#,##0_);(#,##0);
Again, custom number formatting affects only the cosmetic look of the cell. The actual data in the cell is not affected. Figure 21.3 demonstrates this. The selected cell is formatted so that zeros appear as n/a
, but if you look at the Formula bar, you can see the actual unformatted cell contents.
In addition to controlling the look of your numbers with custom number formatting, you can control their color. For instance, to format percentages so that positive percentages appear blue with a +
symbol while negative percentages appear red with a −
symbol, enter this syntax in the Type input box:
[Blue]+0%;[Red]-0%
Notice that all it takes to apply a color is to enter the color name wrapped in square brackets: [ ]
.
There are only certain colors (the eight Visual Basic colors) you can call out by name, as shown here. These colors make up the first eight colors of Excel's legacy palette (the standard 56 colors that were the default in versions pre-2007).
[Black]
[Blue]
[Cyan]
[Green]
[Magenta]
[Red]
[White]
[Yellow]
Although you would typically specify a custom color by name, not all the Visual Basic colors are pleasing. Visual Basic Green is notoriously difficult to look at (bright neon green). See for yourself by entering the following code into the Type input box:
[Green]+0%;[Red]-0%
The good news is that there are 56 colors defined in the standard color palette by number. Every color in the standard 56-color palette is represented by a number. To call up a color by number, you would use [ColorN]
, where N
represents a number from 1 to 56.
In this example, you can use [Color10]
to present a much more acceptable green.
[Color10]+0%;[Red]-0%
Custom number formatting isn't just for numbers. You can also format dates and times. As Figure 21.4 illustrates, you use the same dialog box to apply date and time formats using the Type input box.
The code used for date and time formatting is fairly intuitive. For example, ddd
is the syntax for the three-letter day, mmm
is the syntax for the three-letter month, and yyyy
is the syntax for the four-digit year.
There are several variations on the format for days, months, years, hours, and minutes. It's worthwhile to take some time and experiment with different combinations of syntax strings.
Table 21.3 lists some common date and time format codes that you can use as starter syntax for your reports and dashboards.
TABLE 21.3 Common Date and Time Format Codes
Format Code | 1/31/2022 7:42:53 PM is Displayed As |
---|---|
m | 1 |
mm | 01 |
mmm | Jan |
mmmm | January |
mmmmm | J |
dd | 31 |
ddd | Mon |
dddd | Monday |
yy | 22 |
yyyy | 2022 |
mmm-yy | Jan-22 |
dd/mm/yyyy | 31/01/2022 |
dddd mmm yyyy | Monday Jan 2022 |
mm-dd-yyyy h:mm AM/PM | 01-31-2022 7:42 PM |
h AM/PM | 7 PM |
h:mm AM/PM | 7:42 PM |
h:mm:ss AM/PM | 7:42:53 PM |
Symbols are essentially tiny graphics, not unlike those you see when you use the Wingdings, Webdings, or other fancy fonts. However, symbols are not really fonts. They're Unicode characters. Unicode characters are a set of industry-standard text elements designed to provide a reliable character set that remains viable on any platform regardless of international font differences.
One example of a commonly used symbol is the copyright symbol (©). This symbol is a Unicode character. You can use this symbol on a Chinese, Turkish, French, or English (United States) PC, and it will reliably be available with no international differences.
In terms of Excel presentations, Unicode characters (or symbols) can be used in places where conditional formatting cannot. For instance, in the chart labels that you see in Figure 21.5, the x-axis shows some trending arrows that allow for an extra layer of analysis. This couldn't be done with conditional formatting.
Let's take some time to review the steps that led to the chart in Figure 21.5.
Start with the data shown in Figure 21.6. Note that you have a designated cell to hold any symbols that you're going to use (C1 in this case). This cell isn't really all that important. It's just a holding cell for the symbols that you'll insert.
Now, follow these steps:
Figure 21.10 illustrates what your percentages look like. Change any number from positive to negative (or vice versa), and Excel automatically applies the appropriate symbol.
Because charts automatically adopt number formatting, a chart created from this data will show the symbols as part of the labels. Simply use this data as the source for the chart.
This is just one way to use symbols in your reporting. With this basic technique, you can insert symbols to add visual appeal to tables, PivotTables, formulas, or any other object you can think of.
Microsoft Office, including Excel, provides access to a variety of customizable graphics images known as shapes. You might want to insert shapes to create simple diagrams, display text, or just add some visual appeal to a worksheet.
Keep in mind that shapes can add unnecessary clutter to a worksheet. Perhaps the best advice is to use shapes sparingly. Ideally, shapes can help draw attention to some aspect of your worksheet. They shouldn't be the main attraction.
You can add a shape to a worksheet by choosing Insert ➪ Illustrations ➪ Shapes. The Shapes gallery, shown in Figure 21.11, opens to show you the choices.
Shapes are organized into categories, and the category at the top displays the shapes that you've used most recently. To insert a shape into a worksheet, you can do one of the following:
Here are a few tips to keep in mind when creating shapes:
Excel 365 includes an icon library that offers free Scalable Vector Graphics (SVG) icons. SVG graphics can be sized and formatted without losing image quality. These icon graphics are essentially a modern set of graphic files that can be used to add spicy visual elements to your Excel dashboards and infographics.
To add an icon to your worksheet, select Insert ➪ Illustrations ➪ Icons. This activates the dialog box shown in Figure 21.12. Here you can browse by category or search for a topic. When you find the graphic you want, select it and then click Insert. You can also simply double-click the graphic. Excel will insert it into your workbook.
3D models are just what they sound like, graphics that can be dynamically rotated to see them from all sides. To add a 3D model to your worksheet, select Insert ➪ Illustrations ➪ 3D Models.
Just as with the previously mentioned icons, you can use the Online 3D Models dialog box to browse or search for certain objects. When you find the graphic you want, select it, and then click Insert or double-click the graphic. Excel will insert the graphic into your workbook. Figure 21.13 illustrates how a 3D model can be rotated and viewed from all angles.
You'll quickly find that the stock 3D models are frankly underwhelming and irrelevant to most Excel users. However, the real benefit comes to those who regularly use their own 3D models. Excel allows the use of custom 3D model files outside of the stock options provided. You can use any of the following valid file types:
To insert your own custom 3D model graphics, select Insert ➪ Illustrations and click the drop-down arrow next to the 3D Models command. Select the option labeled This Device. Excel opens a dialog box allowing you to browse your own device for the file you want to insert.
Although icons feel and behave like standard shapes, they have different contextual tabs.
When you select a shape, the Shape Format contextual tab is available, with the following groups of commands:
When you select an icon, the Graphics Format contextual tab is available with the following groups of commands:
When you select a 3D model, the 3D Model contextual tab is available with the following groups of commands:
As an alternative to the Ribbon, you can right-click the shape, icon, or 3D model and choose the Format option. This displays a task pane containing formatting options. Any changes made via the task pane appear immediately, and you can keep the Format task pane open while you work.
You could read 20 pages about formatting shapes, icons, and 3D models, but it wouldn't be a very efficient way of learning. The best way, by far, to learn about formatting shapes, icons, and 3D models is to experiment. The formatting commands are intuitive, and you can always use Undo if a command doesn't do what you expected it to do.
Most of us think of Excel shapes as mildly useful objects that can be added to a worksheet if we need to show a square, some arrows, a circle, and so forth. But if you use your imagination, you can leverage Excel shapes to create stylized interfaces that can really enhance your dashboards. Here are a few examples of how Excel shapes can spice up your dashboards and reports.
A peekaboo tab lets you tag a section of your dashboard with a label that looks like it's wrapping around your dashboard components. In the example illustrated in Figure 21.14, a peekaboo tab is used to label this group of components as belonging to the North region.
As you can see in Figure 21.15, there is no real magic here. It's just a set of shapes and text boxes that are cleverly arranged to give the impression that a label is wrapping around to show the region name.
Want to draw attention to handful of key metrics? Try wrapping your key metrics with a peekaboo banner. The banner shown in Figure 21.16 goes beyond boring text labels, allowing you to create the feeling that a banner is wrapping around your numbers. Again, this effect is achieved by layering a few Excel shapes so that they fall nicely on top of each other, creating a cohesive effect.
Here's an idea to get the most out of your dashboard real estate. You can layer pie charts with column charts to create a unique set of views (see Figure 21.17).
Each pie chart represents the percent of total revenue and a column chart showing some level of detail for the region. Simply layer your pie chart on top of a circle shape and a column chart.
Excel offers a way to alter shapes by editing their anchor points. This opens the possibility of creating your own infographic widgets. Right-click a shape and select Edit Points. This places little points all around the shape (see Figure 21.18). You can then drag the points to reconfigure the shape.
Constructed shapes can be combined with other shapes to create interesting infographic elements that can be used in your Excel dashboards. In Figure 21.19, a newly constructed shape is combined with a standard oval and text box to create nifty infographic widgets.
Dynamic labeling is less a function in Excel than it is a concept. Dynamic labels are labels that change to correspond to the data you're viewing.
Figure 21.20 illustrates one example of this concept. The selected Text Box shape is linked to cell C3 (note the formula in the Formula bar). As the value in cell C3 changes, the text box displays the updated value.
A linked picture is a special kind of shape that displays a live picture of everything in a given range. Think of a linked picture as a camera that monitors a range of cells.
To “take a picture” of a range, follow these steps:
The result is a live picture of the range you selected in step 1.
Linked pictures give you the freedom to test different layouts and chart sizes without the need to work around column widths, hidden rows, or other such nonsense. In addition, linked pictures have access to the Picture Format options. When you click on a linked picture, you can go to the Picture Format contextual tab and play around with the picture styles there.
Figure 21.22 illustrates two linked pictures displaying the contents of the ranges on the left. As those ranges change, the linked pictures on the right will update. These can be moved, resized, and even placed on a completely different sheet.
Using SmartArt, you can insert a variety of highly customizable diagrams into a worksheet. This feature is probably most useful in PowerPoint, as diagrams are more conducive to a presentation style. However, Excel offers SmartArt as yet another method of adding visualizations to your reporting solutions.
To insert SmartArt into a worksheet, choose the SmartArt command found under Insert ➪ Illustrations. Excel displays the Choose a SmartArt Graphic dialog box shown in Figure 21.23. The diagrams are arranged in categories along the left. When you find one that looks appropriate, click it for a larger view in the panel on the right, which also provides some usage tips. Then click OK to insert the graphic.
When you insert or select a SmartArt diagram, Excel displays the Text Pane, the Type Your Text Here window that guides you through entering text (see Figure 21.24).
To add an element to the SmartArt graphic, choose SmartArt Design ➪ Create Graphic ➪ Add Shape.
When working with SmartArt, keep in mind that you can move, resize, or format individually any element within the graphic. Select the element and then use the tools on the Format tab.
You can easily change the layout of a SmartArt diagram. Select the object and then choose SmartArt Design ➪ Layouts. Any text that you've entered remains intact.
After you decide on a layout, you may want to consider other styles or colors available in the SmartArt Design ➪ SmartArt Styles group.
You can use WordArt to create graphical effects in text.
To insert a WordArt graphic on a worksheet, choose Insert ➪ Text ➪ WordArt and then select a style from the gallery. Excel inserts an object with the placeholder text Your text here
. Replace that text with your own, resize it, and apply other formatting if you like.
When you select a WordArt image, Excel displays the Shape Format contextual tab. Use the controls to vary the look of your WordArt.
Excel can import a variety of graphics into a worksheet. You have several choices:
Graphics files come in two main categories:
When you insert a picture on a worksheet, you can modify the picture in a number of ways from the Picture Format contextual tab, which becomes available when you select a picture object. For example, you can adjust the color, contrast, and brightness. In addition, you can add borders, shadows, reflections, and so on—similar to the operations available for shapes.
In addition, you can right-click and choose Format Picture to use the controls in the Format Picture task pane.
An interesting feature is Artistic Effects. This command can apply a number of Photoshop-like effects to an image. To access this feature, select an image and choose Picture Format ➪ Adjust ➪ Artistic Effects. Each effect is somewhat customizable, so if you're not happy with the default effect, try adjusting some options.
Excel can also capture and insert a screenshot of any program currently running on your computer (including another Excel window). To use the screenshot feature, follow these steps:
You can use any of the normal picture tools to work with screenshots.
If you want to use a graphics image for a worksheet's background (similar to wallpaper on the Windows Desktop), choose Page Layout ➪ Page Setup ➪ Background and select a graphics file. The selected graphics file is tiled on the worksheet.
Unfortunately, worksheet background images are for onscreen display only. These images do not appear when the worksheet is printed.
The final section in this chapter deals with the Equation Editor. Use this feature to insert a nicely formatted mathematical equation as a graphics object. Start by choosing Insert ➪ Symbols ➪ Equation. Excel creates a text box and displays the Shape Format and Equation contextual tabs.
As you can see in Figure 21.25, the Equation tab looks complicated, but one quickly gets the hang of it. The idea is to “write” your equation by simply choosing the symbols you need from the options shown in Figure 21.25.
Generally, you add a structure and then edit the various parts by adding text or symbols. You can put structures inside structures, and there is no limit to the complexity of the equations. Because the equation objects you work with are similar to the other shape objects you've covered, it won't take long to get the hang of building your own equations.
If all that seems much too daunting, you can use the nifty Ink Equation feature, which allows you to simply draw your equation. Select Tools ➪ Ink Equation from the Equation tab to display the Math Input Control dialog box (see Figure 21.26). Here, you can draw your equation and have it translated to text. As you can see in Figure 21.26, Excel is quite accepting of even the shabbiest of penmanship.