Hi,
I finding issues in inserting conditional formulas in closed xml.
For Example:
If I want to insert following formula into excel sheet
=IF(A1 > 0, Yes, No)
It appears as =IF(A1 > 0 ; Yes ; No) which is not supported in Microsoft Excel. It says formula is corrupt.
Can anyone help me??
Comments: Yes and No are invalid keywords. Put them in quotes. You did point me to a bug in the code so pick the latest source code. var wb = new XLWorkbook(); var ws = wb.AddWorksheet("Sheet"); ws.FirstCell().SetValue(1) .CellBelow().SetFormulaA1("IF(A1>0,Yes,No)") // Invalid .CellBelow().SetFormulaA1("IF(A1>0,\"Yes\",\"No\")") // OK .CellBelow().SetFormulaA1("IF(A1>0,TRUE,FALSE)"); // OK
I finding issues in inserting conditional formulas in closed xml.
For Example:
If I want to insert following formula into excel sheet
=IF(A1 > 0, Yes, No)
It appears as =IF(A1 > 0 ; Yes ; No) which is not supported in Microsoft Excel. It says formula is corrupt.
Can anyone help me??
Comments: Yes and No are invalid keywords. Put them in quotes. You did point me to a bug in the code so pick the latest source code. var wb = new XLWorkbook(); var ws = wb.AddWorksheet("Sheet"); ws.FirstCell().SetValue(1) .CellBelow().SetFormulaA1("IF(A1>0,Yes,No)") // Invalid .CellBelow().SetFormulaA1("IF(A1>0,\"Yes\",\"No\")") // OK .CellBelow().SetFormulaA1("IF(A1>0,TRUE,FALSE)"); // OK