Write Excel formula into cell uipath

Hello Everyone,

I need help writing excel formula to write cell activity.
When I want to write the Excel formula as text, I get an error like this.
Can you help me please?

Hi @korhansuren
Welcome to UiPath Community :slight_smile:

You can watch this video. It could help you.

I think your formula is not correct. You have two )) but you only need one.

Best regards
Mahmoud

1 Like

I watched this but it didn’t help me. The problem I’m having is in formulas written with words. I don’t have a problem with simple formulas like =a2+b2. vlookup, sum etc. When I write formulas with words, I get an error like this.

Can you please share your excel file?

Hi,

the error message says “use commas as parameters separator”.
You used semicolons. Try using commas instead.

IMBook1.xlsx (11.0 KB)
here.

I’m in Turkey. Excel format automatically writes the formula in this way due to region and language settings. When I write the same formula in excel, it works fine.
image

It works for me:

“=VLOOKUP(E2,Supersmart!A:A,1,0)”

image

But your formula is not correct. There are only #N/A values.

because I only sent you a few lines of data. The actual file is 500k lines.

By the way, when I try the formula you gave, I get an error like this. I guess it’s because of the region/language settings.

image

Can you please try this in your Write Cell activity:

“=VLOOKUP(E2;Supersmart!A:A;1;0)”

When i try, get the error :frowning:

I don’t know why it doesn’t work for you.
Check the properties of the activity Excel Scope Application.
I have these:

image

options is same for my side.
me too, i don’t know.

Hi! @korhansuren,

Do one thing pass it through a variable. try this once.

Thankls&Regards
NaNi

You can also do it with Invoke Code. It is better and faster. See attached file:
Sequence35.xaml (5.4 KB)

You need to import this package to your UiPath Studio:
Microsoft.Office.Interop.Excel

Dim xlApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application

Try
Dim xlWorkbook As Microsoft.Office.Interop.Excel.Workbook = xlApp.Workbooks.Open(Path)

'Define Excel Sheet
Dim xlWorksheet As Microsoft.Office.Interop.Excel.Worksheet

xlWorksheet = CType(xlWorkbook.Sheets(“Data”), Microsoft.Office.Interop.Excel.Worksheet)

'Activate Worksheet Data
xlWorksheet.Activate()

'Write Formula in Cells: F2 to F30
xlWorksheet.Range(“F2:F30”).Formula=“=VLOOKUP(E2,Supersmart!A:A,1,0)”

'Save Workbook
xlWorkbook.Save

'Close Workbook
xlWorkbook.Close

Catch ex As Exception
Throw ex
Finally
'Close Excel Application
xlApp.Quit
End Try

1 Like

Hello Korhan,
Here I have multiple ways how to do VLOOKUP (including multiple files):

Thanks,
Cristian

1 Like

Even when the parameters separator is semicolon (or something else) in Excel, you need to use comma in UiPath when writing formulas to Excel. Once the formula is written to Excel, it automatically changes to correct separator (from comma to semicolon in this case).

1 Like

Very helpful, thank you.

You should use , instead of ; in the formula.
=VLOOKUP(E2,Supersmart!A:A,1,0)