Google Sheets Tips

SPARKLINE in Google Sheets: chart types, options and examples

SPARKLINE draws a miniature chart inside one cell: a line by default, or columns, a bar or a win/loss chart. This guide lists the options of each chart type, shows them on real data, and covers progress bars, a common scale for rows that are compared, ranges that grow with the data, and the mistakes that leave the cell empty or show an error.

Google Sheets TipsVadym Kramarenko10 min read

SPARKLINE in Google Sheets: chart types, options and examples

The SPARKLINE function draws a small chart inside one cell:

=SPARKLINE(C3:L3)

With no options it draws a line through the values of the range. Fill the formula down and every row of a table gets its own trend line next to the numbers.

Google Sheets with monthly sales of one customer in C3:L3 and the formula =SPARKLINE(C3:L3) drawing a small line chart in a cell

Syntax

Syntax

=SPARKLINE(data, [options])

  • data: the range or array to plot.
  • options: optional settings, written as pairs of name and value in curly braces: {"charttype", "column"; "color", "green"}. The name and the value are separated by a comma, the pairs by a semicolon.

The option charttype sets one of four chart types:

charttype Draws Typical use
"line" (default) A line through the values A trend over time
"column" One column per value Values of a period compared
"bar" One stacked horizontal bar Progress towards a target, shares of a total
"winloss" Equal blocks above or below a line Positive or negative, with no size

The options of each type, from Google’s reference for SPARKLINE (checked in October 2026):

Option Line Column and winloss Bar What it sets
color yes yes The color of the line or the columns
color1, color2 yes The colors of the bar segments
linewidth yes The thickness of the line
xmin, xmax yes The ends of the horizontal axis
ymin, ymax yes yes (not winloss) The ends of the vertical scale
max yes The value of a full-width bar
lowcolor, highcolor yes The color of the lowest and highest column
firstcolor, lastcolor yes The color of the first and last column
negcolor yes The color of negative columns
axis, axiscolor yes A line at zero, and its color
empty yes yes yes Empty cells: "zero" or "ignore"
nan yes yes yes Text cells: "convert" or "ignore"
rtl yes yes yes Draw from right to left: true or false

