Excel - finding unique number of value based on ID/column

Viewed 25

I have a table that looks like the following:

ID Company
123 ABC
123 DEF
123 ABC
456 ABC
456 ABC

I want to insert a new column that tells me how many unique company's are associate with each ID. So ideally something like this:

ID Company Count
123 ABC 2
123 DEF 2
123 ABC 2
456 ABC 1
456 ABC 1

That way I can just filer out the 1 value and only have the 2 (or more) left to focus on. Any help would be appreciated!

1 Answers

If you have Excel 365 you can use this formula:

=ROWS(UNIQUE(FILTER([Company],[ID]=[@ID])))

I used a table with the according column headers

It first selects all companies belonging to the row ID, returns them as unique values and counts them

Related