How to Create Charts Inside Cells Using the SPARKLINE Feature in Google Sheets

51fc3e80d730ee7bec7342e3f28d5b0f

It’s not always that when working with Google Sheets, the user needs to create a full-scale chart that touches the entire range of data. In this case, the built-in function comes to the rescue SPARKLINEwhich allows you to fit the graph in one cell, having previously selected the appropriate range for it.

If you came to this article for general information about using charts in Google Sheets, I recommend that you read another article, which has a section dedicated to classic charts and working with them.

Areas of application of charts built through SPARKLINE

Let’s briefly dwell on what charts are needed for, which we will then create using a special function in Google Sheets. Let’s say you have a table with various indicators of a specific employee, product, or other information that is distributed by days, months, or other periods. It is necessary to obtain visual statistics for each value from the table as a summary result, which had a graphical display. In this case, just right SPARKLINE.

Selecting a data table when using the SPARKLINE feature in Google Sheets

However, there are many other areas of application, since the function is limited only by the syntax and the skills of the user himself. Using the same setting, you can create a dynamic scale that will show the progress of achieving goals. This topic with all the details is already discussed in my separate instructions on the site.

The community is now in Telegram

Subscribe and stay up to date with the latest IT news

Sign up

A standard use of the SPARKLINE function

First, let’s understand the standard syntax of the function without the various arguments that affect the appearance of the chart. Let’s dwell on the declaration of the function, the selection of the range and the output results, so that you already roughly understand how the formula is written.

  1. Select any empty cell next to a row in the table for which you want to display a chart. Declare the function via =SPARKLINE()and in brackets by selecting with the left mouse button, specify the first range of values.Highlighting a range of data when using the SPARKLINE feature in Google Sheets

  2. For now, we are only analyzing the standard application of the function, so after selecting a range, you can simply close the parenthesis and click on Enter.Application without arguments when using the SPARKLINE function in Google Sheets

  3. By default, a line chart is displayed. You can stretch a column or row to achieve the desired graph size.Display a standard graph when using the SPARKLINE function in Google Sheets

  4. Stretch the function over all other rows by pinching the lower right corner and dragging down.Stretching a standard graph when using the SPARKLINE feature in Google Sheets

You can leave the graph unchanged and not use additional arguments if you are interested in the classic linear version. However, it is often necessary to edit the chart type and add different colors for the columns or blocks, which will be discussed later.

Change the chart type

In the function line itself, you need to specify an argument that will allow you to change the chart type. I will talk about the options a little later.

Changing the chart when using the SPARKLINE feature in Google Sheets

The formula will need to be given in the following form:


=SPARKLINE(B2:F2;{"charttype"\"column"})

In this case, the type is specified as columnthat is, instead of a linear one, there will be a bar chart. If you need a different type of diagram, enter the corresponding name in quotes (I will also talk about the names themselves later).

Remember that you don’t need to manually make changes to each cell that uses the charting function. Just drag the first cell down as shown above.

View the result of changing the chart type when using the SPARKLINE function in Google Sheets

As you can see, in some cases, the bar chart displays the information from the tables in more detail and allows you to get the necessary information faster.

Read also

How to insert a GIF in Google Sheets

How to calculate compound interest in Google Sheets

Change the color of the chart

By default, all the columns and lines of the chart are black, which is not always a suitable output. If you just need to specify the main color for the chart, write in curly brackets after the semicolon “color”\”red”replacing ed to any other color.

Adding a primary color when using the SPARKLINE feature in Google Sheets

Additionally, you can specify both the color for the columns with the highest value and the minimum value, which will make the chart display clearer. I’m leaving the full function string below so you can just copy it and substitute some values ​​for your table.


=SPARKLINE(B2:F2;{"charttype"\"column";"color"\"blue";"highcolor"\"green";"lowcolor"\"red"})

Advanced color settings for columns when using the SPARKLINE feature in Google Sheets

Pay attention to the following screenshot, which shows the result of applying the function SPARKLINE with all arguments for rows from the common table. Now it has the maximum visual display and perfectly fits into the overall design of the document.

Results of setting color for columns when using the SPARKLINE feature in Google Sheets

Getting a list of all possible arguments for SPARKLINE

I already wrote above that I will give instructions that will help you find a list of all available arguments, familiarize yourself with it and make changes to the function SPARKLINE. You can do this right on the tab with the spreadsheet so you don’t have to switch to any help.

  1. To begin, activate the cursor in any part of the function and in the window, click on the inscription “more details”.Displaying the details window when using the SPARKLINE feature in Google Sheets

  2. Help from Google will appear on the screen on the right, where you will see an example of using the function and can understand its syntax.Get information with examples when using the SPARKLINE feature in Google Sheets

  3. Go to this window below to get to the syntax description. You will see what types of charts you can create through SPARKLINE and how to properly announce them.Learn more about the syntax when using the SPARKLINE function in Google Sheets

  4. Below are details on which colors to use and how to specify the correct arguments for all column and row types. This information is quite enough to use comfortably SPARKLINE.Information about available colors when using the SPARKLINE feature in Google Sheets

So, in this article, you learned how to create small graphs and charts using a function within a single cell. Use this information to create full-fledged tables with a visual display of statistics, add dynamic bars or other elements implemented using SPARKLINE.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2022 ZoNa365.ru - Theme by WPEnjoy · Powered by WordPress