Colors are written as names (“green”) or hex codes (“#009b3b”).

Line sparklines

Line sparklines

=SPARKLINE(C3:L3)

Google Sheets with monthly sales of ten customers and a line sparkline in each row

Color and line width

=SPARKLINE(C3:L3, {"color", "#009b3b"})

Line sparklines in Google Sheets drawn in different colors with the color option

=SPARKLINE(C3:L3, {"linewidth", 5})

Line sparklines in Google Sheets drawn as thick lines with the linewidth option set to 5

The color of a line sparkline also follows the font color of the cell, so it can be set from the toolbar or by conditional formatting.

A common scale

By default every sparkline is scaled to its own lowest and highest value, so a customer who went from 60 to 80 and one who went from 150 to 240 draw the same rising line. To compare rows, give them the same scale:

=SPARKLINE(C3:L3, {"ymin", 60; "ymax", 240})

With two columns of data, the first is the horizontal position and the second the value, and all four limits can be set:

=SPARKLINE(B3:C12, {"xmin", 1; "xmax", 10; "ymin", 60; "ymax", 240})

Google Sheets with month numbers in column B and sales in column C and a line sparkline with xmin, xmax, ymin and ymax set

Empty cells and text

By default empty cells are skipped and the line connects the neighbours. With “empty” set to “zero” they are drawn as zero:

=SPARKLINE(C3:L3, {"empty", "zero"})

Line sparklines in Google Sheets that dip to the bottom where a month is empty, drawn with the empty option set to zero

Cells with text such as “N/A” are skipped too; “nan” set to “convert” draws them as zero:

=SPARKLINE(C3:L3, {"nan", "convert"})

Line sparklines in Google Sheets over rows that contain N/A, Blank and Text, drawn with the nan option set to convert

A dip to zero reads as “no sales”. If the value is unknown, not zero, leave the default.

Right to left

=SPARKLINE(C3:L3, {"rtl", true})

Line sparklines in Google Sheets drawn from right to left with the rtl option

The Turning Point

OWOX Data Marts

See your first report built in real time. 15 minutes.

  1. Connect your data warehouse
  2. Pick your metrics
  3. Get a live Google Sheets report

In the time it takes to write a ticket. Then imagine never writing that ticket again.

Book a Demo

We'll use your actual use case

Column sparklines

Column sparklines

=SPARKLINE(C3:L3, {"charttype", "column"})

Column sparklines in Google Sheets with one column per month for each customer

The scale of a column sparkline starts at the lowest value of its range, so the smallest column is almost invisible and small differences look large. Set "ymin", 0 for columns in proportion to the values:

=SPARKLINE(C3:L3, {"charttype", "column"; "ymin", 0})

A fixed range for all rows makes them comparable:

=SPARKLINE(C3:L3, {"charttype", "column"; "ymin", 60; "ymax", 240})

Column sparklines in Google Sheets drawn on the same scale from 60 to 240 with ymin and ymax

Highlight single columns

=SPARKLINE(C3:L3, {"charttype", "column"; "highcolor", "green"; "lowcolor", "yellow"; "lastcolor", "blue"; "negcolor", "red"})

Column sparklines in Google Sheets with the highest column green, the lowest yellow, the last blue and negative columns red

One highlighted column is usually enough: a neutral color for all, and lastcolor for the current period.

An axis for negative values

=SPARKLINE(C3:L3, {"charttype", "column"; "axis", true; "axiscolor", "red"})

Column sparklines in Google Sheets with positive and negative values and a red axis line at zero

Bar sparklines

Bar sparklines

A bar sparkline is one horizontal bar. Each value of the data is a segment, and “max” is the value at which the bar fills the cell.

A progress bar

=SPARKLINE(C3, {"charttype", "bar"; "max", MAX($C$3:$C$12)})

Bar sparklines in Google Sheets where the length of each bar shows the January sales of each customer relative to the highest value in the column

With the same “max” in every row, the bars can be compared down the column. For progress towards a target, use the target: =SPARKLINE(B2, {"charttype", "bar"; "max", C2}), or "max", 1 for a share between 0 and 1.

Two segments

=SPARKLINE(C3:D3, {"charttype", "bar"})

Bar sparklines in Google Sheets with two segments for the January and February sales of each customer

=SPARKLINE(C3:D3, {"charttype", "bar"; "color1", "green"; "color2", "red"})

Bar sparklines in Google Sheets with a green and a red segment set by color1 and color2

Shares of a total

When the two values add up to 1, the bar shows their split:

=SPARKLINE(C3:D3, {"charttype", "bar"; "max", 1})

Bar sparklines in Google Sheets showing the split between new and returning sales as two segments that fill the cell

Win/loss sparklines

Win/loss sparklines

A win/loss chart draws one block per value, above the line for positive numbers and below it for negative ones. The size of the number is ignored.

=SPARKLINE(C3:L3, {"charttype", "winloss"})

Win/loss sparklines in Google Sheets with blocks above the line for months with growth and below it for months with a decline

The chart type is written “winloss”, in one word. With a hyphen, “win-loss”, the formula returns #VALUE!.

The color options of column sparklines apply here as well:

=SPARKLINE(C3:L3, {"charttype", "winloss"; "color", "gray"; "negcolor", "red"; "firstcolor", "blue"; "lastcolor", "orange"})

Win/loss sparklines in Google Sheets with custom colors for the first, last, highest, lowest and negative blocks

Advanced examples

Advanced examples

Options from cells

Any option value can be a cell reference, which lets each row have its own setting without a different formula:

=SPARKLINE(C3:L3, {"linewidth", M3; "color", N3})

Line sparklines in Google Sheets whose line width and color are read from two columns next to the data

Only some columns of a row

Join parts of a row in curly braces:

=SPARKLINE({C3:E3, H3:J3}, {"charttype", "column"})

Column sparklines in Google Sheets built from two separate parts of each row, joined in curly braces

A range that grows

A range without an end row includes values added later:

=SPARKLINE(C3:C)

For the last four values of a growing column:

=SPARKLINE(CHOOSEROWS(FILTER(C3:C, C3:C <> ""), -4, -3, -2, -1))

FILTER removes the empty cells and CHOOSEROWS takes the last four rows of what is left. The screenshot gets the same four months with INDIRECT and MATCH on the name of the last month; the formula above needs no month name.

Google Sheets with monthly sales in column C and a line sparkline of the last four months

Stock prices

GOOGLEFINANCE returns a table of dates and prices, which SPARKLINE plots directly:

=SPARKLINE(GOOGLEFINANCE($C3, "price", TODAY()-60, TODAY(), "DAILY"), {"linewidth", 2; "color", "#5f88cc"})

Google Sheets with company names and ticker symbols and a line sparkline of the last 60 days of each stock price

Errors and empty cells

Errors and empty cells

⚠️ Error: #VALUE!

✅ Solution: An option value is not valid, most often “win-loss” for “winloss”.

⚠️ Error: #N/A

✅ Solution: The data holds no numbers. Check that the range is the right one and that the numbers are not stored as text.

⚠️ Error: An option has no effect and there is no error.

✅ Solution: A misspelled option name is ignored silently. Check the spelling against the table above: “colour” does nothing, “color” works. Also check that the option belongs to the chart type: “max” is for bars, “ymax” for lines and columns.

⚠️ Error: The cell looks empty.

✅ Solution: There is one value only (a line needs two points), the line is the same color as the background, or the row is too low to show the chart. Make the row taller or the column wider.

⚠️ Error: Rows cannot be compared: every line fills its cell.

✅ Solution: Each sparkline has its own scale. Set the same “ymin” and “ymax”, or the same “max” for bars, in every row.

⚠️ Error: A formula parse error in a locale with decimal commas.

✅ Solution: Inside the option braces, such locales use a backslash between name and value: {"charttype"\"column"}.

Related guides

A trend line needs every period in the row

A trend line needs every period in the row

A sparkline is useful because it sits next to the number it explains. It is only as good as the row behind it: twelve months in twelve cells, the same metric in each. When those cells are filled by hand from exports, a missing month is a gap that the default settings quietly skip, and the line looks smoother than the business was.

The OWOX Data Marts extension for Google Sheets covers that half. A data analyst publishes a data mart (a table or an SQL query in your data warehouse) and makes it available for reports. In Sheets you open the extension, pick the data mart, tick the columns you want and run it. The rows land in a tab, ready for your formulas.

Google Sheets with the OWOX Data Marts extension open beside an ad spend table: the Unified Ad Spend data mart, nine of fourteen columns ticked and a Save & Run button – the rows in the sheet come from a governed data mart, not a pasted export

What changes for the person who maintains the sheet:

  • Refresh replaces re-export. Refresh current report in the extension menu re-runs the same pull, and a scheduled refresh keeps the tab current without anyone touching it.
  • The source is written on the sheet. The header cell of an imported tab carries a note with the data mart it came from, the time of the import and a link to the report.
  • No SQL and no warehouse access needed. The analyst decides which data marts and columns are available. You choose from that list.

The extension does not write or change the analyst’s SQL. Each refresh fills the same columns with the current periods, and the sparklines next to them redraw on their own. The extension comes with the OWOX Cloud plans of OWOX Data Marts; spreadsheet reporting describes both ways data reaches a sheet.

Your New Normal

Turn your data into decisions.

Governed data marts give you the clean foundation ML needs to actually work.

  • No AI hallucinations
  • Analyst-governed definitions
  • Every number traces to SQL
Get started free

FAQ

Frequently Asked Questions

How do I compare multiple SPARKLINES on the same scale?

To ensure fair comparison, use the "min" and "max" options in each SPARKLINE formula to standardize Y-axis values across rows or columns.

Can I use SPARKLINE with dynamic data?

Yes, SPARKLINE works with dynamic ranges, helper formulas like INDIRECT or QUERY, and real-time sources like GOOGLEFINANCE.

Why is my SPARKLINE not displaying?

Check four things. An invalid option value returns #VALUE!: the win/loss chart type is written "winloss", in one word. Data without numbers returns #N/A. A misspelled option name is ignored without an error, so the chart keeps its default look. And a cell that seems empty may hold a line in the background color, a single value, or a row too low to show the chart.

How do I change the color of a SPARKLINE?

Use the "color" option inside the SPARKLINE formula to define custom colors, either by name (e.g., "green") or by hex code.

What types of charts can SPARKLINE create?

Google Sheets SPARKLINE supports line, bar, column, and win/loss charts directly inside cells, based on structured numeric data ranges.

What is the SPARKLINE function in Google Sheets?

SPARKLINE creates mini inline charts inside a single cell to visualize trends, performance, or patterns using formula-based configurations.

Who wrote this

Vadym Kramarenko

Vadym Kramarenko · Growth Marketing Manager

Vadym Kramarenko is a Growth Marketing Manager at OWOX, where he drives user acquisition and product-led growth strategies. He hosts the OWOX podcast, interviewing analytics professionals about data-driven marketing, attribution, and reporting best practices. Vadym specializes in turning complex analytics concepts into practical, actionable marketing frameworks.