Show
Sparkline Google SheetsSparklines are miniature charts that you can create within a cell. Although they do not have the features offered by standard charts in Google Sheets, such as the ability to save as an image, advanced customization, handling larger data sets, etc. They are helpful when you are creating a dashboard and want to quickly show a trend, seasonal increase or decrease, or outliers visually. Using sparklines is an excellent alternative to traditional Google Sheets charts because of how easy they are to create. In this article, I will describe how you can insert sparklines in Google Sheets. Before we begin, you must note that Excel and Google Sheets deal with sparklines differently. While many users in Excel see it as a feature that you can access using the options in the ribbon, Sparklines in Google Sheets are created using the =SPARKLINE formula. There are four types of sparklines in Google Sheets: Line, Column, Bar, and Win-Loss. All of these sparkline options allow all users to create different kinds of miniature charts that present a different visual trend for a dataset. So, let’s look into the different types of Google Sheets sparklines, their syntax, and how you can easily use these sparklines in your Google Sheet. Types of Google Sheets SparklinesAs I mentioned above, Google Sheets has different types of sparklines. The four different types of sparklines Google Sheets offers are:
Each chart type has different changes you can add to the formula, such as colors, size customizations, minimum and maximum values, and alignment, among other options. In their help section, Google provides a comprehensive list of options for sparkline customizations. Google Sheets Sparklines SyntaxNow that we have discussed the different types of sparklines, let’s discuss their syntax. First, let’s start off with the basic sparklines chart. After you’ve chosen the cell where you want the sparkline to appear, you will type =SPARKLINE, then press the Enter or Return key. You may notice a small pop-up below the formula bar with a syntax to customize your sparkline like so, =SPARKLINE(data,{options}). For the data field, you must select the cell range containing the data for which you wish to create a sparkline. You can enter a cell range or simply drag through it to select the range. When you press the Enter or Return key, your newly created sparkline should appear. The options field in the curly brackets is where you can customize your sparklines, such as adjusting the line width or color. The syntax for sparklines other than the line chart is also the same. All you have to do is add “charttype” in the options field. The basic syntax for sparkline is: =SPARKLINE(data, {options})Here are the formulas you would use for the other chart types. Bar chart: =SPARKLINE(data, {“charttype”, “bar”}) Column chart: =SPARKLINE(data, {“charttype”, “column”}) Win/Loss chart: =SPARKLINE(data, {“charttype”, “winloss”}) Using SparklinesLet’s take the following grocery store visitor sheet to create a step-by-step guide with different sparkline examples: Creating a Sparkline Line Chart Step 1. Go to an empty cell and type in the formula =SPARKLINE, and select the cell range with the data. In the screenshot above, I selected the cell range B4:H4 since I wanted a sparkline to display the trend of visitors in week 1. I have also specified the color in the curly brackets. Step 2. Use the same method from Step 1 to create a Sparkline for weeks 2, 3, and 4. Step 3. Merge all four weekly sparklines into one monthly sparkling. I did so with the following formula =SPARKLINE(QUERY(B4:H7, "select B+C+D+E+F+G+H),{"linewidth",3;,"color","orange"})In the above screenshot, I have used a combination of the sparkline and query formula to first bring all the data from the different cell ranges together and then create a sparkline from it. You can use this method to combine multiple sparklines into one. Creating a Sparkline Column ChartUse the same formula as before sparkline but add “charttype” into the options field. In the screenshot above, I used the same method as I used in the sparkline line chart but added “charttype”,”column” in the curly brackets. Also, you must separate two options with a semicolon “;” as I did with chart type and color. Creating a Sparkline Bar ChartFor this method, instead of the cell range, I used the cells with the total visitors for each week. In the above screenshot, I used the formula: =SPARKLINE(I4,{“charttype”,”bar”;”max”,MAX(I4:I7).I also pressed F4 on the cell range I4:I7 to make it constant (marked by the $ sign). I used total visitors for all four weeks to create a sparkline bar chart for each Creating a Sparkline Win-Loss chartFor this method, I used the profit column (Column J) to display a win-loss trend. In the screenshot above, I have again used a similar formula to before, but I have added the necessary parameters to create a win-loss chart, such as the chart type and the color formatting. The Sparkline win-loss chart has displayed a negative value as red and a positive value as green because of the formula I used. Related Reading: Filter By Color in Google Sheets Editing and Formatting Sparkline Google Sheets GraphsOnce you’ve successfully inserted sparklines into your Google Sheet, you can edit and format them. Now, this can get a little tricky because it involves a wide range of customization options, and to put a professional look to your sheet, you must know how to perfectly customize your sheet, e.g., adding a diagonal line to your headers, using the correct formatting options, etc. Luckily for you, there are a lot of resources available online that will help you become an expert in Google Sheets and start creating professional-looking sheets seamlessly. For now, I will mention a few formatting tips you can use to make your sparklines look professional. Let’s break them down by char type: NOTE: All of the formatting options mentioned below must be added in curly brackets for the options field of the sparkline formula. i.e., For a single option: =SPARKLINE(Cell_range,{“formatting option”,”value”}).For multiple options: =SPARKLINE(Cell_range,{“formatting option”,”value”;“formatting option”, value”}).Line Chart
Column Chart
Bar Chart
Win-Loss Chart
Frequently Asked QuestionsHow Do You Add a Sparkline in Google Sheets?You may find that creating a Sparkline may be different In Google Sheets than it is in excel. In order to create a Basic Sparkline in Google Sheets, you must first choose the cell where you want the sparkline to appear. Go to the formula bar and type =SPARKLINE, select the cell range with the data, then press the Enter or Return key. You may also notice a small pop-up below the formula bar with syntax to customize your sparkline. If you wish, you can add various formatting options to your formula to adjust the sparkline chart to your liking. How Does Sparkline Work in Google Sheets?In order to understand how it works, you must first understand what it actually is. A sparkline is a miniature graph that depicts the trend of numerical data. Sparklines may consist of a line, column, or bar chart that is drawn without axes. It must be noted that sparkline is a function available on various platforms, but the way it functions on google sheets is different. The SPARKLINE function in Google Sheets allows users to create sparkline charts within a cell. It uses a formula to create a miniature chart in a single cell. Also, it can only be used for a smaller dataset. For larger ones, you may use the built-in charts offered by Google Sheets. Why Are Sparklines Useful?Users who prefer to show a visual graph of their data instantly find sparklines to be very useful for various reasons. Sparklines are tiny charts that can be placed inside single worksheet cells to visually represent and show a trend in your data. Sparklines can draw attention to important items such as seasonal changes or economic cycles by using a different color to highlight the maximum and minimum values. A sparkline, like a line chart, is excellent for displaying how values change over time. When multiple lines must be plotted, the sparkline can be a useful alternative to the line chart. Can You Overlay Sparklines?Although Google Sheets has not failed at providing users with every feature they may need or find useful when working, the option of overlaying sparklines has still not been added, to both google sheets and excel. However, excel users can find an alternative way of doing so, which is by using Excel’s Camera tool. It is as simple as right-clicking the Quick Access Toolbar and selecting Customize Quick Access Toolbar to add Excel’s Camera tool. Selecting All commands from the Choose commands from box in the resulting Excel Options box, scrolling down and selecting the Camera tool, clicking the Add button, and clicking OK. Now, you can create a column/line chart that you wish to overlay. What Is the Default Choice for Sparklines in Google Sheets?As I mentioned above, there are four types of sparkline charts, and all of them represent data in different ways. However, the default type of sparkline on google sheets is a line chart. As a result, the “charttype” option in the SPARKLINE formula syntax is unnecessary for you to add when creating a line chart sparkline. You can simply specify the data range, which is up to two columns or rows, and press enter. Whilst a line chart is easy to use, you do, however, have a few customization options for your line graph, unlike the rest of the miniature charts, which offer a wide variety of customization options. How Many Colors Can a Google Sheets Sparkline Have?Not all charts have the same customization options. Various colors can be used for a sparkline line chart, whereas for the bar chart sparkline, you can add only two colors. A column sparkline, along with the win-loss chart type, can both have up to six column colors and one axis color, and they have Color customization for the bottom column. The highest column’s color can also be customized in a column chart. Both of the chart types include color customization for the first column, along with color customization for the last column. Can You Make a Bar Sparkline Vertical in Google Sheets?A bar chart sparkline is a graph that displays horizontal bars with the axis values displayed at the bottom. It’s a graphical object that’s used to represent data in an Excel or Google Sheets spreadsheet. In Google Sheets, a vertically arranged bar chart is known as a stacked column chart. You can insert it with the Chart Editor, but not with the SPARKLINE function. Wrapping UpTo sum up, the sparklines feature is excellent when you want an instant graphical depiction of your data in a Line, Column, Bar, or Win-Loss chart. You may only use it on a smaller dataset, and you have various customization options to choose from for each chart type. It is definitely a feature you should learn if you work with data and often need to show a visual representation of a dataset. I hope this sparkline Google Sheets guide sufficiently explains the feature to you, and now all you have left to do is try it out for yourself! If you’d like to learn more about Sheets, you could always try out a course. |