Excel - How To count(*) and groupby similar to SQL

count, excel, group-by, sql

Solution

You could go with the pivot tables that give you some options to analyze your data. There is a good example with explanation on this website: http://www.contextures.com/pivottablecountunique.html

Problem

I'm looking for a way to perform a SQL type command in Excel. I need to get a count of each string in a column without knowing the string's text before hand. Here's some sample data, I want to get a count of each Name. ``` Name ---- A B C A D B ``` IN SQL I'd ``` SELECT Name, count(*) FROM @table group by Name ``` And I'd expect to get ``` Name | Count -----|------ A | 2 B | 2 C | 1 D | 1 ``` How can I perform this operation in Excel?

Original source