Help with count unique values in a column in Excel with vlookup

thepianoman12

New Member
Joined
Sep 7, 2014
Messages
1
Hi Everyone,

I would like to know if there is a function that can help me count unique values in spreadsheet X , in specific column (B) that match to specific values in sheet Y .
For example:

Sheet X:
A B
[TABLE="width: 394"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD="align: right"]01/09/2014[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"]02/09/2014[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]03/09/2014[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]04/09/2014[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Sheet Y:

A B C D
[TABLE="width: 510"]
<colgroup><col><col><col span="3"></colgroup><tbody>[TR]
[TD="align: right"]03/09/2014 00:00[/TD]
[TD="align: right"]63036777[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]03/09/2014 00:00[/TD]
[TD="align: right"]63023794[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]06/09/2014 00:00[/TD]
[TD="align: right"]63134683[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]06/09/2014 00:00[/TD]
[TD="align: right"]63133711[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63109595[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63109595[/TD]
[TD][/TD]
[TD]Dona[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63107710[/TD]
[TD][/TD]
[TD]Kim[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63091487[/TD]
[TD][/TD]
[TD]Dona[/TD]
[TD]Japan[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63091487[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]Japan[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63084994[/TD]
[TD][/TD]
[TD]Dona[/TD]
[TD]Japan[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63084994[/TD]
[TD][/TD]
[TD]Kim[/TD]
[TD]Japan[/TD]
[/TR]
[TR]
[TD="align: right"]05/09/2014 00:00[/TD]
[TD="align: right"]63076234[/TD]
[TD][/TD]
[TD]Kim[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]04/09/2014 00:00[/TD]
[TD="align: right"]63065845[/TD]
[TD][/TD]
[TD]Dona[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]04/09/2014 00:00[/TD]
[TD="align: right"]63065845[/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]United States[/TD]
[/TR]
[TR]
[TD="align: right"]04/09/2014 00:00[/TD]
[TD="align: right"]63048586[/TD]
[TD][/TD]
[TD]Dona[/TD]
[TD]Japan[/TD]
[/TR]
[TR]
[TD="align: right"]04/09/2014 00:00[/TD]
[TD="align: right"]63048586[/TD]
[TD][/TD]
[TD]Kim[/TD]
[TD]Japan[/TD]
[/TR]
</tbody>[/TABLE]


I need that the function will count me how many unique values i had in sheet Y on column B that match the following conditions: from Japan (column D) and they match the date 04/09/2014 from column A in sheet X .

In This example the answer is 1.



Please Tell me if you need any additional details.


Thank you all for your help!
 
with an pivot table.


Book1
IJ
2RijlabelsAantal van country
33-9-2014 00:002
4Jack2
5630237941
6630367771
74-9-2014 00:004
8Dona2
9630485861
10630658451
11Jack1
12630658451
13Kim1
14630485861
155-9-2014 00:008
16Dona3
17630849941
18630914871
19631095951
20Jack2
21630914871
22631095951
23Kim3
24630762341
25630849941
26631077101
276-9-2014 00:002
28Jack2
29631337111
30631346831
31Eindtotaal16
Blad1
 
Upvote 0
...
I need that the function will count me how many unique values i had in sheet Y on column B that match the following conditions: from Japan (column D) and they match the date 04/09/2014 from column A in sheet X .

In This example the answer is 1.
...

Sheet Y, A2:D17, houses a data sample.

Sheet X, A5 houses a date like 04/09/2014.

Let B1 house Japan as the country condition you mention.

B5, control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF(INT(Y!$A$2:$A$17)=$A5,IF(Y!$B$2:$B$17<>"",
  IF(Y!$D$2:$D$17=B$1,MATCH(Y!$B$2:$B$17,Y!$B$2:$B$17,0)))),
  ROW(Y!$B$2:$B$17)-ROW(Y!$B$2)+1),1))

Is this what you are after?
 
Upvote 0

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