Locked lesson.
About this lesson
Represent values and trends in a cell using Sparklines and Data Bars.
Exercise files
Download this lesson’s related exercise files.
07-06-Sparklines and Data Bars-Start.xlsx14.4 KB 07-06-Sparklines and Data Bars-Complete.xlsx
15 KB 7.06 create-in-cell-charts - Exercise.docx
43.3 KB Exercise - Create In-Cell Charts Data Bars and Sparklines.xlsx
39 KB 7.06 create-in-cell-charts - Exercise solution.docx
202.7 KB Exercise Solution - Create In-Cell Charts Data Bars and Sparklines.xlsx
41.3 KB
Quick reference
Create In-Cell Charts: Sparklines and Data Bars
Visualize trends using in-cell charts.
When to use
We use Data Bars and Sparklines whenever we want to visualize data based on the value in the cell or track trends in data.
Instructions
In-cell charts are mini-charts that show in the cell. They help is visualize data at the cell level and also visualize trends.
In this example, we will look at two types of in-cell charts: Data Bars and Sparklines.
Data Bars
Data Bars are part of Excel's Conditional Formatting tools. They help us visualize and compare values in individual cells.
- Select the data.
- From the Home tab, in the Styles group, click Conditional Formatting.
- Hover the mouse over Data Bars.
We can choose Solid Fill or Gradient Fill Data Bars.
Modify Conditional Formatting Rules
When we add data bars, we are essentially creating a conditional formatting rule. We can make changes to the look and feel of the data bars by editing the rule.
- Click in any cell that contains a data bar.
- From the Home tab, in the Styles group, click Conditional Formatting and Manage Rules.
- Select the rule.
- Click Edit Rule.
By default, data bars will use the minimum and maximum values in the data to determine the length of each bar in relation to the other bars.
We can change this, by changing the type.
For example, if we select Number from the drop-down list, we can set the minimum and maximum values we want the data bars to use.
We also might want to only show the bar and not the value in the cell. This is useful if you are presenting confidential data to an audience. A good example would be a spreadsheet that contains people's salaries.
- Check the Show bar only box.
- Click OK.
We can also modify the Bar Appearance. We can change the fill color to a custom color and also add a border.
- Click OK.
Sparklines
Sparklines differ from Data Bars in that they show trends in data over time. There are three types of Sparkline: Line, Column, and Win/Loss.
The Line Sparkline will show trends plotted on a line chart.
The Column Sparkline shows positive and negative values as columns.
The Win/Loss sparkline simply highlights the positive and negative values without representing the actual value.
- Select the data.
- From the Insert tab, in the Sparklines group, click Line.
The Create Sparkline dialog box will open. If we already have our data selected, the Data Range field will be populated with the correct cell range. The Location Range is where we want to create the sparklines.
- Click OK.
An example of the column sparkline option.
An example of the win/loss sparkline option.
Edit the Sparklines
We can make changes to the look and feel of our sparklines using the Sparkline contextual ribbon.
Change the Sparkline Style
- From the Sparkline tab, in the Style group, expand the gallery.
- Choose a style from the gallery.
Once again, the colors we see here are controlled by the theme we are using in Excel. To choose a different color, click the Sparkline Color drop-down and select a color from the palette or choose More colors.
Add and Modify Markers
We can add markers to our line to highlight specific data points.
- From the Sparkline tab, in the Show group, choose a marker option.
We can choose to show a marker for the high point, low point, first point, or last point. To show a marker for all data points, select Markers.
Choose a marker color from the gallery.
We now have a marker that represents each data point (month).
Hints & tips
- Sparklines cannot be deleted by simply selecting the cell range and pressing Delete. We need to select the sparklines and then go to the Sparkline tab and choose Clear.
Lesson notes are only available for subscribers.