How to compare two column A and Column B and update the match status in Column C in excel

How to compare two column A and Column B and update the match status in Column C in excel.

I have excel 45k line items… updating status using write cell inside for each takes tooo long to update the status

kindly help me to solve his issue @Palaniyappan

1 Like

Hi @Ranganathan_M,
You can follow the steps below:

  1. Read range the data to extract into data table.

  2. Use a multiple assign where you can use LINQ Query to compare Column A and Column B where it will be the fastest way to manipulate data

  3. In the first conditional you can make the comparison according to the Column A and Column B and in the last line you can put the columns of the data table.

    (From x In DT_Aux
    Let status = If ( x.item(0).tostring = x.item(1).tostring,
    “Match Found”,
    “Match Not Found”)
    Select dt1.Rows.Add(New Object(){x.item(0).tostring, x.item(1).tostring, status.ToString})).copytodatatable

Have a great day!
Please let me know if you need anything else.


You can follow these steps…

  1. Use read range to read the data from excel…
  2. Use build datatable activity and build a table with one column and type as string
  3. Use a assign activity newDt = dt.AsEnumerable.Select(function(x) If(x(0).ToString.Equals(x(1).Tostring),"Matched","Not Matched")).CopyToDataTable
  4. Now use write range and write the newdt to column by giving range as C2 and make sure to remove headers check box

Assuming there are only two columns…if more then change the column index and cell values accordingly


Hi All,

In UI Path How to Compare the Expected value and Actual Value and Update the status?