Identify unique value, lookup in another column, then count distinct values in adjacent column.

MarkS1234

New Member
Joined
Dec 17, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Please see example below. ID and Animal will be entered in to worksheet. I have entered a formula to identify the unique IDs in Column A. But I then need to calculate how many different animals for each ID. The desired values are in red.
 

Attachments

  • Excel Formula Required.png
    Excel Formula Required.png
    17 KB · Views: 16

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Please see example below. ID and Animal will be entered in to worksheet. I have entered a formula to identify the unique IDs in Column A. But I then need to calculate how many different animals for each ID. The desired values are in red.

Excel Formula:
=LET(d,CHOOSECOLS(UNIQUE(A2:B12),1),GROUPBY(d,d,COUNTA,0,0))
 
Upvote 0
Solution

Forum statistics

Threads
1,225,626
Messages
6,186,090
Members
453,337
Latest member
fiaz ahmad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top