SB
Sheets Bootcamp
Beginner 7 min read

SPARKLINE in Google Sheets: Mini Charts in Cells

Learn how to use SPARKLINE in Google Sheets to create mini line, bar, column, and winloss charts inside cells. Syntax, options, and examples.

SB

Sheets Bootcamp

April 9, 2026

SPARKLINE in Google Sheets creates a miniature chart inside a single cell. Unlike standard charts that float over the sheet, SPARKLINE is a formula. You type it into a cell, point it at a data range, and it draws a tiny line, bar, column, or winloss chart right where the formula lives. This guide covers the syntax, all four chart types, and the options that control colors and scale.

In This Guide

SPARKLINE Syntax

SPARKLINE takes two arguments: the data and an optional set of options.

Formula
=SPARKLINE(data, [options])
ArgumentDescriptionRequired
dataThe range of values to chart. Can be a single row or column of numbers.Yes
optionsA set of key-value pairs that control chart type, colors, and scale. Written as a curly-brace array.No

Without options, SPARKLINE draws a default line chart. To set options, pass them as a two-column array inside curly braces. Separate key-value pairs with commas, and separate pairs from each other with semicolons.

Formula
=SPARKLINE(B2:G2, {"charttype","column";"color","#4285f4"})
⚠ Important

Option keys and string values must be wrapped in double quotes inside the curly braces. Semicolons separate each key-value pair. Commas separate the key from its value. Mixing these up breaks the formula.

How to Create a SPARKLINE: Step-by-Step

We’ll use a monthly summary table with six months of revenue data across columns B through G. Each row represents a product category, and the SPARKLINE goes in column H.

Sample Data

The table has Category in column A, six months of revenue in columns B through G (Jan to Jun), and an empty Trend column in H where sparklines will go.

Monthly summary table with Category, six months of revenue, and an empty Trend column

1

Set up your data

Arrange your data so numeric values run across a row or down a column. In this example, months are in columns B through G and each row holds one category’s revenue. Column H is where the sparkline will appear.

2

Enter the basic SPARKLINE formula

Select cell H2 and enter:

Formula
=SPARKLINE(B2:G2)

A tiny line chart appears in cell H2. It plots the six values from January through June, showing the trend for that row. The cell displays the chart instead of a number.

SPARKLINE line chart in cell H2 with the formula bar showing =SPARKLINE(B2:G2)

✦ Tip

Copy the formula down column H to add sparklines for every row. The cell references adjust automatically, so each row gets its own mini chart.

3

Choose a chart type

To switch from a line to a different chart type, add an options argument. For example, to create a horizontal bar chart:

Formula
=SPARKLINE(B2:D2, {"charttype","bar";"max",50000})

SPARKLINE bar chart in a cell with the formula bar showing the bar charttype option

The four chart types are line, bar, column, and winloss. We’ll cover each one in the next section.

4

Customize with options

Add more key-value pairs separated by semicolons to control color, line width, and axis bounds:

Formula
=SPARKLINE(B2:G2, {"charttype","line";"color","#4285f4";"linewidth",2})

This draws a blue line chart with a 2-pixel line. You can combine as many options as the chart type supports.

SPARKLINE Chart Types

Line (Default)

The line type connects data points with a continuous line. It is the default when you omit the options argument.

Formula
=SPARKLINE(B2:G2)

Use line sparklines to show trends across time, like monthly revenue or weekly signups. The slope of the line tells you whether values are rising, falling, or flat.

Bar

The bar type draws a horizontal stacked bar. Each value in the range becomes a colored segment of the bar.

Formula
=SPARKLINE(B2:D2, {"charttype","bar";"max",25000})

Bar sparklines work well for showing composition, like how three categories contribute to a total. Set the max option so bars across different rows share the same scale.

Column

The column type draws vertical bars for each data point. Think of it as a tiny column chart inside the cell.

Formula
=SPARKLINE(B2:G2, {"charttype","column";"color","#34a853"})

Column sparklines are useful when you want to compare individual values rather than see a continuous trend. Each bar stands on its own, making highs and lows easy to spot.

Winloss

