We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create excel formula

Thread ID:





125948 Sep 14,2016 04:22 AM UTC Sep 19,2016 12:20 PM UTC UWP 3
Tags: XlsIO
Sharad Kumar
Asked On September 14, 2016 04:22 AM UTC

I am try to create excel formula.
I am using following code.

ExcelEngine oengine = new ExcelEngine();
IApplication oApp = oengine.Excel;
oApp.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook oWorkbook  =  oApp.Workbooks.Create(1);
IWorksheets osheets = oWorkbook.Worksheets;
IWorksheet  osheet = osheets .Worksheets[0];

IRange oRange = osheet .Range["A2:A25"];
oRange.FormulaR1C1 = "R[-1]C+1";

IRange oRange = osheet .Range["L4"];
oRange.FormulaR1C1 = "R[-1]C+1";

A2 to A25 cell value is right but L4 to L13 cell show null value using this method.

How to create shared formula from A2 to A25 cell range and L4 to L13 cell range with single Technique.
Excel file is attach with mail.

Attachment: normaldatacheck_608d184e.rar

Abirami Varadharajan [Syncfusion]
Replied On September 15, 2016 01:00 PM UTC

Hi Sharad, 
Thank you for contacting Syncfusion support. 
We are unable to reproduce the issue and we have prepared a sample to achieve the shared formula for the ranges A2:A25 and L4:L13, which can be downloaded from following location. 
Kindly refer and let us know if it satisfies your requirement. 

Sharad Kumar
Replied On September 16, 2016 02:51 AM UTC


Thanks you your replay.
In this file , Cell range L4 to L13 have a formula.
formula value is  = "=IF(K4="","",K4/SUM($K$4:$K$1048576)+L3)"
In given your example formula value is not define .
Orignal Excel file is attach with mail.


Attachment: 6paretoanalysischartexceltemplate_c0b31990.rar

Abirami Varadharajan [Syncfusion]
Replied On September 19, 2016 12:20 PM UTC

Hi Sharad, 
We suggest to set the shared formula to range L5:L13. The error value is shown in range L4:L13, since 1 is added to string value “Cumulative %”. Kindly refer below code snippet to achieve this. 
Code Snippet: 
IRange range = worksheet.Range["L5:L13"]; 
range.FormulaR1C1 = "R[-1]C+1"; 
We have also shared sample for your reference which can be downloaded from following location. 
Kindly refer and let us know if it your requirement is achieved. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon