Error during Write Cell Activity (Excel Formula)

Hi all,

I am trying to write an excel formula using write cell activity in UiPath (within Excel Scope Activity). However I am getting this error BC30198: ‘)’ expected
I tested my formula in Excel and it works.

My formula : “=IF(OR(LEFT(K2,2)=“EE”,LEFT(K2,2)=“EC”), “ECAP”, IF(OR(LEFT(K2,2)=“EV”, LEFT(K2,2)=“EW”), “EMCD”,”“))”

Hi @tanisha.rajah

Try this

“=IF(OR(LEFT(K2,2)=”“EE”“,LEFT(K2,2)=”“EC”“), ““ECAP””, IF(OR(LEFT(K2,2)=”“EV”“, LEFT(K2,2)=”“EW”“), ““EMCD””,”“”“))”

Hi @tanisha.rajah
Try by storing the formula in a string var and pass to writecell activity.
Var= “=IF(OR(LEFT(K2,2)=”“EE”“,LEFT(K2,2)=”“EC”“), ““ECAP””, IF(OR(LEFT(K2,2)=”“EV”“, LEFT(K2,2)=”“EW”“), ““EMCD””, “””“))”

Hope it helps!!

1 Like


one thing to remember is every double quote used in formula needs to be escaped by using another double quote

"=IF(OR(LEFT(K2,2)=""EE"",LEFT(K2,2)=""EC""), ""ECAP"", IF(OR(LEFT(K2,2)=""EV"", LEFT(K2,2)=""EW""), ""EMCD"",""""))"


1 Like

I still hit error requesting me to compile workflow when i tried this

This worked!thank you!

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