Column comparision

Open the excel Add a column Result in column 3. If Column 1 > Column 2, substract, else multiply them and enter the result into result column and save it as output spreadsheet. could you anyone help for me to design a flow


  1. Use Build Datatable activity to create one Datatable and those columns and also add extra column for writing status and say ‘templateDT’.

  2. And then use Read Range activity to read the data from Excel file and will give you output as Datatable and say ‘DT’.

  3. And then use For Each Row activity to iterate that Datatable.

                      ForEach row in DT
                         If Cint(row("Column1").ToString) > Cint(row("Column2").ToString)
                         Then row("Column3")  = 
               Cint(row("Column1").ToString) - 
                          Else row("Column3")  = 
                         Cint(row("Column1").ToString) *
  4. Then use Merge Datatable activity and specify Source as DT and Destination as templateDT.

  5. Finally use Write Range activity to write into excel file.


Hello @lakshman im getting on error please look into the attachmentSequence.xaml (5.4 KB)

Hi @Shriharsha_H_N

Please add Build datatable and Read Range Activity before For Each Row Activity.
And Also I can’t See any Variable in your workflow,so,make sure that the variable is created.


Main.xaml (3.1 KB)

in this i have created a read range activity and variables please check and help to solve the exception

Can You Please Recheck And Rsend The .xaml File bcoz nothing is available inside this.

@omprasadMain.xaml (7.5 KB) Please check now