Skip to main content

Horizontal Bar Sparklines

Horizontal bar sparklines, also called hbar sparklines, are small bar charts that display data as horizontal bars. They are used to compare values across categories in a compact, space-efficient format.

When to use horizontal bar sparklines

  • Comparing multiple categories: Compare values such as sales, expenses, or performance across categories or time periods.
  • Tracking trends or rankings: Show which categories are performing well and which are underperforming along a horizontal axis.
  • Spotting variations: Make it easier to detect patterns, fluctuations, or outliers in category-based data.

Create a horizontal bar sparkline

  1. On the Insert tab, select Sparklines.
  2. Under Bar Sparkline, select Insert Hbar Sparkline. The HbarSparkline Setting dialog opens.
  3. Enter a number or reference that defines the length of the bar, such as 0.3 or A1.
  4. Select the color scheme. The default is gray.
  5. Click Ok. The sparkline is inserted into the selected cell.

Edit a horizontal bar sparkline

  1. Select the horizontal bar sparkline in your workbook.
  2. On the Sparkline tab, select Settings. The HbarSparkline 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.

Horizontal bar sparkline parameters

The horizontal bar sparkline formula supports the following format:

=HBARSPARKLINE(value, colorScheme, axisVisible, barHeight)
ParameterDescription
ValueSpecify the length of the bar, such as 0.3 or A1.

  • Values above 100% or below -100% display an arrow.
  • Positive values start from the left side of the cell; negative values start from the right.
ColorSchemeSet the color of the bar. Default: gray.
axisVisible(Optional) Show or hide the axis. Default: true.
barHeight(Optional) Set the bar height as a percentage of the cell height (greater than 0 and less than or equal to 1).
LET function(Optional) Define bar color based on value using the LET function with IF conditions.

Example – Bar color based on performance

To dynamically change the bar color based on performance levels, assign a different color to each threshold. In this example, the value in B7 represents a performance score between 0 and 1. Higher scores receive darker, stronger colors, while lower scores shift toward lighter or warning colors. The formula below:

  • Stores the performance value in a variable (ref)
  • Determines the appropriate color based on defined thresholds
  • Generates a horizontal bar sparkline using that color
=LET(ref,B7,color,IF(ref>=0.8,"#092834",IF(ref>=0.6,"#347B98",IF(ref>0.4,"#66B032",IF(ref>=0.2,"#B2D732",IF(ref>=0,"#F0F7D4","red"))))),HBARSPARKLINE(ref,color))