Countif unique values

ian_a91

Board Regular
Joined
Apr 23, 2014
Messages
63
I'm trying to create a formula that will count the unique values from one stationary criteria and other data that can change

NameCustomer
Employee 1Customer 1
Employee 1Customer 1
Employee 2Customer 1
Employee 2Customer 2

<tbody>
</tbody>

Looking at the data above i want to be able to count the unique values for both columns

A countif "employee 1" would be 2

I'm looking to create a formula which will countif "Employee 1" then look at the values in the Customer column for unique values

so it would be something like =Countif "employee 1" and unique value in Customer column = 1

Any help would be great
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Thanks for this Peter but my differs from your issue because the data in the the "Customer" column changes day on day so I cant add in "Customer 1" so i need to countif formula to look at Employee 1 and count the unique values in the customer column. I'm sorry if this isn't 100% clear.
 
Last edited:
Upvote 0
maybe...

Excel 2013
ABCD
1NameCustomerEmployee 1
2Employee 1Customer 11
3Employee 1Customer 1
4Employee 2Customer 1
5Employee 2Customer 2

<tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
D2{=SUM(IF(FREQUENCY(IF(B2:B5<>"",IF(A2:A5=D1,MATCH(B2:B5,B2:B5,0))),ROW(A2:A5)-ROW(A2)+1),1))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
{=SUM(IF(FREQUENCY(IF(B2:B5<>"",IF(A2:A5=D1,MATCH(B2:B5,B2:B5,0))),ROW(A2:A5)-ROW(A2)+1),1))}

Looking at the formula could the reference A2 and D1 refer to one cell or is there a specific reason they refer to two different cells
 
Upvote 0
it really just depends where on your spreadsheet you have the data.

D1 can go where ever you want it as its just the criteria for column A

A2 would be whatever the start of the range is that you have the data in. so if the data was in column C starting in row 3 then it would be ROW(c3:c6)-ROW(c3)+1

hopefully that makes sense
 
Upvote 0
Thanks for this Peter but my differs from your issue because the data in the the "Customer" column changes day on day so I cant add in "Customer 1" so i need to countif formula to look at Employee 1 and count the unique values in the customer column. I'm sorry if this isn't 100% clear.

rather than have "customer" in the formula, just use the cell reference where you have the info that would change,
 
Upvote 0
thats brilliant it's working great thanks for running me through that i really appreciate it :)
 
Upvote 0

Forum statistics

Threads
1,215,663
Messages
6,126,097
Members
449,291
Latest member
atfoley16

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