!Please Advice ! How to compare (to find similarties and differences) in two different rows in two different excel files

Hi ,

Unfortently m this is the third time that I post and I get no answer , Can someone please advice me on a how a workflow would look like . I have two excel files that I want to compare one row from the first excel file with the same row but in the other excel file (to find similarties and differences) and give message box for both?? How a workflow would look like?
I found how to compare two different sheets in one excel file but this is different because its two different excel files .

please Advice !!

@Assem_Samali If u know how to compare 2 sheet of same excel. Likewise create datatable for each excel follow the same procedure

I’m sorry I don’t understand how would that help, can you please clarify
(do you mean to build a data table)?

I have found how to compare two sheets as a workflow but still gives error , so basically I’m not sure.

In comparing two sheets in the same excel file I only i start by reading range for the first sheet and then another time also reading range for the second sheet Then Assign for dt1 and dt2 - follows by if condition but - I want it to be like, the robot opens the two excel files not sheets in the same file and read a specfic row and find if its similar or fales…

so Im not sure how a workflow would look like .

@Assem_Samali use one excel application scope for each workbook and read the data using read range activity inside excel application scope. Assign output to datatable variables

Unfortunately, I ve been getting errors in my logic - to be honest I dun know if my workflow is correct or not … after I excel application and readrange , I assign a decsion for comparison and then an assign but I always get an error.

@Assem_Samali can u share workflow and description about ur task?

So basically the task is that I have two excel files , an (original) excel file that contains data and another excel file that is (extracted) - so after the extracted excel file is saved ,

I want the robot to compare the results row which is called in both excel files , so the robot compare
( 209999 Other CoS ) in extracted file with the Original excel file in the row of (209999 Other CoS) - there are about 3 entries in the row (209999 Other CoS) -

I want the robot to color the entries in green in the extracted file for the ones that are same (have the same entries as the original excel file) and IF the number entry in the extracted file is differnet then to color it in yellow - and Message box smth like "please check the forumla "

I attached the workflow and the excel files Extracted data from BO design.xlsx (8.9 KB)
OriginalFile .xlsx (13.8 KB)

Compare2Excelisa.xaml (24.6 KB)

I hope this was clear about the task


@Assem_Samali Check the workflow and excel file for output.

FOL.zip (21.3 KB)

It does not gives an error ,

However although the numbers in both cells are the same . it only color it in a yellow not in green which is the according to the workflow the set Range color (yelllow) will be implemented if the numbers are different- but the numbers are the same and it color it in yellow.

@Assem_Samali I think both values in 2 excel are different print the values and check what values is 2 excel files

The point is that Whenever i change the values in the excel file , either i make the values the same or different , it only color them in yellow , I think the logic in the If condition is missing something because it does not do the step so i think it is not correct logic . However thank you for the workflow - i have a general idea now

@Assem_Samali many differences in 2 Excel files, one excel file has dot other excel file comma hence they cannot be equal like that some other differences are there even space matters. That’s y i asked you to print values from both Excel files and notice the difference and change the things in if condition according to it.


yes you were right , I have changed the format in the excel and it worked, thanks.

I wanted to ask you , I see that you have other variables such as

dtCompareData - Datatable variable
dtResult - generic value variable
dtdifference - datatable variable
dtsimalarties- generic value variable
query- generic value variable

I have checked the workflow but I can’t see them in any output or assigned to any step in the workflow- Can you please tell me where did you assigned them and if you didn’t then why did you created them if they are not used in a workflow step?

much appreciation


@Assem_Samali i didn’t create them, U are the one who created them.