ClosedXML doesn't evaluate formulas with the Round() function.
PS: Is their a list of supported / not supported functions?
Greetings,
Raidri
Comments: ** Comment from web user: Raidri **
I have done some testing and have narrowed down the problem. Attached is the skeleton from my Excel file which calculates some values on sheet 2 and displays the result on sheet 1 (with a letter whose addresses I removed).
The result from sheet 2 (named "Anlage") is in cell C48.
On sheet 1 I have 3 cells which should show that result:
U27 (Formula: "=Anlage!C48")
U28 (Formula: "=ROUND(U27; 2)")
U29 (Formula: "=ROUND(Anlage!C48; 2)")
My program:
```
static void Main(string[] args)
{
XLWorkbook wb = new XLWorkbook(@"c:\temp\test3.xlsx");
IXLWorksheet ws1 = wb.Worksheet(1);
var value1 = ws1.Cell("U27").GetDouble();
var value2 = ws1.Cell("U28").GetDouble();
var value3 = ws1.Cell("U29").GetDouble();
}
```
VS2010 Debugger gives:
ws1.Cell("U27").Value 36718.308000000005 object {double}
ws1.Cell("U28").Value 0.0 object {double}
ws1.Cell("U29").Value 0.0 object {double}
Both formulas with "ROUND" do not give me the right results.
Could you take a look at this and explain it?
PS: I found out some other things before getting to the above step:
- ClosedXML does not like the Dollar sign in cell addresses (like A$10). This error gave the stack trace from my first comment.
- If a formula with a "SUM" includes empty cells, ClosedXML gives an exception, Excel itself treats them as zero and sums up the rest just fine. Could this be included in ClosedXML?