Datatable - excel - formula

Hi all,

I have an excel file (I simplified a bit but see screenshot):

I am looking for the code that does the following:

  • For the ones where ‘topic’ is empty in the datatable
  • Write the formula for count if (i have this formula already)
  • re-write the complete datatable to excel, not only the ones for which the bot did the count if.


In write cell, you can just need to write the formula. Please check the below post.

  1. Use Build Data table and Have your columns:
  2. Use Excel scope application.-> read range and read your existing file.
  3. use for each row and inside for each have if condition with condition as not(row.item(“Topic”).ToString.length>0)
  4. use add data row and use the above mentioned way to write formula to cell and pass other variable values.
    in else just add row(input row).
  5. outside of your for each row use excel application scope and use write range.