I want to compare 2 columns and color code it

Here, I want to column compare columns and color code green if matches or red if it doesnt match.

for eg
A B C

Here I want to compare Column B& c

1 Like

@Bhushan_Nagaonkar

  1. For each row in excel
  2. if condition currentRow.ByField("B").value.Equals(currentRow.ByField("C").value)
  3. Then side use Format cell and Green, and else side red…for cell value use currentRow.ByField("B/C which ever is needed")

cheers

1 Like

What is ByField? Im not getting an option. Im getting Field(OF…)

@Bhushan_Nagaonkar

Are you using for each row in excel?

I guess youa re using datatable…if yes then you wont get…you need to go with direct currentrow("ColumNmae").ToString

and for row index use the index property in for loop

cheers

Can you share a flow if possible.
Thanks
MicrosoftTeams-image (132)

Hi @Bhushan_Nagaonkar

No need to use the Read range activity and all.
=> Take the Use excel file activity and pass the excel file path.
=> Inside Use excel file activity insert the For each excel row activity. Output - CurrentRow
=> Inside For each Insert the If condition give the below condition

CurrentRow.ByField("B").Equals(CurrentRow.ByField("C").ToString)

=> In then and else give the format cells activity and give the CurrentRow in the Range.
→ In then block give the fill color as Green in the format cells activity.
→ In the else block give the fill color as red in the format cells activity.

Check the below workflow.

Hope it helps!!

@Bhushan_Nagaonkar

Check this.>Sequence 1

BlankProcess - Copy.zip (7.3 KB)

cheers

Thankyou both @Anil_G @mkankatala

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.