The winloss type shows positive values as blocks above the midline, negative values as blocks below it, and zeros as gaps.

Formula
=SPARKLINE(B2:G2, {"charttype","winloss";"negcolor","red";"color","green"})

Winloss sparklines work for data that represents gains and losses, like profit/loss by month or game results. The chart does not show magnitude, only direction.

Multiple sparkline types in a dashboard layout showing line, bar, column, and winloss charts

Customize Colors and Options

Each chart type supports a different set of options. Here are the most useful ones.

Line Options

OptionDescriptionExample Value
colorLine color"#4285f4" or "blue"
linewidthLine thickness in pixels2
highcolorColor of the highest point marker"green"
lowcolorColor of the lowest point marker"red"
firstcolorColor of the first point marker"orange"
lastcolorColor of the last point marker"purple"
emptyHow to handle empty cells: "zero" or "ignore""zero"

To highlight the high and low points on a line sparkline:

Formula
=SPARKLINE(B2:G2, {"color","#4285f4";"highcolor","green";"lowcolor","red";"linewidth",2})

Bar Options

OptionDescriptionExample Value
maxMaximum value for scaling the bar50000
color1Color of the first segment"#4285f4"
color2Color of the second segment"#ea4335"
emptyHow to handle empty cells"zero"

Column Options

OptionDescriptionExample Value
colorColor of positive value columns"#34a853"
negcolorColor of negative value columns"red"
axisShow or hide the axis linetrue
axiscolorColor of the axis line"gray"
yminMinimum value for the vertical scale0
ymaxMaximum value for the vertical scale5000
emptyHow to handle empty cells"zero"

Winloss Options

OptionDescriptionExample Value
colorColor of positive blocks"green"
negcolorColor of negative blocks"red"
axisShow or hide the axis linetrue
axiscolorColor of the axis line"gray"
emptyHow to handle empty cells"zero"
β„Ή Note

Color values can be color names like "blue" or hex codes like "#4285f4". Hex codes give you more control over the exact shade. Wrap all string values in double quotes inside the options array.

Tips and Best Practices

  1. Set consistent scales across rows. If you have sparklines for multiple rows, use ymin and ymax (column type) or max (bar type) so the charts share the same scale. Without this, a row with small values looks the same as a row with large values.

  2. Use line sparklines for trend, column for comparison. A line chart emphasizes direction over time. A column chart emphasizes individual data points. Pick the type that matches what the reader needs to see.

  3. Keep the data range short. Sparklines are tiny. More than 12-15 data points compresses the chart to the point where individual values are hard to distinguish. For long time series, consider a full line chart instead.

  4. Pair sparklines with conditional formatting. Add color scales or icon sets to the numeric columns alongside the sparkline. The sparkline shows the shape; the conditional formatting highlights specific values.

  5. Handle empty cells explicitly. By default, SPARKLINE treats empty cells as gaps. Add "empty","zero" to the options if you want missing data plotted as zero instead of breaking the line.

Frequently Asked Questions

What is SPARKLINE in Google Sheets?

SPARKLINE is a function that creates a miniature chart inside a single cell. It draws a tiny line, bar, column, or winloss chart from a range of values, showing trends without taking up space on the sheet.

What chart types does SPARKLINE support?

SPARKLINE supports four chart types: line (default), bar (horizontal stacked bar), column (vertical bars), and winloss (shows positive, negative, and zero values as up, down, or empty blocks).

Can I change the color of a SPARKLINE?

Yes. Add options to the formula using the format =SPARKLINE(data, {"color","blue"}). You can set color for the line, lowcolor and highcolor for min/max points, and negcolor for negative values in winloss charts.

How do I make a SPARKLINE bar chart?

Use =SPARKLINE(B2:B4, {"charttype","bar";"max",50000}). Set charttype to bar and define a max value so the bars have a consistent scale. Each value appears as a segment of a horizontal stacked bar.

Does SPARKLINE update automatically when data changes?

Yes. SPARKLINE references a data range, so when values in that range change, the mini chart updates immediately. This makes sparklines useful for dashboards where data refreshes regularly.

Frequently Asked Questions

Next Steps

Continue learning with these related tutorials: