profile

Google Sheets Tips

Sheets Tip 302: Titles ❤️ Totals

Published 13 days ago • 3 min read


Hi Reader,

Welcome to the Google Sheets Tips newsletter #302, your Monday morning espresso, in spreadsheet form!

I'm sick at the moment, battling a nasty sinus infection. I'm not a good patient because I'm too impatient. There are so many things to do! But I'm wiser now than a decade ago and realize that rest comes first.

At least I wrote this week's newsletter before getting sick. And I think it's an interesting newsletter. But it's one that might divide opinion. Purists will dislike it because it breaks the rules but I find it a useful tactic in certain situations. Let me know what you think...

By next week's newsletter I hope to be fully recovered. In the meantime, I hope you have a great week!

A big thank you to this week's sponsors who help keep this newsletter free to read:

BUDGETSHEET

Import Bank Transactions Automatically

The easiest way to import bank transactions into Google Sheets. No more manual exports or copying & pasting from CSV files. Just your live bank data in your spreadsheets, auto-categorized and formatted exactly how you like it. Trusted by thousands of happy customers.

_______

➜ Google Sheets Tip #302: Add Totals to column Titles with the TEXT function

This is a neat tip that I use frequently in my own project management Sheets.

Suppose we want to know the total of a column of data in my table. A helpful metric that we can see at a glance.

But we don't want to add totals to the bottom of the data table because new rows of data are frequently added. Not to mention that it's inconvenient to scroll to the bottom of the Sheet to see the totals.

And we don't want to add a totals row above the table because we want the column headers on row 1.

What can we do?

We can sneak the column total (or other metric) into the column heading!

Consider this dataset of blog posts I've published so far this year:

Specifically, look at the two orange columns and notice the values in parentheses. These numbers are the totals for those columns.

So, at a glance, we can see the total word count and the 30-day web traffic totals.

How can add totals to our titles?

The column titles are text values. To combine numbers and text values we can use the "&" concatenation operator.

For example:

="The meaning of life is "&42

simply outputs "The meaning of life is 42".

Of course, we can reference the number from a cell rather than directly typing it into our formula.

Thus, with the number 42 in cell A2, this formula

="The meaning of life is "&A2

gives the same output.

Knowing that, we can include a SUM function in our column heading:

="Word count "&SUM(D2:D)

which gives the output "Word count 9527".

Note that we leave the range reference open (i.e. D2:D rather than say D2:D100) so that it will always include new rows of data.

To make it look better, let's add parentheses around the number. Note that we have to use the "&" to include the closing ")" too.

="Word count ("&SUM(D2:D)&")"

which now gives the output "Word count (9527)"

Finally, Google Sheets has a useful TEXT function that converts numbers into text values with a specific format.

So we can add the thousands separator into the number too. Our final formula becomes:

="Word count ("&TEXT(SUM(D2:D),"#,##0")&")"

and the output is "Word count (9,527)".

For more examples, check out this article:

How To Combine Text And Numbers In Google Sheets

Note

One thing to keep in mind with this method is that the numbers are now an integral part of the column heading. That means the numbers will show up in pivot table headings etc.

So I tend to use this method only for datasets where I don't anticipate doing further analysis. If I'm creating pivot tables, then these embedded numbers can become confusing. And there not needed since you'll be calculating totals etc. in your pivot tables anyway.

_______

If you enjoyed this newsletter, please forward it to a friend who might enjoy it.

Have a great week!

Cheers,
Ben

P.S. As the world's second worst singer, after my Dad, it's a good job I wasn't in the audience for this beautiful sing-a-long!

Google Sheets Tips

by Ben Collins

Get better at working with Google Sheets! Join 50,000 readers to get an actionable tip in your inbox every Monday.

Read more from Google Sheets Tips

Hi Reader, Greetings from sunny Harpers Ferry! ☀️ The rain has stopped (until tomorrow at least!) and I'm finally feeling better so I'm optimistic for the week ahead! Welcome to this issue of the Google Sheets Tips newsletter, #303, your Monday morning espresso, in spreadsheet form! Wow, that's a lot of exclamation points in the first few sentences! Oops, that was another. It's the optimism I feel today ;) Today I want to share a data visualization technique for showing change between two...

6 days ago • 3 min read

Hi Reader, Welcome to the Google Sheets Tips newsletter #301, your Monday morning espresso, in spreadsheet form. Earlier this year I sat down to record a new course but progress stalled before I got far. I've been creating courses for 7 years and realized that I need to freshen things up. One change I want to make is to inject more meaning into my work. I'm deeply interested in our natural world and protecting it for future generations. I want to use the skills I have and apply them towards...

20 days ago • 3 min read

Hi Reader, Welcome to this anniversary edition of the Google Sheets Tips newsletter, your Monday morning espresso, in spreadsheet form. This is the 300th edition of this weekly newsletter! 🎉 I've been sending it out for six years. The first issue — about keyboard shortcuts — was sent on 30 April 2018 to 2,357 of you. (Huge shout-out to anyone who's still with me!) In honor of this milestone, I want to look back at the six-year journey: The newsletter began life as the "Monday Tip" newsletter,...

27 days ago • 2 min read
Share this post