Hi Reader,
Welcome to the Google Sheets Tips newsletter #277, your Monday morning espresso, in spreadsheet form!
Fall is in full swing here in the Mid-Atlantic region of the US, where I'm based. The colors are fantastic right now and I am here for it! ๐
I hope you're enjoying the cooler weather and vibrant colors if you're in the Northern hemisphere, or the welcome return of some warmth if you're in the Southern hemisphere.
A big thank you to this week's sponsors who help keep this newsletter free to read:
I.
โHere's an interesting read from Hjalmar Gislason at Grid, who posits that domain experts use spreadsheets to โencodeโ their unique expertise and monetize it.
โMonetizing expertise through spreadsheet modelsโ
_______
A reader recently asked me how to draw a right-aligned pyramid chart in Google Sheets.
What's that, I hear you ask?
Well, here's an example:
You see them used frequently for population pyramids.
So let's create it, one formula at a time (what I call the Onion Method!).
The first step is to calculate the "gap", i.e. the difference between 100% and our number.
Use this formula in cell B2:
=1-A2We then use the value in A2 and this new value in B2 as the data inputs to the SPARKLINE function (e.g. 40% in A2 and 60% in B2). That's fine, but ultimately we want the pyramid chart to show in cell B2.
So, we use an array literal formula to capture both the original value and the "gap" value. This formula spills across cells B2 and C2:
={A2,1-A2}(Note, if you're European-based you use a backslash "quot; instead of a comma "," inside this array literal formula.)
Next, wrap this array with the SPARKLINE function and specify the "bar" as the chart type.
=SPARKLINE({A2,1-A2},{"charttype","bar"})The output at this stage is:
We have two tasks left: 1) only highlight the value part of the chart (orange), not the gap part (blue), and 2) flip it to be right-aligned.
To hide the gap part, we can set the value of "color2" to be white. Note, adjust "color1" to change the orange color.
Here is the updated formula:
=SPARKLINE({A2,1-A2} , {"charttype","bar" ; "color2","white"})which gives an output:
Looking good!
Of course, we could stop here but let's see how to right align it.
There are two methods:
For method 1, set the "rtl" value to true, as shown in this formula:
=SPARKLINE({A2,1-A2} , {"charttype","bar" ; "color2","white" ; "rtl",true})This gives us this nice result:
However, the eagle-eyed amongst you might spot the orange border around the sparkline chart.
(Don't worry if you can't see it, it's very faint on these images, but you can see it more clearly in the Sheet.)
So, to mitigate this, we can flip the data around instead of using the "rtl" property.
Use this formula with the data values switched around:
=SPARKLINE({1-A2,A2} , {"charttype","bar" ; "color1","white"})And now the output is:
See if you can turn this into an array formula, so it works for any rows with values. There are a few different ways to do this: with the traditional ArrayFormula function or the newer LAMBDA functions like BYROW.
Have fun!
As always, I welcome any comments you want to share.
_______
If you enjoyed this newsletter, please forward it to a friend who might enjoy it.
Have a great week!
Cheers,
Ben
P.S. An incredible timelapse of the recent annular eclipse.โ
Get better at working with Google Sheets! Join 50,000 readers to get an actionable tip in your inbox every Monday.
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #379, your Monday morning espresso, in spreadsheet form! Anyone else feeling a little overwhelmed with everything AI these days? Every day, panicked people on Twitter are prophesying the end of white-collar jobs. And Block recently announced they are reducing their headcount by 40% (4,000 people) because of AI, so maybe they have a point. But on a visit to a new dentist last month, I still had to fill out a paper form...
Hi Reader, Welcome to the Google Sheets Tips newsletter #378, your Monday morning espresso, in spreadsheet form! Last week, I shared an essay about how weโre at a threshold in 2026 where writing complex formulas from scratch doesn't make sense anymore (and others have come to similar conclusions). Itโs simply no longer economically viable to spend 45 minutes wrestling with syntax when Gemini can generate the same result in seconds. Today, weโre putting that theory to the test with one of the...
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #377, your Monday morning espresso, in spreadsheet form! Coming to your inbox on a Tuesday this week, because it was a public holiday here in the US yesterday. Today I'm pondering whether it makes sense to write your own formulas anymore. AI tools are getting so good at writing formula syntax (and Apps Script code) that it doesn't make sense (economically at least) to spend hours crafting complex formulas yourself, if...