{"id":2550,"date":"2020-12-18T18:24:29","date_gmt":"2020-12-18T17:24:29","guid":{"rendered":"https:\/\/importsheet.com\/?p=2550"},"modified":"2026-11-03T14:28:55","modified_gmt":"2026-11-03T13:28:55","slug":"formula-de-sparkline-no-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/google-sheets-formulas\/sparkline-formula-google-sheets\/","title":{"rendered":"Como usar a f\u00f3rmula SPARKLINE no Google Sheets (com exemplos)"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The SPARKLINE function in Google Sheets draws a small line, bar, column, or win\/loss chart inside a single cell.<\/p>\n<p>Syntax: =SPARKLINE(data, &#91;options&#93;)<\/p>\n<table>\n<thead>\n<tr>\n<th>Option<\/th>\n<th>What it sets<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>charttype<\/td>\n<td>&quot;line&quot; (the default), &quot;bar&quot;, &quot;column&quot;, or &quot;winloss&quot;<\/td>\n<\/tr>\n<tr>\n<td>color<\/td>\n<td>Line or column color, as a name or a hex code. Bar charts use color1 and color2.<\/td>\n<\/tr>\n<tr>\n<td>max<\/td>\n<td>The value that fills the whole cell in a bar chart<\/td>\n<\/tr>\n<tr>\n<td>ymin, ymax<\/td>\n<td>The bottom and top of the scale in line and column charts<\/td>\n<\/tr>\n<tr>\n<td>empty<\/td>\n<td>How to treat empty cells: &quot;zero&quot; or &quot;ignore&quot;<\/td>\n<\/tr>\n<tr>\n<td>nan<\/td>\n<td>How to treat cells that aren&#8217;t numbers: &quot;convert&quot; or &quot;ignore&quot;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Example: =SPARKLINE(C2:F2,{&quot;charttype&quot;,&quot;column&quot;;&quot;color&quot;,&quot;green&quot;}) draws a green column for each value in C2:F2.<\/p>\n<p>If you want a quick way to analyze your spreadsheet data visually without building full charts, the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093289?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">SPARKLINE<\/a> function in Google Sheets is a great solution. It allows you to create mini charts inside individual cells, so you can quickly visualize trends.<\/p>\n<p>Take a look at the example below. Imagine I\u2019m a teacher and I want to analyze my students\u2019 test scores:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-1-1.png&#8221; alt=&#8221;Sparkline Google Sheets \u2014 student names with four test scores and no chart&#8221; title_text=&#8221;Student names with four test scores and no chart&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>As you can see, the results don&#8217;t exactly jump out at you from a sea of numbers. And when the data extends\u00a0further across the spreadsheet, it becomes increasingly difficult to see how your students are doing over time. If I have 100 students who have all taken 15 tests, there&#8217;s no way I can analyze the trends with my bare eyes.<\/p>\n<p>It isn\u2019t feasible, time-wise, to build a chart for every single student, but that&#8217;s where SPARKLINE function in Google Sheets comes to the rescue. The function allows you to create a mini sparkline chart in a single cell. There are four main types:<\/p>\n<ul>\n<li>Line sparkline \u2014 this is the default sparkline in Google Sheets<\/li>\n<li>Column sparkline\u00a0 \u2014 like a mini column chart in one cell<\/li>\n<li>Bar sparkline\u00a0\u2014 a mini bar chart in one cell<\/li>\n<li>Winloss sparkline\u00a0\u2014 a mini column chart for yes\/no or positive\/negative results<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Connections B &#8211; Importrange alternative &#8211; Horizontal&#8221; module_class=&#8221;sheetgo-post-no-shadow-img md2-contained-button vertical-banner-container&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#f2f7ff&#8221; max_width=&#8221;700px&#8221; module_alignment=&#8221;center&#8221; max_height=&#8221;300px&#8221; custom_margin=&#8221;20px|0px|20px|0px|true|true&#8221; custom_padding=&#8221;25px|25px|25px|25px|true|true&#8221; sticky_limit_bottom=&#8221;section&#8221; border_radii=&#8221;on|20px|20px|20px|20px&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d9e7ff&#8221; global_module=&#8221;50475&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/Add-on-sm_sheets-connected-new-connection.webp\" width=\"250\" height=\"168\" alt=\"\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/Recommended-for-Google-Workspace-badge.webp\" width=\"150\" height=\"180\" alt=\"39\" \/><\/p>\n<p><span style=\"font-size: 22px; font-weight: 600;\">An importrange alternative, more efficient and easier to manage<\/span><\/p>\n<p><a href=\"https:\/\/automations.sheetgo.com\/login\" target=\"_blank\" rel=\"noopener\" style=\"display:inline-block;background:#2979FF;color:#ffffff;font-weight:600;font-size:16px;padding:15px 24px;border-radius:6px;text-decoration:none;\">Start free trial<\/a><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>Syntax<\/h2>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=SPARKLINE(data, [options])[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<ul>\n<li><strong>data<\/strong>\u00a0\u2013 this is the reference to the range of cells that you want to plot as a sparkline<\/li>\n<li><strong>options<\/strong>\u00a0\u2013 these are used to customize the chart. Google has a full list\u00a0<a href=\"https:\/\/support.google.com\/docs\/answer\/3093289?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. These can be applied in two ways:\n<ul>\n<li>As an array of option key and option value pairs, following the data parameter.<\/li>\n<li>As an address reference to a two column range, where the first column cells hold the option keys, and the second column cells hold the corresponding option values.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>How to insert a sparkline in Google Sheets<\/h2>\n<ol>\n<li>Click the cell where the chart should go, usually next to the row of data.<\/li>\n<li>Type =SPARKLINE( and select the data range, for example C2:F2.<\/li>\n<li>To change the chart, type a comma and add options in curly brackets, such as {&quot;charttype&quot;,&quot;column&quot;}. A comma separates an option from its value, and a semicolon separates one option from the next.<\/li>\n<li>Close the parenthesis and press Enter. To add a sparkline to every row, drag the fill handle down.<\/li>\n<\/ol>\n<p>The chart resizes with its cell, so widen the column or make the row taller if you want a bigger sparkline.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>How to use SPARKLINE function<\/h2>\n<h3>SPARKLINE(data_range)<\/h3>\n<p>To accommodate the sparklines, I will insert a blank column after the Name column and give it a header name \u2018Trend\u2019. Now, in cell B2, I\u2019ll type in the function <strong>=SPARKLINE(C2:F2)<\/strong>:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-2-1.png&#8221; alt=&#8221;SPARKLINE formula \u2014 =Sparkline(C2:F2) typed in cell B2 with the function help box open&#8221; title_text=&#8221;=Sparkline(C2:F2) typed in cell B2 with the function help box open&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Hit the <strong>Enter<\/strong> key, and the Sparkline appears in cell B2. As a result, the miniature version of a chart is nicely embedded within the area of the cell.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-3-1.png&#8221; alt=&#8221;Sparkline Google Sheets \u2014 line sparkline in the Trend column for the first student&#8221; title_text=&#8221;Line sparkline in the Trend column for the first student&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>To create a sparkline for every student, drag the formula all the way down (or copy and paste it):<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-4-1.png&#8221; alt=&#8221;Sparkline Google Sheets \u2014 line sparklines filled down the Trend column for every student&#8221; title_text=&#8221;Line sparklines filled down the Trend column for every student&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>These sparklines make it much easier to read large datasets quickly. In this example, I can spot upward or downward trends for my students much more quickly than analyzing each student\u2019s scores individually.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>SPARKLINE(data_range, color_option as key value pair)<\/h3>\n<p>Next I\u2019ll show you how to change the color of the lines in the sparkline. Notice that both the key (\u201ccolor\u201d) and value (\u201cred\u201d) are within double quotes, and that they are within curly braces\/brackets that indicate an array of key value pairs:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-5-1.png&#8221; alt=&#8221;SPARKLINE color option \u2014 red line sparklines in the Trend column&#8221; title_text=&#8221;Red line sparklines in the Trend column&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The formula here is <strong>=Sparkline(C2:F2,{&#8220;color&#8221;,&#8221;red&#8221;})<\/strong>.<\/p>\n<h3>SPARKLINE(data_range, [color_option and line_thickness as key value pairs])<\/h3>\n<p>If the lines are too thin, you can simply increase the width. To do that you need to include an additional option key-value pair, as shown below. Notice that the two key-value pairs are separated by a semi-colon.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-6-1.png&#8221; alt=&#8221;SPARKLINE linewidth option \u2014 thicker red line sparklines in the Trend column&#8221; title_text=&#8221;Thicker red line sparklines in the Trend column&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The formula here is <strong>=Sparkline(C2:F2,{&#8220;color&#8221;,&#8221;red&#8221;;&#8221;linewidth&#8221;,3})<\/strong>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>SPARKLINE(data_range, [column chart_type, other color_options as key value pairs])<\/h3>\n<p>What if you don\u2019t want line graphs at all? You can change the sparkline to other types of chart. Here I\u2019ll try a column chart and different colors. As you can see, it\u2019s probably not the most attractive or readable sparkline, but it gives you an idea of what you can do.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-7-1.png&#8221; alt=&#8221;Column sparkline in Google Sheets \u2014 grey columns with low values in red and high values in green&#8221; title_text=&#8221;Grey columns with low values in red and high values in green&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>You can also use Hex codes to indicate the colors, like this:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-8-1.png&#8221; alt=&#8221;Column sparkline in Google Sheets \u2014 columns colored with a hex code, low values in red and high values in green&#8221; title_text=&#8221;Columns colored with a hex code, low values in red and high values in green&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text admin_label=&#8221;Connections T &#8211; One tool &#8211; Horizontal&#8221; module_class=&#8221;sheetgo-post-no-shadow-img md2-contained-button vertical-banner-container&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#f2f7ff&#8221; max_width=&#8221;700px&#8221; module_alignment=&#8221;center&#8221; max_height=&#8221;300px&#8221; custom_margin=&#8221;20px|0px|20px|0px|true|true&#8221; custom_padding=&#8221;25px|25px|25px|25px|true|true&#8221; sticky_limit_bottom=&#8221;section&#8221; border_radii=&#8221;on|20px|20px|20px|20px&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d9e7ff&#8221; global_colors_info=&#8221;{}&#8221; global_module=&#8221;50458&#8243; theme_builder_area=&#8221;post_content&#8221;]<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/connections-top-processors-main.webp\" width=\"250\" height=\"168\" alt=\"\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/Recommended-for-Google-Workspace-badge.webp\" width=\"150\" height=\"180\" alt=\"39\" \/><\/p>\n<p><span style=\"font-size: 22px; font-weight: 600;\">One tool to merge, split, and filter all your spreadsheet data<\/span><\/p>\n<p><a href=\"https:\/\/www.sheetgo.com\/automations\/\" target=\"_blank\" rel=\"noopener\">Find out how<\/a>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Win\/Loss SPARKLINE<\/h3>\n<p>At this point you\u2019ve seen examples of both the line and column types of sparklines. What about the win\/loss chart type? This is useful for binary data \u2013 items that are either \u2018yes\u2019 or \u2018no\u2019, 1 or 0, heads or tails, etc.<\/p>\n<p>In the example below, I\u2019ve changed the data to a binary value of 1 (if the student passed the test) or 0 (if they failed). By using the win\/loss format, you can quickly analyze this type of data.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-9-1.png&#8221; alt=&#8221;Win\/loss sparkline in Google Sheets \u2014 black marks for the tests each student passed&#8221; title_text=&#8221;Black marks for the tests each student passed&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Barchart for quick data visualization<\/h3>\n<p>In this example, I\u2019ll show how to use the bar chart sparkline type to quickly visualize data in a simple way. This is a basic example, but a great way to put simple one-dimensional data into an easy-to-view format.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-10-1-1.png&#8221; alt=&#8221;Bar sparkline in Google Sheets \u2014 orange bars for each Test 1 score in the Visual column&#8221; title_text=&#8221;Orange bars for each Test 1 score in the Visual column&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>This is done by typing <strong>=Sparkline(B2,{&#8220;charttype&#8221;,&#8221;bar&#8221;;&#8221;max&#8221;,100})<\/strong>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Chart options referenced in other cells<\/h3>\n<p>In this example, instead of hardcoding the chart options into the formula, I\u2019ll put the options into a table that will be referenced in the function. This allows for easy changing of the options. It\u2019s especially useful if you want to play around with different options to see what looks best.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/SPARKLINE-11-1.png&#8221; alt=&#8221;SPARKLINE options in other cells \u2014 chart type and colors read from an Option and Value table&#8221; title_text=&#8221;Chart type and colors read from an Option and Value table&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text module_id=&#8221;sparkline-examples-by-chart-type&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>SPARKLINE examples by chart type<\/h2>\n<p>Each chart type below comes with a formula you can copy. Change the range and the options to fit your data.<\/p>\n<h3>Line sparkline<\/h3>\n<p>Line charts are most useful for displaying data that changes over consistent time intervals. For example, =SPARKLINE(A2:D2,{&quot;charttype&quot;,&quot;line&quot;;&quot;color&quot;,&quot;indigo&quot;;&quot;linewidth&quot;,2}) draws a thicker indigo line across the four values in A2:D2. If you leave out charttype, you still get a line, because line is the default.<\/p>\n<h3>Bar sparkline<\/h3>\n<p>A bar sparkline draws a horizontal bar from a single value. It works well when you compare every cell in a column: put =SPARKLINE(A13,{&quot;charttype&quot;,&quot;bar&quot;;&quot;max&quot;,100}) next to the first value and fill it down. Set the max option, or each bar fills the whole cell.<\/p>\n<h3>Column sparkline<\/h3>\n<p>If you\u2019re interested in comparing a series of values against each other, use the SPARKLINE function to draw a column chart, like the one below. Column sparklines can show negative values in a color of their own.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/11\/sparkline-google-sheets-column-negative-values.webp&#8221; alt=&#8221;Sparkline Google Sheets \u2014 column sparkline with teal columns for positive values and purple for negative ones&#8221; title_text=&#8221;Column sparkline with teal columns for positive values and purple for negative ones&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The formula in the screenshot is =SPARKLINE(A$20:D$20,{&quot;charttype&quot;,&quot;column&quot;;&quot;color&quot;,&quot;teal&quot;;&quot;negcolor&quot;,&quot;purple&quot;}). Positive values show as teal columns and negative values as purple ones.<\/p>\n<h3>Vertical bar sparkline<\/h3>\n<p>SPARKLINE has no vertical bar chart type. The bar type always draws horizontal bars, so for vertical bars, use the column type shown above. Each value in the range becomes one vertical bar.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Win\/loss sparkline<\/h3>\n<p>The win-loss chart type allows you to display binary data, such as wins and losses. You can also use colors to highlight specific data in more ways.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/11\/sparkline-google-sheets-win-loss-axis.webp&#8221; alt=&#8221;Sparkline Google Sheets \u2014 win\/loss sparkline with a teal win, grey losses, and a black axis&#8221; title_text=&#8221;Win\/loss sparkline with a teal win, grey losses, and a black axis&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Here the formula is =SPARKLINE(A$25:D$25,{&quot;charttype&quot;,&quot;winloss&quot;;&quot;color&quot;,&quot;teal&quot;;&quot;negcolor&quot;,&quot;grey&quot;;&quot;axis&quot;,true;&quot;axiscolor&quot;,&quot;black&quot;}). Every value above zero gets a teal bar above the axis, and every value below zero gets a grey bar below it. The axis option draws the black line between them.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>That&#8217;s it, that&#8217;s how you use the SPARKLINE function in Google Sheets. It has a ton of <a href=\"https:\/\/support.google.com\/docs\/answer\/3093289?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">customization options\u00a0<\/a>and it&#8217;s a really handy visualization tool to make your spreadsheets more user-friendly and make the data easier to read.<\/p>\n<p>Want to know how to insert charts in Google Sheets or make larger charts with your data however? Read our blog posts on <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-features\/insert-a-chart-in-google-sheets\/\" target=\"_blank\" rel=\"noopener\">how do I insert a chart in Google Sheets <\/a>and <a href=\"https:\/\/www.sheetgo.com\/blog\/spreadsheets-tips\/how-to-create-a-dashboard-in-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to create a dashboard in Google Sheets.<\/a><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>For a full-size chart instead of a sparkline, see how to <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-features\/how-to-create-a-bar-chart-in-google-sheets\/\">create a bar chart in Google Sheets<\/a> or how to <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-features\/create-a-trendline-in-google-sheets\/\">create a trendline in Google Sheets<\/a>.<\/p>\n<p>If the numbers behind your sparklines come from several spreadsheets, <a href=\"https:\/\/www.sheetgo.com\/automations\/\">Sheetgo<\/a>, an AI-powered data automation platform, can bring them into one sheet on a schedule, so your charts stay current without copy and paste. See how to <a href=\"https:\/\/www.sheetgo.com\/blog\/how-to-solve-with-sheetgo\/automate-reports-using-dashboards\/\">automate reports using dashboards<\/a>.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; background_color=&#8221;#f9f9ff&#8221; custom_margin=&#8221;40px||40px||false|false&#8221; custom_padding=&#8221;15px|25px|15px|25px|true|true&#8221; border_width_left=&#8221;3px&#8221; border_color_left=&#8221;#808e95&#8243; global_module=&#8221;26540&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><em><strong>Editor\u2019s note<\/strong>: This is a revised version of a previous post that has been updated for accuracy and comprehensiveness.<\/em><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The SPARKLINE function in Google Sheets draws a small line, bar, column, or win\/loss chart inside a single cell. Syntax: =SPARKLINE(data, &#91;options&#93;) OptionWhat it sets charttype&quot;line&quot; (the default), &quot;bar&quot;, &quot;column&quot;, or &quot;winloss&quot; colorLine or column color, as a name or a hex code. Bar charts use color1 and color2. maxThe value that fills the whole [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":29607,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"In Google Sheets, if you need to visually analyze data, but not by\u00a0building bulky charts every time, <a href=\"https:\/\/support.google.com\/docs\/answer\/3093289?hl=en\" target=\"_blank\" rel=\"noopener\">SPARKLINE<\/a> formula is the one to go with. It\u00a0helps us come up with mini-sized in-cell charts, that quickly helps us visualize the trends.\n\nLet's assume we have the following set of of data, on which we need to gauge the performance based on the scores of various students of a class.\n\n<img class=\"aligncenter size-full wp-image-2551\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline1.png\" alt=\"SPARKLINE Formula - Illustration 1\" width=\"552\" height=\"363\" \/>\n\nAt the least, it is not so easy on the eyes. And, when the data extends\u00a0further, it can get even more difficult to grasp how the students are doing over time. To put this in perspective, let's just say we have over a hundred students and they have taken about 15 tests. Of course, we can't imagine establishing trends with bare eyes! And it isn't feasible to build a chart for each student.\n\nWhat, then, would be the solution? It is the SPARKLINE formula! It certainly eases up a lot of things we just discussed.\n<h3>Syntax<\/h3>\n<strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">SPARKLINE(data, [options])<\/span><\/strong>\n<ul>\n \t<li><span style=\"font-size: 12pt; font-family: 'courier new', courier, monospace;\"><strong>data<\/strong> <\/span>- this is the address reference to the range of data cells we want to plot using the SPARKLINE formula<\/li>\n \t<li><span style=\"font-family: 'courier new', courier, monospace; font-size: 12pt;\"><strong>options<\/strong> <\/span>- these are optional attributes that are used to customize the chart. There are many such options - you may want to take a look at them\u00a0<a href=\"https:\/\/support.google.com\/docs\/answer\/3093289?hl=en\" target=\"_blank\" rel=\"noopener\">here<\/a>. These can be input in two ways.\n<ul>\n \t<li>As an array of option key and option value pairs, following the data parameter.<\/li>\n \t<li>As an address reference to a two column range, where the first column cells hold the option keys, and the second column cells hold the corresponding option values.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Usage: SPARKLINE Formula<\/h3>\n<h5>Use Case # 1: SPARKLINE(data_range)<\/h5>\nTo accommodate\u00a0the Sparklines, let us insert a blank column\u00a0after the Name column, and We'll give it a header name 'Trend'. Now, in the cell B2, we'll type in the formula as shown in the snapshot below.\n\n<img class=\"aligncenter size-full wp-image-2554\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline2.png\" alt=\"SPARKLINE Formula - Illustration 2\" width=\"655\" height=\"366\" \/>\n\nLet's hit the Enter key, and what we see in the cell B2 is the Sparkline. The miniature version of a chart, all of it, nicely embedded within just the area of a cell.\n\n<img class=\"aligncenter size-full wp-image-2555\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline3.png\" alt=\"SPARKLINE Formula - Illustration 3\" width=\"653\" height=\"364\" \/>\n\nWhat we'll need to do now, is that we need such Sparklines for each and every student. It is as simple as dragging the formula all the way down (or just a simple copy paste will do). Here's how it looks like when we do that.\n\n<img class=\"aligncenter size-full wp-image-2556\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline4.png\" alt=\"SPARKLINE Formula - Illustration 4\" width=\"653\" height=\"364\" \/>\n\nThis, certainly,\u00a0is easier to interpret the data, than manually scour the scores against each student. For instance, Brett has done great in consistently improving his scores, which is rather evident from the line that's going upwards. Whereas, Eric has done the opposite. His Sparkline shows that it's a downward trend.\n<h5>Use Case # 2: SPARKLINE(data_range, color_option as key value pair)<\/h5>\nSo far, so good. Now, let's try and change the way the lines are colored. Here's how we can do it. Notice that both the key (\"color\") and value (\"red\") are within double quotes, and that they are within curly braces that indicate an array of key value pairs.\n\n<img class=\"aligncenter size-full wp-image-2557\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline5.png\" alt=\"SPARKLINE Formula - Illustration 5\" width=\"654\" height=\"388\" \/>\n<h5>Use Case # 3: SPARKLINE(data_range, [color_option and line_thickness as key value pairs])<\/h5>\nProbably the lines are too thin. Let's try and increase the width. To do that we need to include an additional option key-value pair, as shown below. Notice that the two key-value pairs are separated by a semi-colon.\n\n<img class=\"aligncenter size-full wp-image-2558\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline6.png\" alt=\"SPARKLINE Formula - Illustration 6\" width=\"655\" height=\"390\" \/>\n<h5>Use Case # 4: SPARKLINE(data_range, [column chart_type, other color_options as key value pairs])<\/h5>\nWhat if we do not want line graphs, after all? We can change it to other chart representations wherever appropriate. Let's try the column chart, shall we? Also, let's explore the other color options as shown in the snapshot below. Not the ideal looking Sparklines, I must admit. But I used this example to drive home the point that chart types can be changed too.\n\n<img class=\"aligncenter size-full wp-image-2559\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline7.png\" alt=\"SPARKLINE Formula - Illustration 7\" width=\"753\" height=\"388\" \/>\n\nYou can also use Hex codes to indicate the colors, like this.\n\n<img class=\"aligncenter size-full wp-image-2560\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/sparkline8.png\" alt=\"SPARKLINE Formula - Illustration 8\" width=\"755\" height=\"387\" \/>\n\nGiven the myriad of <a href=\"https:\/\/support.google.com\/docs\/answer\/3093289?hl=en\" target=\"_blank\" rel=\"noopener\">customization options<\/a> provided by Google Sheets to SPARKLINE formula, I'd rather encourage you to try\u00a0other variations of the SPARKLINE formula and find out your best suitable combination.","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[39,28],"class_list":["post-2550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas","tag-connections-t","tag-spreadsheets"],"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/2550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=2550"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/2550\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/29607"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=2550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=2550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=2550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}