Compare 2 excel files

I have two excel files attached screenshot for your reference:
excel1
excel2

When comparing above 2 excel sheets I need output like
output

Hi @gokulvasant ,

Could you let us know why the Output contains only details upto F5 ? What is the logic used for the comparison ?

Hello @gokulvasant
Try this

  1. Read the status Code Excel file using the Read workbook range and store it as a DT_StatusCode.
  2. Read the Input excel and save it as a Dt_input
  3. Use Build data table and create Column Name and save variable as a DT_Build
  4. Use For each loop datable using the DT_input
    4.1 Use Lookup Datatable and properties, in the target column type the Reason column name. The output will get from the Cell value and saved as Lookup_status
    4.2 Use Add data row and pass the value like {CurrentRow(Code).tostring+" - "+Lookup_Status} and input as a DT_Build
  5. Later write the data into Excel sheet using write range

Hi @gokulvasant

Should your output be a datatable containing all the output values next to your first shown Excel File?

Helpful for you is to use the “Lookup Data Table” Activity to get the Reason from your second Datatable - search for the current code in column ‘Status Code’ and get the CellValue of column ‘Reason’ as your Output, i.e. as the Variable ‘str_Reason’).

After this, add an Assign Activity to concatenate your Code with the Reason:
str_Result = str_Code + " - " + str_Reason

Then, depending on your desired result, you could either print this value or assign your Row-Item accordingly (i.e. when looping through all values - For Each Row - in the first Excel/DataTable).

Best regards
Roman