Counting Unique number of countries between dates

SharmaAntriksh

New Member
Joined
Nov 8, 2017
Messages
31
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]12/26/2011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]ENG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]12/27/2011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]ENG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]12/27/2011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]WAL[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]1/14/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]ENG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]1/15/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]ENG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]1/20/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]GER[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]1/21/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]GER[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]1/28/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]GER[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]1/28/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]GER[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]2/3/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]GER[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]2/4/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]GER[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]2/11/2012[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]CZE[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]2/16/2012[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD]CZE[/TD]
[/TR]
</tbody>[/TABLE]

Is there a formula to count how many unique countries are there between 2 given dates?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
a
[/TD]
[TD]
b
[/TD]
[TD]
c
[/TD]
[TD]
d
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]
2/26/2011​
[/TD]
[TD]eng[/TD]
[TD][/TD]
[TD]
4​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
12/27/2011​
[/TD]
[TD]eng[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
12/27/2011​
[/TD]
[TD]wal[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
1/14/2012​
[/TD]
[TD]eng[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
1/15/2012​
[/TD]
[TD]eng[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11
[/TD]
[TD]
1/20/2012​
[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
12
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
13
[/TD]
[TD]
1/21/2012​
[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
14
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
15
[/TD]
[TD]
1/28/2012​
[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
16
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
17
[/TD]
[TD]
1/28/2012​
[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
18
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
19
[/TD]
[TD]
2/3/2012​
[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
20
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
21
[/TD]
[TD]
2/4/2012​
[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
22
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
23
[/TD]
[TD]
2/11/2012​
[/TD]
[TD]cze[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
24
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
25
[/TD]
[TD]
2/16/2012​
[/TD]
[TD]cze[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

d1=SUM(IF(FREQUENCY(IF($A$1:$A$25>=$A$1,IF($A$1:$A$25<=$A$25,IF($A$1:$A$25<>"",MATCH($B$1:$B$25,$B$1:$B$25,0)))),ROW($B$1:$B$25)-ROW($B$1)+1),1))

control+shift+enter
 
Upvote 0
sorry this formula is ok

d1=SUM(IF(FREQUENCY(IF($A$1:$A$25>=$A$1,IF($A$1:$A$25<=$A$25,IF($B$1:$B$25<>"",MATCH($B$1:$B$25,$B$1:$B$25,0)))),ROW($B$1:$B$25)-ROW($B$1)+1),1))

contrl+shift+enter
 
Upvote 0
[TABLE="class: grid, width: 443"]
<tbody>[TR]
[TD]12/26/2011[/TD]
[TD]ENG[/TD]
[TD][/TD]
[TD="align: right"]1/15/2011[/TD]
[TD="align: right"]1/25/2012[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]12/27/2011[/TD]
[TD]ENG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12/27/2011[/TD]
[TD]WAL[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/14/2012[/TD]
[TD]ENG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/15/2012[/TD]
[TD]ENG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/20/2012[/TD]
[TD]GER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/21/2012[/TD]
[TD]GER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/28/2012[/TD]
[TD]GER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/28/2012[/TD]
[TD]GER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/3/2012[/TD]
[TD]GER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/4/2012[/TD]
[TD]GER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/11/2012[/TD]
[TD]CZE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/16/2012[/TD]
[TD]CZE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

In F1 control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($B$1:$B$13=""),IF($A$1:$A$13>=$D1,IF($A$1:$A$13<=$E1,MATCH($B$1:$B$13,$B$1:$B$13,0)))),ROW($B$1:$B$13)-ROW($B$1)+1),1))

1) The date conditions/criteria are here outside of the data are.

2) 1-($B$1:$B$13=") is equivalent to $B$1:$B$13<>"".
 
Upvote 0

Forum statistics

Threads
1,225,367
Messages
6,184,542
Members
453,241
Latest member
rahuldev31

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