View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Count Distinct Values based on criteria

Try this array formula** :

D2 = AdjDrop
D3 = AdjAdd

Array entered** in E2 and copied down to E3:

=SUM(IF(FREQUENCY(IF(B$2:B$12=D2,A$2:A$12),A$2:A$1 2),1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"FinChase" wrote in message
...
Hi,
I am working with a spreadsheet of about 4500 rows. I need to do a count
of
unique ID numbers in column A based on criteria in column B.

Example:

Col A Col B
1111 NoAdj
2222 AdjAdd
2222 AdjAdd
2222 AdjDrop
3333 NoAdj
4444 AdjDrop
4444 AdjDrop
5555 AdjAdd
5555 AdjDrop
5555 AdjDrop
6666 NoAdj

I will be wanting to count distinct ID numbers based on AdjDrop and AdjAdd
values in column B. While it's easy enough to count based on criteria,
I'm
having trouble figuring out how to count distinct ID numbers based on
criteria.

Any help would be appreciated!