Column comparision in excel

i need to compare these 2 column as they are having same data in both the columns,but it hits error where in the screenshot in insert function column ,where data is in 2 lines,kindly please help me in this.

1 Like

@priyankavivek What error you are facing

its not matching but the datas are same

1 Like

@priyankavivek Can you share how you are checking the condition.

just if condition
row(0).to string = row(1).to string
then
matched
else unmatched

are you passing this inside a for each?

Can you try using row(“column 1”).tostring.equals(row(“column2”).tostring)

or
row(“column 1”).tostring = row(“column2”).tostring

yes i have tried this can you please check on the function tab

@priyankavivek Try with this condition row(0).ToString.Trim = row(1).ToString.Trim and let me know.

1 Like

just a string

then this will definitely help:

1 Like

ok i will try

2 Likes

no its not working

@priyankavivek Can you share the excel file.

you cant directly access row without having a foreach for the data table. Its not accessible.

InvoiceExtraction 09_24_2019.xlsx (8.1 KB)

@priyankavivek There was a new line in the cell so it was not matching.After removing it works for me.

@Palaniyappan
yes i need to remove that newline and make themself as a single line is it possible?

you need to get that value from the excel, then split it based on the new line and store in the array. Then using the array, loop through the values and append the values as variable1 + " " + variable2

@priyankavivek

Instead of this, you can change the equals operator to contains which will check the value

1 Like

Compare.zip (8.0 KB)

New line is removed using function and assigned to “var1” then compared using for each. Its working fine.

1 Like