Vbar Sparklines

To create vertical bar sparklines in the workbook:

  1. Click Insert from the menu.

  2. Click Sparkline and select the vbar sparkline under Bar Sparkline from the list.

  3. In the VbarSparkline Setting dialog box:

    1. Enter the number or reference that represents the length of the bar, such as 0.3 or "A1".

    2. Select the color scheme. The default value is "gray".

    3. Click OK.

  4. The sparkline is displayed in the cell. Click the function to edit the sparkline parameters.

  5. Set the parameters as described below and click OK.

    The vbar sparkline formula has the following format:

    =VBARSPARKLINE(value, colorScheme, axisVisible, barWidth)

  6. Copy and paste the cell as needed to finalize your vbar sparklines.

Vbar sparkline parameter Description
Value

Number or reference that represents the length of the bar, such as 0.3 or "A1".

  • If the value is greater than 100% or smaller than -100%, an arrow is displayed.

  • For positive values, the sparkline starts at bottom of cell; For negative values, the sparkline starts at top of cell.

colorScheme String that represents the color of the bar; the default value is "gray".
axisVisible (Optional) Boolean that represents whether to show the axis; the default value is true.
barHeight (Optional) Number that represents the percentage of bar height according to the cell height (value > 0 and value <= 1).
barWidth (Optional) Number that represents the percentage of bar height according to the bar width (value > 0 and value <= 1).
LET function

(Optional) You can add a LET function to set colors according to specific values with IF statements.

For example:

=LET(ref,C3,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"))))),VBARSPARKLINE(ref,color,TRUE,0.4))