Hi, as shown in the Excel file. I need to know which country has the most occurrences in “Country” column as I need to find out which country has the most players represented. I also need to show my output using “Message Box” as requested.
E.g. The message box will show
The country that has the most players is Argentina.
Hi @rubyyy
Read the excel and use this code
dt.AsEnumerable.GroupBy(Function(r) r(“ColumnName”).ToString).OrderBy(Function(g) g.Count).Last().First().Item(“ColumnName”).ToString
COUNT – To count the number of cells that have numbers in it.
COUNTA – To count the number of cells that are not empty.
COUNTBLANK – To count blank cells.
COUNTIF/COUNTIFS – To count cells when the specified criteria are met.
Hi @sangeethaneelavannan1
Thanks for your reply, as I just started to use UiPath
May I know where should I apply this code at? Or Should I use it at which component?
@rubyyy
Read range workbook activity -To read the excel data and convert it to datatable
Using Assign activity output dt=the above code
Using write range workbook activity to write it in excel
Also in your workflow why you have used the for loop?
If you are using this expression, then you can delete that part. After extracting the data from webpage, you that datatable variable directly in the expression.