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