# HOW TO CREATE SPARKLINE [ CHART IN A CELL ] IN GOOGLE SHEETS?

INTRODUCTION

## INTRODUCTION

CHARTS are the graphic representation of any data .

Analysis of data is the process of deriving the inferences by finding out the trends, averages etc. about different parameters.

A SPARKLINE is a special type of very compact chart which is created in a single cell.

These charts are useful in checking the trend with respect to time.
Sparklines are mostly used in a group due to their compactness. Sparklines are just like the charts but very small in size. This is a separate feature from the charts.

Difference between charts and sparklines is that , in a chart, we can create charts using many series but sparkline will create a chart only for one data series.

## WHEN TO USE SPARKLINE CHARTS

WE CAN USE SPARKLINE CHARTS WHEN :

•  We need to show the time trend of any parameter.
• We need to show small sized charts (Not with the details as there is no space for details in the sparklines).
• We have many parameters and need to show the corresponding time trend of the parameter. [How the parameter values is going with the time].
• We want to show the LEVEL of the VALUE in a cell itself.

## STEPS TO CREATE SPARKLINES IN GOOGLE SHEETS

Let us learn to create the sparklines in Google Sheets.

Currently Google Sheets allow the creation of Sparklines using the FUNCTION only and not through any direct access to the graphical interface like the SPARKLINES IN THE EXCEL.

Let us learn the syntax of the SPARKLINE FUNCTION before we use it.

## SYNTAX OF SPARKLINE FUNCTION

The syntax of the SPARKLINE FUNCTION i`s`

=SPARKLINE(DATA, OPTIONS)

• DATA is the range which contains the data for the chart.
• OPTIONS are the different options for customizing our sparkline such as choosing the chart type and other options.
• The options list is given below.
• The options can be put of left blank. If left blank a line chart will be created as the sparkline.

HOW TO CREATE THE SYNTAX FORMULA OF SPARKLINE TO CREATE THE CHART OF YOUR CHOICE?

We already saw the syntax of the sparkline.

Let us now learn the way to create the function in a way so that we can present the data in our own style.

The standard parameters are DATA, OPTIONS.

The DATA argument is very clear.

It is simply the range containing the data. For Example, the data can be in A1:A10 or A1:G1 or any other range.

*EITHER CHOOSE A SINGLE ROW OR A SINGLE COLUMN FOR THE DATA.

The second argument i.e. OPTIONS need to be put in the following format to create perfect sparklines.

{“PROPERTY NAME”,”PROPERTY VALUE”; ” PROPERTY NAME 2 “,” PROPERTY VALUE 2″, AND SO ON }

For example,

Suppose we want to create a sparkline in the COLUMN FORMAT and the color of the columns should be red.

Simply refer to the table above and spot the properties you need.

In this case we need two properties only.

Charttype and Color.

The option becomes something like

{“Charttype”,”column”; “color”,”red”}

It is that simple!!

So, we’ll explore this further in the examples.

## SOLUTION:

Before the steps let us formulate the function to be used.

The given sales data is given below.

FOLLOW THE STEPS TO CREATE A SPARKLINE FOR THE 5 days sales data

• Select the cell where you want to create the sparkline. For our example, we’ll select the cell I4.
• Enter the formula in the format = SPARKLINE( DATA RANGE, OPTION RANGE OR OPTIONS IN THE SHOWN FORMAT ABOVE”)
• For our example, the formula will be =SPARKLINE(D4:H4,{“CHARTTYPE”,”COLUMN”;”COLOR”,”BLUE”})