For the sparklines with 2 colours, there is no need for the 2nd column. You can input the range as an array (within curly brackets), so the formula would look like this: =SPARKLINE( { A14 ; 10 - A14 } ; {"charttype" ; "bar" ; ....... etc } )
Hi @ArjanGroenenboom, You're absolutely right, thanks for that piece of information. 👍🏻 The final formula would look like this if anyone is interested: =SPARKLINE({ A14 ; 10 - A14 },{"charttype","bar";"max",10;"color1","31c257";"color2","ffd966"}) What's happening here is that part { A14 ; 10 - A14 } is an array literal, which is used to provide two data points for the sparkline chart. A14 takes the value from cell A14. 10 - A14 calculates the difference between 10 and the value of A14. This forms a complementary data point to create a two-part bar chart. The number 10 could be any number you wish, but it's essentially the maximum number for the chart. The semicolon (;) separates the values vertically, meaning the two data points will be stacked in the bar chart. It's certainly a neat way of dealing with a range of numbers.
Is it possible to reverse the progress bar, so that it's like an HP bar that goes down? The idea I have is say I have a budget of $100, the more I use of that $100, the more the bar goes down, rather than up.
Sure, you would simply reverse the values in the data range. You might want to check this post out too: www.spreadsheetwise.com/post/sparklines-in-google-sheets-a-simple-guide-to-rich-data-visualisation
very nice man, helps me a lot. Is there a possible way to show the graph in the same cell where the data stands? Like the "2" in this case is right in the middle of the bar?
This isn't possible with SPARKLINES, according to Google's official help page here support.google.com/docs/answer/3093289?hl=e It is possible using the REPT and CHAR functions in Google Sheets. I have a video on this method here th-cam.com/video/WurBzQ7HZjk/w-d-xo.html but it would be slightly different to these examples. I'll post another video to explain how to achieve what you need 👍
Great vid, thanks!
Glad you liked it!
For the sparklines with 2 colours, there is no need for the 2nd column. You can input the range as an array (within curly brackets), so the formula would look like this:
=SPARKLINE( { A14 ; 10 - A14 } ; {"charttype" ; "bar" ; ....... etc } )
Hi @ArjanGroenenboom, You're absolutely right, thanks for that piece of information. 👍🏻
The final formula would look like this if anyone is interested:
=SPARKLINE({ A14 ; 10 - A14 },{"charttype","bar";"max",10;"color1","31c257";"color2","ffd966"})
What's happening here is that part { A14 ; 10 - A14 } is an array literal, which is used to provide two data points for the sparkline chart.
A14 takes the value from cell A14.
10 - A14 calculates the difference between 10 and the value of A14. This forms a complementary data point to create a two-part bar chart. The number 10 could be any number you wish, but it's essentially the maximum number for the chart.
The semicolon (;) separates the values vertically, meaning the two data points will be stacked in the bar chart.
It's certainly a neat way of dealing with a range of numbers.
Thanks for your sharing!
You’re welcome! 😉
Thank you...i'm really appriciate it
No problem 😊
great and helpful videos, thank you
Glad you like them! 👍🏻
Is it possible to reverse the progress bar, so that it's like an HP bar that goes down? The idea I have is say I have a budget of $100, the more I use of that $100, the more the bar goes down, rather than up.
Sure, you would simply reverse the values in the data range. You might want to check this post out too: www.spreadsheetwise.com/post/sparklines-in-google-sheets-a-simple-guide-to-rich-data-visualisation
thank you!
You're welcome!
niice thanks man 🤗
No problem 👍
very nice man, helps me a lot. Is there a possible way to show the graph in the same cell where the data stands? Like the "2" in this case is right in the middle of the bar?
I'm afraid not, you would have to use a traditional chart to superimpose a value over the chart
Is there a way to include 4 values? I want to create a stacked bar graph within a cell. Each value has a different color.
This isn't possible with SPARKLINES, according to Google's official help page here support.google.com/docs/answer/3093289?hl=e It is possible using the REPT and CHAR functions in Google Sheets. I have a video on this method here th-cam.com/video/WurBzQ7HZjk/w-d-xo.html but it would be slightly different to these examples. I'll post another video to explain how to achieve what you need 👍
Hey Pota Chip, I hope this video helps you out 😉 th-cam.com/video/XASFD73PcRE/w-d-xo.html