SpreadsheetFormulas
beginnerSPARKLINE

Show a Trend as a Mini Chart Inside a Cell

You track monthly sales per customer across twelve columns, and you want each row to show its trend at a glance — without building and positioning a chart for every single customer.

Quick formula
=SPARKLINE(B2:M2)
Sample input
1CustomerJanFebMar
2Acme Co120150210
3Borealis300240180
Result
1CustomerTrend
2Acme Co▁▄█ rising
3Borealis█▄▁ falling

Excel & Google Sheets

=SPARKLINE(B2:M2)

This formula works in both Excel and Google Sheets.

How it works

SPARKLINE is a Google Sheets function that draws a miniature line chart inside the cell itself, plotting the row's twelve monthly values left to right — put one in every row and the whole table becomes scannable. A second argument customizes it with option pairs in curly braces: =SPARKLINE(B2:M2,{"charttype","column";"color","green"}) switches to tiny bars in green, and "winloss" or "bar" are also available. Excel offers the same visual but not as a formula — typing =SPARKLINE there returns #NAME?. In Excel you select the cells, go to Insert > Sparklines, and pick Line, Column, or Win/Loss; it's a menu feature attached to the cell, configured from the ribbon instead of by arguments.

B2:M2
The numbers to plot — this row's January-through-December sales, drawn left to right.
{"charttype","column";"color","green"} (optional)
Option pairs: comma between a setting and its value, semicolon between pairs.

When to use it

Use it wherever a number's direction matters more than its exact value: monthly sales per customer, weekly output per project, invoice volume per client — one glanceable trend per row of a summary table.

Common mistakes

  • Typing =SPARKLINE into Excel.

    Excel shows #NAME? — there is no SPARKLINE function there. Use Insert > Sparklines instead: select the data range and a location, and Excel draws the same in-cell chart as a feature, not a formula.

  • Mixing up the separators in the options.

    It's comma between a setting and its value, semicolon between pairs: {"charttype","column";"color","green"}. Swap them and the formula errors.

  • Text hiding in the data range.

    A stray "n/a" among the numbers breaks the chart. Blanks are fine (they show as gaps) — replace text placeholders with empty cells or numbers.

Did this formula help?

Human-reviewedLast reviewed 2026-07-08