Home » excel » excel – Formula for number of occurrence of the sorted data

# excel – Formula for number of occurrence of the sorted data

Questions:

So I have this column with frequently occurring data. I’ve sorted the unique values and I am looking to calculate the number of occurrence of each individual data. One way of doing this is:

• Select the range with all recurring data
• Copy the data to a new page / location
• Select the newly pasted data
• Under the Data tab, click Remove Duplicates
• Apply the below formula to your list
``````=COUNTIF(A:A,A1)
``````

Alternatively, if you are filtering the data, you can simply use the same formula on your existing list since you would be filtering out the duplicates anyways.

Create a pivot table. That’s what they do.

First you can use combination of `INDEX(), MATCH()` function to extract unique values from your list. Then use `Countif()` function to count occurrence. To extract use below formula.

``````=IFERROR(INDEX(\$A\$2:\$A\$10,MATCH(0,INDEX(COUNTIF(\$C\$1:C1,\$A\$2:\$A\$10),0,0),0)),"")
``````

To count occurrence use following formula.

``````=COUNTIF(A:A,C2)
`````` Alternatively you can use `Advance Filter` method to extract unique values then use `COUNT()` function.

Being that you already have the unique values, the answer to your question is to use the `COUNTIF` formula.
`=COUNTIF(A:A,C2)` then drag down