Excel Spreadsheet Google Sheets XLS Notes

The following are some Excel  functions I use for data processing. I use Google Drive/ Google Docs/ Google Sheets.

Repeat count for each element in a list

In the 1st column of the sheet, have a list of items, then in the 2nd column, first cell, add this code:

 =ArrayFormula(QUERY(A:A&{"",""},"select Col1, count(Col2) where Col1 != '' group by Col1 label count(Col2) 'Count'",1))

The code will generate a list of unique items that make up the 1st list, and next to it in the 3rd column, will show the counts. (EG: if the 1st list is completely unique, nothing repeating, it will generate the same list with “1” next to each item)

I found the code on this Stack Overflow thread, submitted by Adam L.