There are two columns in the data table, one includes the date and another one includes name like the one shown below. There is also a data table, which is a list of date. I would like to pick a name, let's say Tom, and count the no. of dates corresponding to Tom in the dates listed in the data table. To be specific, Tom appears on 2/4 for one time, 27/4 for two times, 1/4 for two times. However, 1/4 is not on the list, so it is not counted. There are two distinct dates left which are 2/4 and 27/4, so the outcome should be 2. I would really appreciate if someone can help me to figure out the formula, I have spent hours on it, thanks!!!
Data Table:
[TABLE="width: 123"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]2/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]3/4/2018[/TD]
[TD]Mary[/TD]
[/TR]
[TR]
[TD]4/4/2018[/TD]
[TD]Jason[/TD]
[/TR]
[TR]
[TD]26/4/2018[/TD]
[TD]Sam[/TD]
[/TR]
[TR]
[TD]27/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]27/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]30/4/2018[/TD]
[TD]Sam[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]1/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
</tbody>[/TABLE]
P.S. There are blank rows in between the table, which can be deleted if necessary.
Matching Table:
[TABLE="width: 74"]
<colgroup><col></colgroup><tbody>[TR]
[TD]2/4/2018[/TD]
[/TR]
[TR]
[TD]3/4/2018[/TD]
[/TR]
[TR]
[TD]4/4/2018[/TD]
[/TR]
[TR]
[TD]5/4/2018[/TD]
[/TR]
[TR]
[TD]6/4/2018
27/4/2018[/TD]
[/TR]
</tbody>[/TABLE]
Meet 2 criteria:
1. the date listed on the matching table
2. The assigned name
Data Table:
[TABLE="width: 123"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]2/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]3/4/2018[/TD]
[TD]Mary[/TD]
[/TR]
[TR]
[TD]4/4/2018[/TD]
[TD]Jason[/TD]
[/TR]
[TR]
[TD]26/4/2018[/TD]
[TD]Sam[/TD]
[/TR]
[TR]
[TD]27/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]27/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]30/4/2018[/TD]
[TD]Sam[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]1/4/2018[/TD]
[TD]Tom[/TD]
[/TR]
</tbody>[/TABLE]
P.S. There are blank rows in between the table, which can be deleted if necessary.
Matching Table:
[TABLE="width: 74"]
<colgroup><col></colgroup><tbody>[TR]
[TD]2/4/2018[/TD]
[/TR]
[TR]
[TD]3/4/2018[/TD]
[/TR]
[TR]
[TD]4/4/2018[/TD]
[/TR]
[TR]
[TD]5/4/2018[/TD]
[/TR]
[TR]
[TD]6/4/2018
27/4/2018[/TD]
[/TR]
</tbody>[/TABLE]
Meet 2 criteria:
1. the date listed on the matching table
2. The assigned name