Count strings in Excel

Hello!

I have 2 datatables containing names that needs to be looked up. 1 Excel file containing around 250 unique names, and another Excel file containing around 20,000 names, where there are duplicates.
What I want to know is if there is a way to use a for each row in the first excel file with 250 names, and go through each name and see if there are any duplicates in the second Excel file and how many. If there are, write the name and amount of strings are in that Excel file, in a separate file.
I feel like this should be doable with LookUp range and an If statement but I am not sure how to make everything work together.
Appreciate all the help so I can learn!

Example, both dtTable1 and dtTable2 have “Name” column
dtTable1 has “Count” column to check duplicate times

For each row in dtTable1
intCount = dtTable2.Select(“Name = '” + row(“Name”).ToString + “’”).Count
row(“Count”) = intCount

1 Like

Thank you for the quick response.

Sorry if I sound stupid, but where and how should I make use of your solution? In an assign activity? If statement? Is there no Lookup range required?

Really appreciate your help but at the same time I am trying to understand what is going on haha

This might help!

1 Like

Thank you! I will look into it and see if I get any smarter!

1 Like