Count of duplicate

Hello All,
I have two excel files in which one file has policy numbers with duplicates and other with unique values. So I need to count the policy numbers in duplicate file. Please help me with this.


Can you provide some sample excel file then it will be helps


I assume that both files have a column for the Policy Number?

You can try reading both files and then iterating through them. Please see the below pseudo as an example:

For Each OuterRow in Table1: // This would be your file of unique ones
	For Each InnerRow in Table2: // This would be your file of duplicates
		If OuterRow("Policy Number").ToString = InnerRow("Policy Number").ToString:
				MatchingCount = MatchingCount +1 // This is your integer for counting duplicates
				Do Nothing

Corp_Filter.xlsx (227.8 KB)
Sheet Output has Policy No and the same within Sheet1. Calculate the count of that policy numbers


can you explain more what you want

dt1.AsEnumerable.Select(Function(x) x(“POLICYNO”).ToString).ToArray.count

dt2.AsEnumerable.Select(Function(x) x(“POLICYNO”).ToString).ToArray.count

gives you the count



Please find the below xaml (259.5 KB)

Hope this helps!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.