
The SPARKLINE function in Google Sheets draws a tiny chart inside one cell. =SPARKLINE(B2:G2) turns six numbers in a row into a small line chart, which is handy for showing a trend next to each row of a table. This guide shows the line, column, bar and win/loss types, how to set the color and line width, how to draw a progress bar, and what to do when the chart does not appear. The sample data is made up.
SPARKLINE syntax
=SPARKLINE(data, [options])
- data is the range of numbers to draw. It can be a row or a column.
- options is optional. It is written in curly braces as pairs of a name and a value, and the pairs are separated by semicolons.
A basic line chart
With monthly sales for January to June in B2:G2:
=SPARKLINE(B2:G2)
Fill the formula down and each row gets its own tiny chart. The cell can be made taller or wider to give the chart more room.

Change the chart type
Use the charttype option. The types are line, bar, column and winloss:
=SPARKLINE(B2:G2, {"charttype","column"})
Column shows one bar per value. Winloss shows a bar up for positive values and down for negative ones, which suits profit and loss.

Color and line width
For a line chart, add color and linewidth:
=SPARKLINE(B2:G2, {"charttype","line"; "color","#1a73e8"; "linewidth",2})
The color can be a name such as "red" or a hex code. Options are separated by semicolons inside the braces.
A progress bar in one cell
A bar sparkline can show progress toward a target. With the current value in B2 and a target of 100:
=SPARKLINE(B2, {"charttype","bar"; "max",100; "color1","green"})
The "max" option sets the full length of the bar. A value of 60 then fills 60 percent of the cell. This is a light alternative to a chart, and works well with a checklist, as in our checkbox guide.

Use a cell for the target
To avoid editing the formula, point "max" at a cell: =SPARKLINE(B2, {"charttype","bar"; "max",$E$1; "color1","green"}). Change E1 and every bar adjusts.
Sparklines for each row with ARRAYFORMULA
SPARKLINE does not spill on its own, so fill it down or build the range for each row. Keep the layout simple: one row of numbers, one sparkline in the next column.
Sparklines with conditional formatting
A sparkline shows the shape of a trend, but not the exact numbers. Add a plain number column and color it with conditional formatting so readers see both.
Sparkline from another sheet
The data can come from another sheet, such as =SPARKLINE(Data!B2:G2). If the data is in another file, bring it in first with IMPORTRANGE.
If the sparkline does not show
- Empty cell. The data range may be blank or hold text. Use numbers.
- Error message. Check the braces and semicolons in the options. A comma in the wrong place causes a parse error.
- Too small. Make the row taller and the column wider.
- Wrong option name. Option names are in quotes and are case sensitive in some cases, so copy them exactly.

Does Excel have sparklines?
Yes, but not as a function. In Excel go to Insert, then Sparklines, and choose Line, Column or Win/Loss. They are a feature of the ribbon, so there is no formula to copy.
Questions and answers
Can I click a sparkline?
It is drawn inside the cell, so clicking selects the cell. The values stay in the source cells.
Can a sparkline show dates on the axis?
No. A sparkline has no labels. It is only a small shape.
How many sparklines can I use?
Many. Very large sheets with thousands of sparklines can be slower, so test yours.
Can I copy a sparkline to Excel?
No. The formula is specific to Google Sheets. Make a new one with Insert, then Sparklines in Excel.
