Reputation: 157
I need to count same items in excel. In excel sheet in rows with following data. (large amount of data in one column).
data: natural,amenity,highway,amenity,amenity,highway,shop,highway,place,place,sport,barrier amenity,highway,barrier,highway,highway,highway,amenity,amenity,amenity,amenity, natural,amenity,highway,amenity,amenity,highway,shop,highway,place,place,sport,barrier amenity,highway,barrier,highway,highway,highway,amenity,amenity,amenity,amenity, natural,amenity,highway,amenity,amenity,highway,shop,highway,place,place,sport,barrier amenity,highway,barrier,highway,highway,highway,amenity,amenity,amenity,amenity.
From this how i can get count of amenity , count of shop.
thank you
Upvotes: 1
Views: 8073
Reputation: 55672
My Duplicate Master addin is another potential solution. While for your question as asked I would normally go with the PivotTable suggestion from Kash (but using dynamic ranges to capture any data size changes), the addin provides further flexibility and output options that may be of use
Upvotes: 0
Reputation: 12495
While I would go with @Kash is answer.
If you know the row values you want, and asuming the data in column A, then you could use the formula:
=COUNTIF(A:A,"amenity")
replacing "amenity" with each value you want to count
Upvotes: 2
Reputation: 9019
Several ways to do it and listed out here: Count how often a value occurs
The Pivot table approach would be more organized and can be just refreshed if new entries are added. Insert a Pivot table and drag your "Data" field both in the Row Labels and Values of the pivot table (which defaults to Count of Values).
PS: Though you have tagged VBA for this question, please note this is not needed for this simple count.
Upvotes: 2