COUNTIF - Duplicates within the same column
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all
I couldn't find a solution to this in the other topics so any feedback would be appreciated!
Data set
Name |
A |
B |
A |
C |
B |
A |
D |
C |
Output I would like
Name | Count |
A | 3 |
B | 2 |
A | 3 |
C | 2 |
B | 2 |
A | 3 |
D | 1 |
C | 2 |
To add, I would like to count exact values (A=A and not Aa~A) so I am not sure if (assuming I should use the summarize tool) I should use count or count distinct?
Thank you in advance!
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @h12
Here is how you can do it. You can use summarise tool to make groupby and get count. You can add back the count using find&replace or join tool.
Workflow:
Hope this helps : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for your prompt response! I updated my post, but if I use count would that cover distinct values? i.e. I would like to count the exact matches in the Name column?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @h12
Since we are using groupby on name it is only counting the occurrence of each same name.
Count takes in all occurrences whereas count distinct takes in only distinct occurrences. And in this scenario we need count.
Hope this helps : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry, so it would count each occurrence of the name in its exact form, so if a name is slighlty difference to another (e.g. ABC' and ABC) it would flag it in separate rows?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! Just seen your update to your post! Thank you for responding soo quickly!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @atcodedog05 - just a question, could I use the join tool and join on the 'Name' column rather than using find & replace? Do one have more accuracy than the other?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @h12
Join tool resets the sort order (changes order in which rows are)
Find and replace maintains the sort order (maintains order in which rows are)
Personal preference is find and replace over join tool in this scenario 🙂
Hope this helps : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!!
