0
0
Google-sheetsHow-ToBeginner ยท 3 min read

How to Use SPARKLINE in Google Sheets: Simple Guide

Use the SPARKLINE function in Google Sheets to create small charts inside a cell. The basic syntax is =SPARKLINE(data, [options]), where data is the range of values and options customize the chart type and style.
๐Ÿ“

Syntax

The SPARKLINE function has two parts:

  • data: The range or array of numbers you want to visualize.
  • options (optional): A set of key-value pairs to customize the chart type, color, and style.

Example syntax:

=SPARKLINE(A1:A10, {"charttype", "line"})

plaintext
=SPARKLINE(data, [options])
๐Ÿ’ป

Example

This example creates a simple line sparkline from values in cells A1 to A5.

plaintext
=SPARKLINE(A1:A5, {"charttype", "line"})
Output
A small line chart inside the cell showing trends of values in A1 to A5
โš ๏ธ

Common Pitfalls

  • Not using a numeric range for data causes errors or no chart.
  • Forgetting to use curly braces {} around options or incorrect key-value pairs leads to no effect.
  • Using unsupported chart types or misspelled options will default to a line chart or error.

Correct option format example: {"charttype", "bar"}

plaintext
=SPARKLINE(A1:A5, {"charttype", "bar"})  // Correct usage
=SPARKLINE(A1:A5, "charttype", "bar")  // Incorrect, missing braces
๐Ÿ“Š

Quick Reference

OptionDescriptionExample Value
charttypeType of sparkline chart"line", "bar", "column", "winloss"
colorColor of the chart"red", "blue", "#00FF00"
linewidthThickness of line (for line charts)2
maxMaximum value for scale100
minMinimum value for scale0
โœ…

Key Takeaways

Use =SPARKLINE(range, {"charttype", "type"}) to create mini charts inside cells.
Always provide numeric data ranges for the sparkline to work correctly.
Customize chart type and colors using the options parameter with key-value pairs inside curly braces.
Common chart types include line, bar, column, and winloss.
Incorrect option formatting or unsupported types cause errors or default charts.