# How te create a formula inside field to be written to excel

**URL:** <https://community.automationedge.com/t/how-te-create-a-formula-inside-field-to-be-written-to-excel/1599>\
**Category:** Self-Help & Learn\
**Tags:** rpa\
**Created:** [January 13, 2020, 2:51am UTC](https://community.automationedge.com/t/how-te-create-a-formula-inside-field-to-be-written-to-excel/1599 "2020-01-13T02:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wllmdjngh](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/wllmdjngh/32/952_2.png) [@wllmdjngh](https://community.automationedge.com/u/wllmdjngh)\
**Post date:** [January 13, 2020, 2:51am UTC](https://community.automationedge.com/t/how-te-create-a-formula-inside-field-to-be-written-to-excel/1599/1 "2020-01-13T02:51:13Z")

</div>

Hi,  
Documentation specifies that a field can contain formula: I would like to recreate the following =if((Var1_Var2_Var3)\<100,’[File.xlsx]Sheet1’!$C$27,“Not OK”)

Excel uses Cell references A3, B4, C5, etc. can you tell me how to create an equivalance?  
Thank you.

---

<div class="post-metadata">

**Author:** ![BhagyashriC](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@BhagyashriC](https://community.automationedge.com/u/BhagyashriC)\
**Post date:** [March 18, 2020, 9:20am UTC](https://community.automationedge.com/t/how-te-create-a-formula-inside-field-to-be-written-to-excel/1599/2 "2020-03-18T09:20:04Z")

</div>

You have to write VB script for that otherwise, First read the file and using values from that cells use formula or calculator plugin to get output field.

---

<div class="post-metadata">

**Author:** ![wllmdjngh](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/wllmdjngh/32/952_2.png) [@wllmdjngh](https://community.automationedge.com/u/wllmdjngh)\
**Post date:** [March 18, 2020, 1:50pm UTC](https://community.automationedge.com/t/how-te-create-a-formula-inside-field-to-be-written-to-excel/1599/3 "2020-03-18T13:50:55Z")

</div>

Thanks BhagyashriC.

After doing some research, there are some powerfull features within Excel and the issue is that 80%+ of the times we use Excel, 20%- of it’s features.  
I got to manage relative positions like the following Javascript instruction:  
var Formula = “SUM((CELL(“contents”,INDIRECT(ADDRESS(ROW()+1,COLUMN()))))+(CELL(“contents”,INDIRECT(ADDRESS(ROW()+2,COLUMN())))))”;  
and then write this field specifying it is a formula in the Excel Write.
