SPARKLINE Function Reference — Google Sheets (2026)
Home›Google Sheets›Functions›SPARKLINE
Google SheetsReference

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

SPARKLINE syntaxSPARKLINE(data, [options])
  • 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)

Simple line sparkline
=SPARKLINE(A2:A30)
Renders the values in A2:A30 as a mini line chart. Default type — no options needed.

Bar (horizontal stacked)

Progress-bar style
=SPARKLINE(A2, {"charttype", "bar"; "max", 100})
Renders a single value as a horizontal bar. With "max" set, becomes a progress bar (value as % of max). Useful for goal completion, capacity utilization, etc.

Column (vertical)

Column chart
=SPARKLINE(A2:A30, {"charttype", "column"})
Small vertical column chart. Better than line for discrete values or short time series.

Win/loss

Win/loss chart
=SPARKLINE(A2:A30, {"charttype", "winloss"; "color", "green"; "negcolor", "red"})
Special column chart where positive values render as up-bars and negative as down-bars. All bars the same height regardless of magnitude. Great for wins/losses, up/down days, gain/loss patterns.

All SPARKLINE options

OptionApplies toEffect
"charttype"All"line" (default), "bar", "column", or "winloss"
"color"AllMain color of the sparkline (name or hex)
"negcolor"column, winlossColor for negative values
"empty"line"zero" (draw zero) or "ignore" (skip empties)
"nan"line, column"convert" (treat as zero) or "ignore"
"ymin"line, columnMinimum Y value; forces axis floor
"ymax"line, columnMaximum Y value; forces axis ceiling
"max"barMaximum value (100% of bar)
"min"barMinimum value (0% of bar)
"linewidth"lineLine thickness (1-10, default 1)
"color1", "color2"bar (stacked)Colors for stacked bar segments
"axis"columnTRUE to draw a zero axis line
"axiscolor"columnColor of the axis line
"firstcolor"columnColor of the first data point
"lastcolor"columnColor of the last data point
"highcolor"columnColor of the highest value
"lowcolor"columnColor of the lowest value
"rtl"line, columnTRUE for right-to-left rendering

Common patterns

Watchlist trend column

Stock 90-day trend
=SPARKLINE(GOOGLEFINANCE(A2, "price", TODAY()-90, TODAY(), "DAILY"),
  {"charttype", "line"; "color", "#0F9D58"; "linewidth", 2})
Nested inside a portfolio tracker. Column A has tickers; sparkline shows the last 90 days for each. Fully dynamic — updates as time passes.

Progress bar

Goal completion percentage
=SPARKLINE(B2, {"charttype", "bar"; "max", C2; "color", "#0F9D58"})
B2 is actual, C2 is target. The sparkline shows how much of the target has been achieved. Great for KPI dashboards.

Colored win/loss

Daily gain/loss pattern
=SPARKLINE(A2:A30,
  {"charttype", "winloss";
   "color", "#0F9D58";
   "negcolor", "#C13B3B"})
Positive days green, negative days red. Instantly readable "run" pattern for stocks, sales, or any daily metric with positive/negative swings.

Column with high/low highlighting

Quarterly revenue with highlights
=SPARKLINE(A2:A13,
  {"charttype", "column";
   "color", "#7A5290";
   "highcolor", "#0F9D58";
   "lowcolor", "#C13B3B"})
Monthly columns purple by default. Highest month highlighted green; lowest red. Great for annual performance visuals.

Zero-baseline column

Above/below target column
=SPARKLINE(A2:A30,
  {"charttype", "column";
   "axis", TRUE;
   "axiscolor", "#999";
   "color", "#0F9D58";
   "negcolor", "#C13B3B"})
Columns above the axis line are one color, below are another. Useful for showing variance from a target or budget.

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.
Standard sparkline sizes

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.

Dashboard Builder

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.