Formula to return count of unique values in one column, for each different value in another column

aldousjg

New Member
Joined
Jan 20, 2021
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm having trouble with a formula which needs to return a count of unique names found in one column for each unique combination of number and date found in two other columns. Hopefully this example explains it a bit better:

1611650406804.png


So for the combination of 123 and 01/01/2000, there is one unique name in the Names column and a value of 1 is returned, but for the combination of 456 and 03/03/2000, there are three unique names in the names column and a value of 3 is returned.

My actual dataset is a few thousand rows and I would now be able to specify actual values of number or date in a formula.

Could anyone help?

Thank you,
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

maabadi

Well-known Member
Joined
Oct 22, 2012
Messages
1,795
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
You Can Use Countifs that have multiple criteria range and Criteria for each Range.
 

mart37

Well-known Member
Joined
Aug 4, 2017
Messages
1,091
Office Version
  1. 2016
Platform
  1. Windows
count unique items with 2 conditions.xlsx
D
22
Blad1
Cell Formulas
RangeFormula
D2D2=SUM(IF(--FREQUENCY(IF(($A$2:$A$16&"|"&$B$2:$B$16=A2:A2&"|"&B2:B2),MATCH($C$2:$C$16,$C$2:$C$16,0)),IF(($A$2:$A$16&"|"&$B$2:$B$16=A2:A2&"|"&B2:B2),MATCH($C$2:$C$16,$C$2:$C$16,0)))>0,1))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,547
Office Version
  1. 365
Platform
  1. Windows
Another option
Excel Formula:
=ROWS(UNIQUE(FILTER($C$2:$C$1000,($A$2:$A$1000=A2)*($B$2:$B$1000=B2))))
 

Watch MrExcel Video

Forum statistics

Threads
1,129,549
Messages
5,636,941
Members
416,953
Latest member
prakashkumar

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
Top