How to Apply complex formulas in excel using uipath

Hi , I have to apply a complex formula in my Uipath script for excel

=IFERROR(DATE([@[Attended From Year]],MONTH(DATEVALUE(P2&" 1")),1),"")

Can some one help me how can I achieve this ?

@AshLearnUI

You have to use Write Cell activity and pass this formulae in double quotes into value field. Make sure that formulae should be correct.

did WRITE CELL activity inside the FOR EACH ROW loop helped us on this
like
–once after getting the datatable named dt from excel with read range pass that variable to FOR EACH ROW as input
–and inside the loop use WRITE CELL activity with this formula as input string between double quotes and in the range mention as (if going to place this formula in C column) then
"C"+(dt.Rows.IndexOf(row)+2).ToString

so that it will enter in all rows of that column C
Cheers @AshLearnUI

@Palaniyappan yes , I have already tried that way . But its not working in uipath . Formula works perfectly fine when I try it manually .

This is exactly how I tried.

  1. Inside the excel application scope add the read range activity with sheet name and data table as output
  2. added for each activity
    3.Added write cell inside for each loop. sheet name and range (here added the column in which I want to apply the formula)and in input tab in double quotes copy pasted the above formula.

keep this as input in the write cell activity
β€œ=IFERROR(DATE([@[Attended From Year]],MONTH(DATEVALUE(P2&” + β€œβ€β€œ1"”" + β€œ)),1),” + β€œβ€"""" +")"

that is surround double quotes with two double quotes on either side

Cheers @AshLearnUI

Thank you @Palaniyappan can you tell me why we should surround double quotes with another set of double quotes and also β€˜+’

1 Like

Fine
double quotes if we want that to be included in our string output then we need to surround them with double quotes
and here we have used + to separate the strings in the formula and then concatenating them
hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @AshLearnUI

2 Likes

ah… got it . we chopping the whole formula as string and passing it

1 Like

exactly
Cheers @AshLearnUI

1 Like