How to automatic set formula and calculate

hey guys, i have this problem where i want to make uipath automatically calculate the average which is (TTS) + (TTB) / 2. how can i do it?

at row 33 and 34, i managed to make automation which i retrieve data from other excel workbook and insert them in TTS and TTB column. for average column, how can i make it automatically set for new incoming data.(NMM) DATA SHEET_EXCHANGE RATE_NMM_V0.02.xlsx (607.3 KB)

This is my related files. Basically, NMM excel will get the data from currencyMay first. after finishing filled in, automatically jump to next row for data from currencyJune to be filled. but how to make the average column to be automatically calculate too? currencyJune.xlsx (9.9 KB) currencyMay.xlsx (9.8 KB) Main.xaml (29.7 KB)

If you use Excel Application Scope activities, you can set a formula in cells of workbooks. So if you need these to automatically update based on references to Excel files, you can insert the average function into an Excel workbook.

can you explain it more detail or do you have example?

So if you use the Excel Application Scope activity to open a workbook, you can put a Write Cell activity inside to write anything to that cell. If you write a formula (for instance =AVERAGE(A2,B2)) ,it will write the formula to the cell and the data in the workbook will reflect the result of the formula rather than the formula itself.

actually, i want the formula to be automatically generated WHEN the data are filled in.

For that, you will either need to write an Excel VBA macro and run it or fill all cells which could be next to the data with a formula. The former runs more quickly, while the latter is easier to write, but could cause your workbook to increase in size by a lot and open more slowly.