Add a sparkline in Sheets
Draw a tiny line, column, win/loss or bar chart inside a cell with the SPARKLINE function in Foxcolab Sheets, and set its colors, scale and gaps.
Updated 3 min read
In short
To add a sparkline in Foxcolab Sheets, type =SPARKLINE(B2:G2) in an empty cell. You get a small line chart of those values inside the cell. Add options in braces, such as {"charttype","column"} for columns, "winloss" for up and down marks, or "bar" with a "max" for a progress bar. Make the cell wider or taller to make the chart bigger.
Key takeaways
- Type =SPARKLINE(range) in a cell. Without options you get a line chart.
- Pick a type with {"charttype","column"}, "winloss" or "bar". Add more option and value pairs separated by semicolons.
- Colors take a name such as green or red, or a hex code such as #188038.
- Use "ymin" and "ymax" so every row's sparkline uses the same scale.
- A bar sparkline needs a "max". Without one, any single value fills the whole bar.
- The chart is drawn on your device from the spreadsheet's data, which stays end-to-end encrypted.
Last reviewed 6 December 2026
To add a sparkline in Foxcolab Sheets, type =SPARKLINE(B2:G2) in an empty cell. A sparkline is a chart the size of a cell: put one at the end of each row and you can see which items are rising, falling or swinging without building a full chart. Like the rest of the spreadsheet, the numbers behind it are end-to-end encrypted, and the chart is drawn on your device.
Add a sparkline#
Say row 2 holds monthly sales for Tea, from January in B2 to June in G2.
Pick a cell
Click an empty cell next to the data, such as H2.
Type the formula
Type =SPARKLINE(B2:G2) and press Enter. A line of the six months appears in the cell.
Give it room
Widen the column or make the row taller. The chart grows with the cell.
Copy it down
Drag the fill handle down the column. Each row gets its own sparkline, because B2:G2 becomes B3:G3, B4:G4 and so on.
To read the function's help in Sheets, choose Insert → Function, search for SPARKLINE and click it. The entry lists every option and has an Insert button.
Choose a chart type#
Add a second argument in braces: an option name, a comma, then its value. Separate several pairs with semicolons.
| Formula | What you get |
|---|---|
=SPARKLINE(B2:G2) | A line, the default |
=SPARKLINE(B2:G2, {"charttype","column"}) | One column per value |
=SPARKLINE(B4:G4, {"charttype","winloss"}) | A mark up for each positive value and down for each negative one, such as monthly profit and loss |
=SPARKLINE(B5, {"charttype","bar";"max",100}) | A progress bar: 62 in B5 fills 62% of the cell |
Win/loss marks are all the same height, so they show direction, not size. Negative marks are red unless you pick another negcolor. A zero draws nothing.
A bar can also show two values side by side, such as done and in progress: =SPARKLINE(B6:C6, {"charttype","bar";"max",D6;"color1","green";"color2","orange"}).
Colors and other options#
| Option | What it does |
|---|---|
color | The main color of the line, columns or marks |
negcolor | Negative values |
highcolor, lowcolor | The highest and lowest values |
firstcolor, lastcolor | The first and last values |
axis, axiscolor | TRUE draws a line at zero when the data has both negative and positive values |
ymin, ymax | Fix the bottom and top of the scale |
linewidth | Line thickness, from 0.5 to 10 |
rtl | TRUE draws the values from right to left |
color1, color2 | The two parts of a bar |
Colors take one of these names: red, green, blue, orange, purple, gray, black, yellow, teal or pink. Or use a hex code such as #188038. Any other name leaves the default color. On a line, the high, low, first and last colors add a dot on that point. On columns, they color that column. This formula highlights June's sales in orange:
=SPARKLINE(B2:G2, {"charttype","column";"color","green";"lastcolor","orange"})You can also keep options in cells: two columns with the option names on the left and the values on the right, then =SPARKLINE(B2:G2, A10:B11).
Compare rows on the same scale#
Each sparkline scales to its own data. A line runs from its lowest value to its highest, so a row that moves from 128 to 135 looks as dramatic as one that doubles. Columns always start at zero.
To compare rows fairly, give every sparkline the same scale:
=SPARKLINE(B2:G2, {"ymin",0;"ymax",200})Blank cells and text#
| In the data | Line | Other types | To skip it instead |
|---|---|---|---|
| A blank cell | A gap in the line | Counts as 0 | Add "empty","ignore" |
| Text, such as n/a | Counts as 0 | Counts as 0 | Add "nan","ignore" |
TRUE and FALSE count as 1 and 0. A sparkline uses up to 1,000 values.
Common problems#
- #VALUE!: the chart type is misspelled (only line, column, bar and winloss work), or the options aren't pairs.
- "There's a problem with this formula": a pair in the braces is missing its value. Every option needs a name and a value.
- No chart: the cell is too small, or the range has no numbers. Widen the column, or merge cells to give the chart more space.
- Wrong separators: in some spreadsheet locales, arguments are separated with semicolons. The function's entry under Insert → Function shows the separator your spreadsheet uses.
A sparkline cell holds no value of its own, so totals and other formulas ignore it. For a full chart with axes, titles and a legend, see Insert a chart in Sheets.
Related#
Frequently asked questions
How do I make a sparkline bigger?
Widen the column or make the row taller. The chart fills the whole cell, and it fills merged cells too. In a very small cell, no chart appears.
Can I put text and a sparkline in the same cell?
No. A SPARKLINE cell holds only the chart. Put the label in the cell next to it.
Why does my line sparkline look so jumpy?
A line sparkline scales from the lowest to the highest value, so small changes fill the whole height. Add "ymin",0 to start the scale at zero.
Do sparklines print?
Yes. File → Print draws sparklines in their cells, the same as on screen.
Did this answer your question?
One click, no account needed.
Still need help?
Our support team can take it from here.