Count Unique Values That Meet Criteria

masouder

Board Regular
Joined
Jul 5, 2013
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
I am attempting to count the unique values in one column where a criteria is met in another column. (Assume the following data starts in cell A1.) I want to count the number of different Names in Office 1. (The answer is 3: Joe, Lisa and Betty.) I don't think the COUNTIFS function will work, but I suspect the SUMPRODUCT function would. How can I accomplish this?

OfficeNameSale $
1Joe$100
2Sally$200
1Joe$300
2Mark$100
1Lisa$400
1Betty$200
1Lisa$100
2Mark$300
1Lisa$500
2Sally$200

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
A
B
C
D
E
1
OfficeNameSale $
2
1​
Joe
100​
3​
3
2​
Sally
200​
4
1​
Joe
300​
5
2​
Mark
100​
6
1​
Lisa
400​
7
1​
Betty
200​
8
1​
Lisa
100​
9
2​
Mark
300​
10
1​
Lisa
500​
11
2​
Sally
200​

<tbody>
</tbody>


E2=
SUM(IF(FREQUENCY(IF(A2:A11=1,MATCH(B2:B11,B2:B11,0)),ROW(B2:B11)-ROW(B2)+1),1))

Control+Shift+Enter
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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