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.
Unfortunately, activation email could not send to your email. Please try again.

How to create excel formula

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,
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 09:00 AM

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. 
  
Regards, 
Abirami. 


Sharad Kumar
Replied On September 15, 2016 10:51 PM

Hi,

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.

Thanks

Attachment: 6paretoanalysischartexceltemplate_c0b31990.rar

Abirami Varadharajan [Syncfusion]
Replied On September 19, 2016 08:20 AM

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. 
  
Regards, 
Abirami. 


CONFIRMATION

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.

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.

;