SPARKLINE draws a tiny chart inside a single cell, so a row of twelve monthly totals becomes a trend line you can read at a glance. For a spending category the shortest version is =SPARKLINE(B2:M2), which plots the range B2:M2 as a line.
The default is rarely good enough. Left alone, every row scales itself to its own highs and lows, so a quiet category looks as dramatic as a big one. The options below fix that.
How do I lay out the monthly totals?
Put categories down column A and twelve month starts across B1:M1, April to March for an Indian financial year (type 01-Apr-2026 in B1 and enter =EDATE(B1,1) in C1, then fill right). Your raw entries sit on a sheet named Data with date in A, category in B and amount in C. In B2 enter:
- =SUMIFS(Data!$C$2:$C$1000,Data!$B$2:$B$1000,$A2,Data!$A$2:$A$1000,">="&B$1,Data!$A$2:$A$1000,"<"&EDATE(B$1,1))
Fill it right and down. Each cell now holds one category's total for one month.
What is the basic SPARKLINE formula?
In N2, next to the twelve months, enter:
- =SPARKLINE(B2:M2) for the default line.
- =SPARKLINE(B2:M2,{"charttype","line";"color","#d93025";"linewidth",2}) for a red, thicker line.
The second argument is a small two-column array of option names and values. Rows are separated by semicolons and columns by commas. In a spreadsheet set to a locale that uses other separators, Sheets may ask for different punctuation, so look at what it suggests as you type.
Hypothetical example: say the Food row reads 8,200, 7,900, 9,100, 8,400, 8,800, 9,600 for April to September. The line wobbles gently and ends highest in September. A Subscriptions row of 450 every month would draw a flat line at the same height from start to finish, which is exactly what it should show: nothing is changing.
How do I make every row use the same scale?
Fix the vertical axis. Setting "ymin" to 0 stops quiet categories from stretching, and a shared "ymax" makes rows comparable:
- =SPARKLINE(B2:M2,{"charttype","line";"ymin",0;"ymax",MAX($B$2:$M$12)})
Now a category that spends little shows a low, flat line while a heavy one climbs. If you prefer each category judged against its own history, omit ymax and keep ymin at 0, which still avoids exaggerated drops.
Can I highlight the highest month?
Not on a line sparkline. The colour options for first, last, high and low points belong to the column chart type. Switch the type and you can colour the peak:
- =SPARKLINE(B2:M2,{"charttype","column";"color","#9aa0a6";"highcolor","#d93025";"lowcolor","#188038"})
Grey columns with one red peak and one green low make a festival month such as Diwali jump out. Columns also handle gaps better than a line, which joins the dots across empty months.
| Option | Applies to | What it does |
|---|---|---|
| color | All types | Main colour of the line or bars |
| linewidth | Line | Thickness of the line |
| ymin, ymax | Line and column | Fixes the vertical axis |
| highcolor, lowcolor | Column | Colours the tallest and shortest bar |
Sparklines take the size of their cell, so widen column N to roughly 150 pixels and raise the row height a little, or the line looks squashed. Freeze the first column through View, Freeze, so the category names stay visible while you scroll across the months.
What about months with no spending?
An empty cell and a zero are not the same to a line chart. SUMIFS returns 0 for a month with no entries, which draws as a dip to the floor. That is usually right for a category like Travel, where a quiet month really is zero. If a month simply has not happened yet, though, a zero in March looks like a collapse when you are only in November. Wrap the formula so future months stay empty, for example =IF(B$1>TODAY(),"",SUMIFS(...)), and add "nan","ignore" to the sparkline options so those blanks are skipped rather than drawn as zero. Check how your own line draws before relying on it.
Where this fits
Sparklines are a nice final layer on a category sheet you already maintain. If you would rather not maintain the sheet itself, SpendixAI has reports and a dashboard with insights built from your imported statements, so you can keep the spreadsheet for the cases it suits.
Useful ideas start with a clearer picture of your own spending.
Explore your reports

