GetFormulaNumberValue and CalculatedValue Not Working

Hello!  Please advise... The following code:

if (formula != null)
{
    worksheet.Unprotect("2424");
    worksheet.EnableSheetCalculations();
    Console.WriteLine("formula:{0} GetFormulaNumberValue:{1} CalculatedValue:{2}",
        worksheet.GetFormula(row, colIndex, false),
        worksheet.GetFormulaNumberValue(row, colIndex),
        worksheet.Range[row, colIndex].CalculatedValue);
    worksheet.DisableSheetCalculations();
}
Yields this output: formula:=SUM(D8-F8) + G8  GetFormulaNumberValue:0  CalculatedValue:#NAME?

The actual value (in the Excel sheet) = 11, as per: D8=12, F8=1 and G8=0

Thank You!


3 Replies

MA MohamedyusufKhan AhamedMusthafa Syncfusion Team September 8, 2023 07:52 AM UTC

Hi Michael,

 

 

We suspect that the #NAME? error occurs due to the incorrect calculation in the dependent cells of the SUM formula. We request you to share the input Excel document, to validate further and provide you a solution at the earliest.

 

Regards,

Mohamed Yusuf Khan.



MT Michael Tigar September 8, 2023 09:02 AM UTC

Hi Mohamed,


I thought you might need the Excel document, which you should now find attached to this message.

Please note: the row value is set by for (int row = 8; row <= 12; row++) { .. } and colIndex = 4​ when (formula != null)


Many Thanks for looking into this!


Attachment: JULY_2023Weekly_Metrics_Tracking_Sheet__070723_TO_071323__ForSyncfusion_172e6c2f.zip


KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team September 14, 2023 12:54 PM UTC

Hi Michael,


We are unable to reproduce the reported issue with the shared excel document. The sample tried at our end is attached for your reference.


Kindly modify and share us an issue reproducing sample and confirm the Syncfusion XlsIO version you are using at your end, which will be helpful for us in investigating the query.


Regards,

Keerthi.


Attachment: F184477_Blazor_23694940.zip

Loader.
Up arrow icon