SPARKLINE Function: Create Inline Mini Graphs in Google Sheets

スポンサーリンク
スポンサーリンク

About the SPARKLINE Function

Overview of SPARKLINE

Create Simple Graphs Within CellsGoogle Sheets Function

=SPARKLINE( data_range, [options] )

Summary The SPARKLINE function generates simple inline graphs (such as line or column charts) within a cell based on the specified data range. It’s ideal for quickly visualizing trends in data.

  • Display compact graphs within cells.
  • Useful for quick data analysis and identifying trends.
  • Supports various graph types (e.g., line charts, column charts).

When to Use SPARKLINE

  • To compactly display data trends and changes.
  • To provide visual information without using multiple cells.
  • To create dynamic, real-time graphs directly within a cell.

How to Use SPARKLINE

The following example demonstrates the basic usage of the SPARKLINE function.

  A B C D
1 Month Sales Graph
2 January 100 =SPARKLINE(B2:B6)
3 February 200
4 March 150
5 April 300
6 May 250

Results

  • Cells C2 through C6 display a line graph representing the data in range B2:B6.
  • Each graph is displayed within a single cell, requiring no merging.

Advanced SPARKLINE Usage

SPARKLINE can be customized with options to change the graph type or style.

  A B C D
1 Month Sales Graph
2 January 100 =SPARKLINE(B2:B6, {“charttype”, “column”; “color”, “blue”})
3 February 200
4 March 150
5 April 300
6 May 250

Results

  • Cells C2 through C6 display column graphs, each styled with blue coloring.

Points to Note

  • If the data range is empty, the graph will not display.
  • Graph types and options must be specified correctly to avoid errors.
  • SPARKLINE is best suited for simple datasets and may not handle complex data well (consider using dedicated graphing tools for more detailed visualizations).

Conclusion

  • The SPARKLINE function is a powerful tool for creating simple inline graphs within cells.
  • Using its customization options, you can create visually appealing and functional graphs.
  • It improves the readability of spreadsheets by visualizing data trends effectively.