SPARKLINE Function in Google Sheets
Renders a tiny inline chart inside a single cell. Bar charts, line charts, win/loss markers, and progress bars — all without leaving the cell. Perfect for dashboards and trend columns.
Syntax
SPARKLINE(data, [options])Returns: An inline chart rendered in the cell.
Excel equivalent: Sparklines (different syntax — Excel uses Insert → Sparklines menu)
Parameters
| Name | Required | Description |
|---|---|---|
| data | Required | The range of values to chart. |
| options | Optional | A range or array of option key/value pairs controlling chart type, colors, axis, and more. |
Examples
Simple line trend
=SPARKLINE(B2:B13)Renders a tiny line chart of 12 monthly values inline. Defaults to line chart.
Colored bar chart
=SPARKLINE(B2:B13, {"charttype", "column"; "color", "#3366cc"})Column chart with custom color. The {} syntax passes a 2D options array.
Progress bar (target vs actual)
=SPARKLINE({B2, C2-B2}, {"charttype", "bar"; "max", C2; "color1", "#10b981"})Filled bar showing B2's progress toward C2. Classic progress-bar pattern.
Win/loss marker
=SPARKLINE(B2:B13, {"charttype", "winloss"; "negcolor", "red"})Each value renders as up or down marker. Useful for time-series of gains/losses.
When to use an alternative
- Chart insert — You want a real chart, not an inline mini chart.
- Conditional formatting data bars — You want progress bars but only need built-in styling.
- Apps Script for custom rendering — Sparkline option set is too limited.
Common errors and how to fix them
Renders as text instead of chart
Cause: Cell row height too small.
Fix: Increase row height. Sparklines need at least ~20px to render.
Options syntax
Cause: Single quotes vs double, comma vs semicolon.
Fix: Use {"key","value";"key2","value2"} — semicolons separate option pairs, commas separate key from value.
Related functions
Frequently Asked Questions
What sparkline types are supported?
Four: "line" (default), "bar" (horizontal stacked progress bar), "column" (vertical bars), and "winloss" (up/down markers). Each takes different options like color, negcolor, max, min.
Can I show a value label on a sparkline?
Not directly — sparklines render only the chart. Common pattern: put the label in an adjacent cell. E.g., column A has the entity name, column B has SPARKLINE, column C has the latest value as TEXT.