Let's say I have a table with the following values.
Ford Ford Ford Honda Chevy Honda Honda Chevy
So I want to construct the following output.
Ford 3 Honda 3 Chevy 2
It just takes the count of each element in the column.
I'm having an issue listing the unique columns.
Can anyone tell me how to do this?
I've messed around with UNIQUE
and DISTINCT
, but I'm not able to get the list of values on the left.
Use the COUNTIF function to count how many times a particular value appears in a range of cells. For more information, see COUNTIF function.
In Excel, I can tell you some simple formulas to quickly count the occurrences of a word in a column. Select a cell next to the list you want to count the occurrence of a word, and then type this formula =COUNTIF(A2:A12,"Judy") into it, then press Enter, and you can get the number of appearances of this word.
Use the =Countif function to count the number of times each unique entry appears in the original list.
Do you mean this?
select car_make, count(*) from cars group by car_makes
select car_made, count(*) as occurrences from cars group by car_made order by occurrences desc, car_made
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With