Count Merged Rows in Google Sheets

Learn how to count merged rows in Google Sheets using a custom Apps Script that simplifies the process, making it easy to track how many rows are merged in your spreadsheet.

This happens all the time. We're working in Google Sheets, we have some times or some data in a sheet, and we're going to merge rows based on how many of these correspond, right? So this is three rows, they all correspond to New York City, and we're going to merge New York City. In the case, we might be better off doing something like this, but it's not always the same look and feel we may want to actually just merge the rows and have one city here. Now, This looks fine. I can see here three rows, but if I do this for hundreds or dozens of rows even, it's going to become a little bit unwieldy to count each and every, uh, one of these items, uh, when I really just want to know how many, uh, How many times did I merge this Vancouver? Count Merged Rows How to Merge Cells in Google Sheets UnMerge Automatically Google Sheets

Well, I made a Apps Script that does this for you. Uh, check out Apps Script and you can see it here when it opens. What we've done is, first we've created an on open menu that, uh, this is just going to be a menu right here, this new menu, and we're going to be able to access it. But what does this row count do? What the row count simply does is take the variable rows wherever we're active. So we're getting the active range , the selection that we're in, and we're getting The number of rows. getNumberRows. We're saying, in our spreadsheet that's active right now, create a toast menu and show us how many rows there are. Have the text rows and then insert that number here. So if we are 1, B2, this is only one cell, we click up here, row count, and Count Merged Rows Spreadsheets Explained over 5 Levels of Difficulty Count Merged Rows Go To Random Row Custom Function

in the bottom right, it'll say rows 1. But now we click on NYC where we merged three rows, we're going to click new menu, row count. And immediately we see rows three. And this works however many times we merge the cells . So let's merge those, all of these, into one. And go up to new menu, row count, and get nine rows. There we go. So very quickly we've been able to create this little tool in our sheet that counts the merged rows. Uh, counts the number of rows in a merged cell. Count Merged Rows Count Merged Rows How to Merge Cells Horizontally