# Count of duplicate values in a column between a date range

#### Sumit7285

##### New Member
I have 2 columns: 1st column contains dates and 2nd column contains Names. I need to count the number of duplicate entries between a date range.

thanks,

##### MrExcel MVP
I have 2 columns: 1st column contains dates and 2nd column contains Names. I need to count the number of duplicate entries between a date range.

thanks,
A2:A100 >> dates
B2:B100 >> names

E2: date1
F2: date2

where date1 <= date2.

In G2 control+shift+enter, not just enter:
Rich (BB code):
``````=SUM(IF(FREQUENCY(IF(1-(\$B\$2:\$B\$100=""),IF(\$A\$2:\$A\$100>=date1,
IF(\$A\$2:\$A\$100<=date2,MATCH("~"&\$B\$2:\$B\$100,\$B\$2:\$B\$100&"",0)))),
ROW(\$B\$2:\$B\$100)-ROW(\$B\$2)+1),1))
``````
You can omit the "~"& and &"" bits if the names do not contain or are srurrounded with chars with special meaning like <, *, etc.

#### Sumit7285

##### New Member
Hi Aladin, Thanks for the response but the formula is returning 0 value. Please refer the below table for the sample data.

 visit_date pos_id 2/17/2016 948847 2/17/2016 1071125 2/17/2016 1096333 2/17/2016 975751 2/17/2016 1098291 2/17/2016 1031913 2/17/2016 1052474 2/17/2016 943079 2/16/2016 1176526 2/8/2016 1085475

<colgroup><col><col></colgroup><tbody>
</tbody>

##### MrExcel MVP
Hi Aladin, Thanks for the response but the formula is returning 0 value. Please refer the below table for the sample data.

 visit_date pos_id 2/17/2016 948847 2/17/2016 1071125 2/17/2016 1096333 2/17/2016 975751 2/17/2016 1098291 2/17/2016 1031913 2/17/2016 1052474 2/17/2016 943079 2/16/2016 1176526 2/8/2016 1085475

<tbody>
</tbody>
Care to post the formula you applied to this sample?

1,082,360
Messages
5,364,935
Members
400,815
Latest member
Joaquin Phoenix

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...