Google Sheets: How To Dynamically Combine Multiple Cells in A Row

Which states have the most big cities?

Code & Coins
5 min readMay 17, 2024
Photo by Luca Bravo on Unsplash

I was recently answering a question on Quora, which required me to collect data on each state and the number of cities they had with a population of more than 50,000. I wanted to present the data in an easy to read list, without having to type out the results for each state one by one.

I decided to use a Google Sheet so I could first enter the state and number of cities with ≥50,000 people in alphabetical order — rather than trying to guess which ones would come next — and then sort them by number of cities with ≥50,000 at the end.

After entering all of the data and sorting it, below is what my list started to look like.

This worked out great, in the sheet, but when it came time to port the data over into the Quora response, it ended up looking like this.

First, this isn’t very readable. Second, it didn’t have list numbers tied to them…