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. Image for the cookie policy date
close icon

problem with cell formulas

In the attached example, defining a named range where the value is specified to be an equation like "=sum(d5:f5)" doesn't seem to work. When the defined named range is referred to elsewhere, it seems to return 0. However, if the cell if refered to directly (as opposed to refering to it by the defined name), it appears to return the correct value. Is there a way to use the defined name instead of the explicit cell reference?




WindowsFormsApplication1_e1103eb1.zip

9 Replies

NR Nirmal Raja Syncfusion Team June 14, 2010 05:43 AM UTC

Hi Jan,

Thank you for your interest in Syncfusion products.

The named range will add the value what ever the second parameter provides. As analyzed in the example, the text of the cell is moved as the value for the named range collection, the text will contains only the formula and when it is specified in the second grid, the formula will be applied to the grid and the d5 and f5 values will be retrieved from the current grid which is empty. This is the reason for the value returned as zero. If you need to add the value to the named range instead of the formula, then try to add through the FormattedText property which returns the calculated value instead of formula.

Please refer the modified sample attached below:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=WindowsFormsApplication1-1186291608.zip

Let me know if you have any queries.

Regards,
Nirmal


AD Administrator Syncfusion Team June 14, 2010 11:53 AM UTC

Why do I seem to find it necessary to use something like "=+foobar" instead of simply "=foobar" when referencing named ranges which are defined as combinations of other named ranges? (see attached example)



WindowsFormsApplication1 - Copy_c2f44f08.zip


JJ Jisha Joy Syncfusion Team June 16, 2010 01:39 PM UTC

Hi Jan,

You could refer the following sample from the sample browser illustrates the use of multiple sheet references and named ranges along with the GridFormulaEngine.

C:\Syncfusion\[Version]\Windows\Grid.Windows\Samples\2.0\Formula Support\Named Range For Formula Demo\cs

Please have a look at it for the proper usage of named ranges and let me know if this helps.

Regards,
Jisha


AD Administrator Syncfusion Team June 16, 2010 07:23 PM UTC

I took a look at the recommended sample but did not find anything that explained the problem. If you could provide a bit more information as to why it is happening, that would help.

v/r
Jan


JJ Jisha Joy Syncfusion Team June 23, 2010 11:45 AM UTC

Hi Jan,

I have tested the issue in the following sample. But I am afraid I was not able to see the issue. We could refer the named ranges with "=" sign without any problem. See the sample attached.

Regards,
Jisha



NameSample_2158438c.zip


AD Administrator Syncfusion Team June 25, 2010 03:50 PM UTC

Have you tried modifying the sample that I provided to see if you get the same results?


JJ Jisha Joy Syncfusion Team June 29, 2010 07:09 AM UTC

Hi Jan,

Thank you for your update.

You need to use "=foo + bar" instead of "foo + bar" while setting value to the named ranges when it is defined as combinations of other named ranges

grid1[4, 2].Text = "=foo + bar";

Modified sample attached.


Please let me know if this helps.

Regards,
Jisha



WindowsFormsApplication1_a5992cf5.zip


AD Administrator Syncfusion Team June 29, 2010 01:23 PM UTC

Thank you. I see what I was doing wrong.


JJ Jisha Joy Syncfusion Team June 30, 2010 04:13 AM UTC

Hi Jan,

Thank you for your update.

Thanks,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon