A data bar is a horizontal bar that appears in a cell to graphically represent the value in a corresponding cell. Normally, you'll use data bars to represent the values of multiple cells so that you can see the relationship among the cells' values.
For example, the worksheet in Figure 8–1 uses data bars to show the sales by five different salespeople for April, May, June, and the second quarter of the year as a whole. Each cell that contains a data bar has the same value as the cell to its left, so the data bar in cell C2 illustrates the value shown in cell B2. Looking at the data bars, you can easily see that although Salesperson Smith had a weak April and a shoddy May, her strong June sales brought her up to a respectable result for the quarter overall.
Figure 8–1. Data bars give a quick graphical representation of the values in the cells. Here, each cell showing a data bar contains the same value as the cell to its left.
By default, Excel places data bars alongside the data they represent. You can choose to display only the data bars in the cells, or you can display the data bars in separate cells to make the worksheet easier to read.
To create data bars that appear in the same cells as their data, follow these steps:
Home
Format
Conditional Formatting
Data Bars
to display the Data Bars panel (see Figure 8–2).
Figure 8–2. Use the Home
Format
Conditional Formatting
Data Bars
command to create data bars in the selected cells. You can choose between a gradient fill and a solid fill.
TIP: A gradient fill works best for data bars you display in the same cells as their data, because the lighter end of the gradient leaves the text readable. For data bars you display in cells on their own, you may prefer solid fills.
Figure 8–3. After creating data bars (left), you may need to widen the column to give them more impact (right).
To make your data bars easy to read, you may want to have them appear in cells on their own, either with the underlying data appearing in cells alongside them (or elsewhere, as needed) or without the data appearing at all. You can make the data bars appear on their own in cells by setting Excel to display only the data bars there. If you want the data for the data bars to be visible, you need to place it in different cells.
To make the data bars appear without their data, follow these steps:
Home
Format
Conditional Formatting
Manage Rules
to display the Manage Rules dialog box (see Figure 8–4).
Figure 8–4. In the Manage Rules dialog box, select the rule for the data bars, then click the Edit Rule button.
Figure 8–5. In the Edit Formatting Rule dialog box, select the Show data bar only check box if you want to display the data bars without the values that produced them.
TIP: With the Edit Formatting Rule dialog box open, you can quickly change among data bars, icon sets, and color scales. Just open the Style pop-up menu and choose 2-Color Scale, 3-Color Scale, Data Bar, or Icon Sets, as appropriate.
To create data bars that appear in separate cells from the values that produce them, set up the cells that will contain the data bars with formulas referring to the cells that contain the values. For example, the worksheet shown in Figure 8–6 uses simple formulas such as =B2 to make the cells in column C have the same values as the cells in column B. You can then set up the data bars as described earlier in this chapter in the target cells—in this case, in column C.
Figure 8–6. When you need to produce data bars in cells separate from their data, use formulas to give the data-bar cells the same values as the cells that provide the data. For example, cell C2 here contains the formula =B2 and will show the data bar for the value in cell B2.
3.14.144.216