Is there any way to put values only in Excel columns that meet certain criteria?

If the value in the “signal” section is “B”, is there any way to put a “0” in the “flg” section?
As a side note, this number part is unique.

【Situation before processing】

【Situation after processing】

Hi @Kirigirisu_Coin

  • Read the excel and store it in dt_Variable. You can use excel scope activity this will help to read and write data.
  • Use For each row activity to loop the dt_Variable
  • Check the condition using If row("signal").ToString = "B"
  • Assign row("flg") = "0"
  • Use Write range activity to dt_Variable into the same file
1 Like

Hi @Kirigirisu_Coin

From the above method you need to slight adjust the if condition.

If Currentrow(“Signal”).toString.Equals(“B”)

Then Assign Currentrow(“flag”)=“0”


1 Like

Depending on your method of updating your excel:
Alternatively, you can pre-set the entire ‘flg’-column using a formula instead of a value.
=IF(A2="B","0","") which pretty much applies the same effect as above.
where of course you increment the formula for each row in your excel.

You can prefill your excel template with the formula
You can enter the formula using write cell as well.
I’m not sure if it is convenient to do if you write or append an entire range at once, you might want to stick to the previous posted methods.

Excel itself comes with a wide variety of logical solutions :slight_smile:

1 Like

Thank you very much
I did write value to the excel.

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