Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to aggregate rows with the same key in Google Sheets

$
0
0

I have a table of dates with names that I would like to aggregate. As time passes, more dates and more names can be added, so I'd like this solution to auto-populate itself.Basically,

AbeBobCharlie
5/1221x
5/12x
5/13111
5/1311

should become

ABC
5/12121
5/13122

I tried COUNTA(QUERY({Input!$A$1:$H$10}, "SELECT Col"&Column(B$1) - Column($A$1) + 1&" WHERE Col1 = '"&$A2&"'")) - This works, but it doesn't allow me to autopopulate the rest of the table.

I think I need to use ArrayFormula somehow, but from what I've read, it's only able to iterate over the input to the query and not the values in the various columns. I tried ARRAYFORMULA(COUNTA(QUERY({A1:H1; ARRAYFORMULA(VLOOKUP($A$2, Input!$A$1:$H$10, COLUMN(Input!$A$1:$H$1), 0))}, "SELECT Col2 WHERE Col1 = '"&$A$2:$A$4&"'"))), but it doesn't iterate as desired (over $A$2:$A$4).

I'm stuck on how to achieve this.

I have a sample sheet here


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>