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

Here I want to compare Column B& c

1 Like


  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")


1 Like

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


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


Can you share a flow if possible.
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


=> 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!!


Check this.>Sequence 1

BlankProcess - Copy.zip (7.3 KB)


Thankyou both @Anil_G @mkankatala


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