Skip to main content

Stacked Sparklines

Stacked sparklines are small charts that show how multiple data series contribute to a total. Each segment represents a part of the total for a given point, making it easy to visualize both overall trends and individual contributions. The stacking effect helps compare proportions and totals across time or categories.

When to use stacked sparklines

  • Showing cumulative data: Visualize how different sources—such as revenue streams or product categories—build up to a total.
  • Comparing proportions: Show how each segment contributes to the whole across points in time or grouped categories.
  • Breaking down overall trends: Present both total values and their individual components in one compact view.

Create a stacked sparkline

  1. On the Insert tab, select Sparklines.
  2. Under Bar Sparkline, select Insert Stacked Sparkline. The Create Sparklines dialog opens.
  3. In Data Range, select a continuous range of cells (in the same row or column).
  4. In Location Range, select the cell where the sparkline will appear.
  5. Click Ok. The sparkline is inserted into the selected cell.

Edit a stacked sparkline

  1. Select the stacked sparkline in your workbook.
  2. On the Sparkline tab, select Settings. The StackedSparkline Setting dialog opens.
  3. Set the parameters, then click Ok.
  4. Copy and paste the sparkline cell to duplicate the configuration in another location, as needed.

Stacked sparkline parameters

The stacked sparkline formula supports the following format:
=STACKEDSPARKLINE(points, colorRange?, labelRange?, maximum?, targetRed?, targetGreen?, targetBlue?, targetYellow?, color?, highlightPosition?, vertical?, textOrientation?, textSize?)

ParameterDescription
PointsDefines the range of cells containing values, such as A1:A4. Invalid or empty values are treated as 0.
ColorRange(Optional) Sets a cell range containing colors for each segment, such as B1:B4. If omitted, colors are generated from the base color.
LabelRange(Optional) Sets a cell range containing text labels for each segment, such as C1:C4. If omitted, no labels are shown.
Maximum(Optional) Sets the maximum value for the sparkline. If omitted, the sum of all positive values is used.
TargetRed(Optional) Sets the position of a red reference line.
TargetGreen(Optional) Sets the position of a green reference line.
TargetBlue(Optional) Sets the position of a blue reference line.
TargetYellow(Optional) Sets the position of a yellow reference line.
ColorSets a base color for generating segment colors when ColorRange is not defined. Default is #646464.
HighlightPosition(Optional) Sets the index of the segment to highlight.
TextOrientationSets label orientation: Horizontal (default) or Vertical.
TextSize(Optional) Sets the font size (in pixels) for labels. Default is 10.
Vertical(Optional) Display the sparkline vertically when selected.