Compare cell A of column1 with all cells of Column2

Compare cell A of column1 ( sheet1)with all cells of Column2 of sheet2
If matches: copy values of column 2&3 of sheet 1 and paste it in column 2&3 of sheet3.
If does not match: Copy the whole row from sheet 1 and paste it in sheet 4.

@ayushi_jain3
example of how you can implement this workflow in UiPath:

  1. Drag an Excel application scope activity to the workflow and specify the file path of your Excel workbook.
  2. Within the Excel application scope, add a Read Range activity to read the data from Sheet1 (column 1) and store it in a DataTable variable, let’s call it dtSheet1.
  3. Add another Read Range activity to read the data from Sheet2 (column 2) and store it in another DataTable variable, let’s call it dtSheet2.
  4. Use a For Each Row activity to iterate through each row in dtSheet1.
  5. Inside the For Each Row loop, add an If activity to check if the value in cell A (column 1) matches any value in column 2 of dtSheet2.
  6. If there is a match, use the Write Cell activity to copy the values of column 2 and column 3 from dtSheet1 and paste them into column 2 and column 3 of Sheet3.
  7. If there is no match, use the Append Range activity to copy the entire row from dtSheet1 and paste it into Sheet4.
  8. After the For Each Row loop ends, close the Excel application scope.

Thanks @raja.arslankhan for this detailed description:
One doubt: In step 5, " 1. Inside the For Each Row loop, add an If activity to check if the value in cell A (column 1) matches any value in column 2 of dtSheet2." Could you please let me know how to match those two values in UiPath. It would be great if I can have the xaml for the whole process. Thanks in advance:)

@ayushi_jain3
I can give you only example but not able to make whole code.

So, after this condition in write cell activity what function should I use to get the exact matching cell values in step 6 so that I can copy those two cells and paste it in sheet 4?

@ayushi_jain3
In then block put Write Cell Activity and pass desire values

The values here are dynamic. If the value from Column A(sheet1) matches with ay values in clumnA(sheet2), only then I have to take corresponding values from Column 2&3, from same row whose value matched, How do I get those values is my question… :slight_smile: