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

Get value from formula

Thread ID:





130484 May 15,2017 03:50 PM UTC May 18,2017 09:47 AM UTC JavaScript 3
Tags: ejSpreadSheet
Bruno Figueiredo
Asked On May 15, 2017 03:50 PM UTC

Sorry but i didnt find this anywere, so I need to ask you what I need to do to retreave the result of a formula via Javascript.

 var obj = $("#Spreadsheet").ejSpreadsheet('instance');
  obj.XLEdit.getPropertyValue(6,4); // returns "=SUM(E5:E6)"
obj.getCell(6,4); // return the cell html element

But I need the actual value of the E5 + E6

Please give me the answer.
Best Regards

Shanmugaraja K [Syncfusion]
Replied On May 16, 2017 07:01 AM UTC

Hi Bruno, 
Thanks for using Syncfusion products. 
We would like to let you know that we suggest you to use pass “value2” or "calcValue" to getPropertyValue method to get the result of the formula. Please refer the below code example, 
       $(function () { 
                // Rendering Spreadsheet 
        function Result() { 
            var xlObj = $('#Spreadsheet').ejSpreadsheet('instance'); 
            // B2 cell has formula =CONCATENATE("one","big") and result is "onebig". 
            alert("The Formula " + xlObj.XLEdit.getPropertyValue(1, 1, "value") + " result is: " + xlObj.XLEdit.getPropertyValue(1, 1, "value2")); 
        <input type="button" value="Formula Result" onclick="Result()" /> 
        <div id="Spreadsheet"></div> 
Please refer the below documentation and JSPlayground link, 
Shanmugaraja K 

Bruno Figueiredo
Replied On May 16, 2017 10:37 AM UTC

Well I totaly missed that.
Problem solved.

But allow me to sugest something,
I think you should simplify your function names. like:
XLEdit.getCellValue(x,y) and getFormulaValue(x,y) or getCellCalcValue(x,y)

Or something else, I don't know, but be more intuitive.

Thank You,
and thank you again for the fast reply

Shanmugaraja K [Syncfusion]
Replied On May 18, 2017 09:47 AM UTC

Hi Bruno, 
Thanks for your suggestion, we have an option to get the formula cell value. If we add the separate methods like getting cell value and getting formula cell value, it may increase the size of the source. Since, we have lot of methods in our ejSpreadsheet control.  
Shanmugaraja K 


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

This page will automatically be redirected to the 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