SPARKLINE Function Reference
SPARKLINE puts a chart inside a cell. Not a chart floating over the sheet with its own frame and axes — a compact visualization living in one cell alongside the numbers it represents. Watchlists show 90-day trends. Sales trackers show weekly patterns. KPI tables show goal progress. All without opening the chart editor. This reference covers the four chart types, every option, color customization, and the patterns you'll use daily.
⚡ Quick Answer
SPARKLINE syntax: =SPARKLINE(data, [options]). Data is a range of numbers. Options is a set of key-value pairs controlling chart type, color, and behavior. Four chart types: line (default), bar, column, winloss. Options passed as an array: {"charttype", "column"; "color", "green"}. Cell height and width determine the sparkline dimensions.
Syntax
- data — a range of numeric values to visualize
- options — an array of key-value pairs configuring the chart (optional)
Options use array syntax: pairs separated by semicolons, keys and values by commas: {"key1", "value1"; "key2", "value2"}.
The 4 chart types
Line (default)
=SPARKLINE(A2:A30)Bar (horizontal stacked)
=SPARKLINE(A2, {"charttype", "bar"; "max", 100})Column (vertical)
=SPARKLINE(A2:A30, {"charttype", "column"})Win/loss
=SPARKLINE(A2:A30, {"charttype", "winloss"; "color", "green"; "negcolor", "red"})All SPARKLINE options
| Option | Applies to | Effect |
|---|---|---|
"charttype" | All | "line" (default), "bar", "column", or "winloss" |
"color" | All | Main color of the sparkline (name or hex) |
"negcolor" | column, winloss | Color for negative values |
"empty" | line | "zero" (draw zero) or "ignore" (skip empties) |
"nan" | line, column | "convert" (treat as zero) or "ignore" |
"ymin" | line, column | Minimum Y value; forces axis floor |
"ymax" | line, column | Maximum Y value; forces axis ceiling |
"max" | bar | Maximum value (100% of bar) |
"min" | bar | Minimum value (0% of bar) |
"linewidth" | line | Line thickness (1-10, default 1) |
"color1", "color2" | bar (stacked) | Colors for stacked bar segments |
"axis" | column | TRUE to draw a zero axis line |
"axiscolor" | column | Color of the axis line |
"firstcolor" | column | Color of the first data point |
"lastcolor" | column | Color of the last data point |
"highcolor" | column | Color of the highest value |
"lowcolor" | column | Color of the lowest value |
"rtl" | line, column | TRUE for right-to-left rendering |
Common patterns
Watchlist trend column
=SPARKLINE(GOOGLEFINANCE(A2, "price", TODAY()-90, TODAY(), "DAILY"),
{"charttype", "line"; "color", "#0F9D58"; "linewidth", 2})Progress bar
=SPARKLINE(B2, {"charttype", "bar"; "max", C2; "color", "#0F9D58"})Colored win/loss
=SPARKLINE(A2:A30,
{"charttype", "winloss";
"color", "#0F9D58";
"negcolor", "#C13B3B"})Column with high/low highlighting
=SPARKLINE(A2:A13,
{"charttype", "column";
"color", "#7A5290";
"highcolor", "#0F9D58";
"lowcolor", "#C13B3B"})Zero-baseline column
=SPARKLINE(A2:A30,
{"charttype", "column";
"axis", TRUE;
"axiscolor", "#999";
"color", "#0F9D58";
"negcolor", "#C13B3B"})Sizing sparklines
SPARKLINE renders within the cell dimensions. To make sparklines bigger or smaller:
- Row height controls sparkline height. Set with Format → Row height.
- Column width controls sparkline width. Drag column border or right-click column header.
- Merged cells let a sparkline span multiple columns for a wider view.
Compact: 20-30px row height, 60-80px column width. Standard: 30-50px row height, 80-120px column width. Detailed: 60-100px row height, 150-250px column width. Above ~100px, consider a real chart instead.
Limitations
No tooltips
SPARKLINE has no interactive elements — no hover tooltips, no click handlers, no data labels. It's purely visual. For interactivity, use a real chart.
No axes labels
The chart type "column" or "line" doesn't include X or Y axis labels. Context comes from the surrounding cells, not the sparkline itself.
Print quality
Sparklines render clean on-screen but sometimes look pixelated in print. Consider a real chart for anything that will be printed at scale.
No secondary series
Single data series only. Can't overlay two lines for comparison in one sparkline — use a real chart or two side-by-side sparklines.
Sheets Wizard — sparkline-heavy dashboards fast
Describe your dashboard — "portfolio tracker with ticker, current price, 90-day sparkline, YTD sparkline, and gain/loss color" — and Sheets Wizard scaffolds the whole thing with correctly nested SPARKLINE + GOOGLEFINANCE formulas. Options syntax handled automatically.
Install Sheets Wizard →Frequently asked questions
What is a SPARKLINE in Google Sheets?
SPARKLINE is a function that renders a small chart inside a single cell. Instead of building a full chart with its own frame and axes, SPARKLINE displays a compact visualization directly where numbers live — line charts, bar charts, column charts, and win/loss charts all fit inside one cell. Perfect for dashboards, watchlists, and any table where visual context helps but a full chart would overwhelm.
What chart types does SPARKLINE support?
Four types: (1) line — default, a mini line chart. (2) bar — horizontal stacked bar, useful for progress indicators. (3) column — small vertical column chart. (4) winloss — special column chart showing positive/negative values as up/down bars, common in sports stats. Type is set via the options argument: SPARKLINE(data, {"charttype", "line"|"bar"|"column"|"winloss"}).
How do I customize SPARKLINE colors?
Add color options to the second argument: SPARKLINE(A2:A30, {"charttype", "line"; "color", "green"}). For conditional coloring — different colors for positive vs negative — use "color" for the base color and "negcolor" for negative values (winloss and column charts). For per-column colors in a column chart, use "lowcolor", "highcolor", "firstcolor", "lastcolor", "axiscolor".
Does SPARKLINE work in Excel?
Excel has sparklines but they work differently — they're inserted via Insert → Sparklines, not created via formula. Excel sparklines are attached to cells but stored as metadata, not formulas. Google Sheets' SPARKLINE is a formula, which makes it easier to copy across rows, drive from other formulas, or embed in dynamic dashboards. Both platforms have the concept; the implementation differs.