I’m trying to count the instances of a keyword in a column, but there are different datatypes inherited when I import the data table from Excel.
ColA | ColB |
---|---|
1 | Keyword |
2 | Keyword |
3 | 10/05/2020 |
4 | Keyword |
5 | 12345 |
6 | -123.45 |
In the column, there are strings, dates, doubles, ints, etc. I need to count the occurrences of the Keyword through a formula that can handle these other data types.
I’ve tried the following and the other datatypes are causing issues.
dt.AsEnumerable().Count(Function(row) row.Field(Of String)(“ColB”).ToString.Equals(Keyword))
dt_tempFiltered.Select(“[ColB] = ‘Keyword’”).Count