Trying to Compare two Excel sheet values to check if any difference and print those difference in other workbook

I’m trying to compare the values present in the two sheets where both the sheets present in a different workbook if there is any difference then paste that values in the third workbook.

I tried this way but it is not doing the work as expected, instead of pasting only difference values it is pasting all and same values for a number of times.

Hi @LathaBasavaraju,

Have you tried the solution mentioned here - How to compare two excel sheets values?

1 Like

Hi @iostapuk,
that won’t work, sheets which I’m trying compare have large data, so comparing cell by cell wont work,I’m trying to compare row by row in both the sheets.

As you can see in the image, i used for each loop to go through all the rows in both the sheets, but as a result I’m not getting only unmatched rows but also other is because the bot is taking first row of the first sheet and comparing with all the rows in second sheet, so obviously i get all the rows from second sheet in the output file .
I want compare first row of the first sheet with the first row of the second sheet, if any difference in data, it should copy that row to the third sheet, same thing should repeat for all the rows in both the sheet, it should compare each rows with each other.

if this is not possible in direct drag and drop activity, is it possible to help with Groovy scripting

Hi again @LathaBasavaraju,

Please check this custom script, it may help.

1 Like

How to compare rows of two table variables one by one, if matches do nothing otherwise write the mismatched row to another table variable?

@Aanchal27 see the solution in the post above