Bird
Raised Fist0
Google Sheetsspreadsheet~15 mins

Sparklines (LINE, BAR, COLUMN) in Google Sheets - Real Business Scenario

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants a quick visual summary of monthly sales trends for each product using sparklines.
📊 Data: You have monthly sales data for 6 products over 6 months in a table.
🎯 Deliverable: Create sparklines (line, bar, and column) next to each product row to show sales trends visually.
Progress0 / 6 steps
Sample Data
ProductJanFebMarAprMayJun
Apples120135150160170180
Bananas80908595100110
Cherries606570758085
Dates404550556065
Elderberries303540455055
Figs202530354045
1
Step 1: Select the cell next to the first product row to insert a line sparkline showing sales trend from Jan to Jun.
=SPARKLINE(B2:G2, {"charttype", "line"})
Expected Result
A small line chart appears showing increasing sales trend for Apples.
2
Step 2: Copy the line sparkline formula down for all product rows to show line sparklines for each product.
Copy formula from step 1 down to rows 3 to 7.
Expected Result
Each product row shows a line sparkline reflecting its monthly sales trend.
3
Step 3: In the next column, insert a bar sparkline for the first product row showing sales from Jan to Jun.
=SPARKLINE(B2:G2, {"charttype", "bar"})
Expected Result
A small horizontal bar chart appears showing sales amounts for Apples.
4
Step 4: Copy the bar sparkline formula down for all product rows.
Copy formula from step 3 down to rows 3 to 7.
Expected Result
Each product row shows a bar sparkline reflecting monthly sales amounts.
5
Step 5: In the next column, insert a column sparkline for the first product row showing sales from Jan to Jun.
=SPARKLINE(B2:G2, {"charttype", "column"})
Expected Result
A small vertical column chart appears showing sales amounts for Apples.
6
Step 6: Copy the column sparkline formula down for all product rows.
Copy formula from step 5 down to rows 3 to 7.
Expected Result
Each product row shows a column sparkline reflecting monthly sales amounts.
Final Result
Product     Jan  Feb  Mar  Apr  May  Jun  Line Sparkline  Bar Sparkline  Column Sparkline
Apples      120  135  150  160  170  180  ───▁▂▃▄▅▆▇█    ▉▊▋▌▍▎▏      ▂▃▄▅▆▇█
Bananas      80   90   85   95  100  110  ▂▃▂▄▅▆▇█      ▅▆▅▇▇▉▉      ▃▄▅▅▆▇▉
Cherries     60   65   70   75   80   85  ▁▂▃▄▅▆▇█      ▂▃▅▆▇▉▉      ▂▃▄▅▆▇█
Dates        40   45   50   55   60   65  ▁▂▃▄▅▆▇█      ▂▃▅▆▇▉▉      ▂▃▄▅▆▇█
Elderberries 30   35   40   45   50   55  ▁▂▃▄▅▆▇█      ▂▃▅▆▇▉▉      ▂▃▄▅▆▇█
Figs         20   25   30   35   40   45  ▁▂▃▄▅▆▇█      ▂▃▅▆▇▉▉      ▂▃▄▅▆▇█
Line sparklines show steady growth in sales for all products over 6 months.
Bar sparklines highlight the relative sales amounts each month for each product.
Column sparklines provide a vertical visual comparison of monthly sales trends.
Bonus Challenge

Add color to the sparklines to highlight months with sales above 150 in line sparklines.

Show Hint
Use the 'color' option in SPARKLINE formula with an IF condition to change color based on sales values.

Practice

(1/5)
1. What does the SPARKLINE function do in Google Sheets?
easy
A. Formats cells with colors
B. Calculates the sum of a range of numbers
C. Sorts data alphabetically
D. Creates a small chart inside a cell to show data trends

Solution

  1. Step 1: Understand the purpose of SPARKLINE

    The SPARKLINE function is designed to create tiny charts inside cells to visually represent data trends.
  2. Step 2: Compare with other options

    Options A, B, and C describe different functions unrelated to SPARKLINE.
  3. Final Answer:

    Creates a small chart inside a cell to show data trends -> Option D
  4. Quick Check:

    SPARKLINE = small chart inside cell [OK]
Hint: SPARKLINE = tiny chart inside a cell [OK]
Common Mistakes:
  • Confusing SPARKLINE with SUM or SORT functions
  • Thinking SPARKLINE changes cell colors
  • Assuming SPARKLINE creates full-size charts
2. Which of the following is the correct syntax to create a line sparkline for data in cells A1 to A5?
easy
A. =SPARKLINE(A1:A5, {"charttype": "line"})
B. =SPARKLINE(A1:A5, {"charttype", "line"})
C. =SPARKLINE(A1:A5, {charttype = "line"})
D. =SPARKLINE(A1:A5, {charttype = line})

Solution

  1. Step 1: Recall correct option syntax for SPARKLINE options

    Options must use key-value pairs with colon and quotes for strings, like {"charttype": "line"}.
  2. Step 2: Check each option

    =SPARKLINE(A1:A5, {"charttype": "line"}) uses correct syntax with colon and quotes. Options A, C, and D use incorrect separators or missing quotes.
  3. Final Answer:

    =SPARKLINE(A1:A5, {"charttype": "line"}) -> Option A
  4. Quick Check:

    Options use colon and quotes for key-value pairs [OK]
Hint: Use colon and quotes for options in SPARKLINE [OK]
Common Mistakes:
  • Using comma instead of colon in options
  • Omitting quotes around option values
  • Using equal sign instead of colon
3. Given the data in cells A1:A4 as 5, 10, 15, 20, what will the formula =SPARKLINE(A1:A4, {"charttype": "bar"}) display?
medium
A. A tiny line chart showing increasing trend
B. A tiny bar chart with bars increasing in height from left to right
C. A tiny column chart with bars decreasing in height
D. An error because bar chart needs more options

Solution

  1. Step 1: Identify chart type and data

    The formula uses charttype "bar" with data 5, 10, 15, 20 which increases.
  2. Step 2: Understand bar chart behavior in SPARKLINE

    Bar chart draws horizontal bars with length proportional to values, so bars increase left to right.
  3. Final Answer:

    A tiny bar chart with bars increasing in height from left to right -> Option B
  4. Quick Check:

    Bar chart = horizontal bars showing values [OK]
Hint: Bar chart shows horizontal bars sized by values [OK]
Common Mistakes:
  • Confusing bar chart with line or column chart
  • Thinking bars decrease instead of increase
  • Assuming error due to missing options
4. The formula =SPARKLINE(A1:A5, {"charttype" "column"}) returns an error. What is the mistake?
medium
A. Column chart type is not supported
B. Wrong range reference
C. Missing colon between option name and value
D. Data range must be horizontal, not vertical

Solution

  1. Step 1: Check option syntax

    The options must have a colon between key and value, like {"charttype": "column"}.
  2. Step 2: Identify error cause

    The formula uses {"charttype" "column"} missing the colon, causing syntax error.
  3. Final Answer:

    Missing colon between option name and value -> Option C
  4. Quick Check:

    Options need colon between key and value [OK]
Hint: Options need colon between key and value [OK]
Common Mistakes:
  • Omitting colon in options
  • Thinking column chart is unsupported
  • Assuming range orientation causes error
5. You want to show a sparkline column chart for sales data in B2:B10 but highlight the highest value bar in red. Which formula correctly applies this?
hard
A. =SPARKLINE(B2:B10, {"charttype": "column", "color": "blue", "maxcolor": "red"})
B. =SPARKLINE(B2:B10, {"charttype": "column", "color": "red", "maxcolor": "red"})
C. =SPARKLINE(B2:B10, {"charttype": "column", "color": "red", "max": MAX(B2:B10)})
D. =SPARKLINE(B2:B10, {"charttype": "bar", "maxcolor": "red"})

Solution

  1. Step 1: Identify correct chart type and color options

    We want a column chart with the highest bar colored red. The option "maxcolor" sets the color for the max value bar.
  2. Step 2: Check each option

    =SPARKLINE(B2:B10, {"charttype": "column", "color": "blue", "maxcolor": "red"}) sets charttype to column, default bars blue, and maxcolor red, which highlights the highest bar correctly. =SPARKLINE(B2:B10, {"charttype": "column", "color": "red", "max": MAX(B2:B10)}) incorrectly uses "max" option which is invalid. =SPARKLINE(B2:B10, {"charttype": "column", "color": "red", "maxcolor": "red"}) sets all bars red, not just max. =SPARKLINE(B2:B10, {"charttype": "bar", "maxcolor": "red"}) uses bar chart instead of column.
  3. Final Answer:

    =SPARKLINE(B2:B10, {"charttype": "column", "color": "blue", "maxcolor": "red"}) -> Option A
  4. Quick Check:

    Use maxcolor to highlight highest bar [OK]
Hint: Use maxcolor option to color highest bar red [OK]
Common Mistakes:
  • Using color option to color all bars red
  • Using invalid max option
  • Choosing wrong chart type (bar instead of column)