I would like to write a formula in a Excel cell with SpreadSightLight in C#. I have a following formula in excel
=COUNTIFS(Sheet2!E:E, D2, Shet2!A:A, ">0")
In the code it looks
"=COUNTIFS({0}!E:E,{1},{0}!A:A ,\">0\")";
I save the file from the code, but when i try to open the file Excel (2013) gives error message and the formula is removed
Removed Records: Formula from /xl/worksheets/sheet3.xml part
and the sheet3.xml contains the following line
COUNTIFS(Sheet2!E:E, D2, Sheet2!A:A ,">0")
I tried the verbatim string and the char(34) solutions also but causes the same error.
How can I solve this problem? Thanks in advance.
string formula = "=COUNTIFS({0}!E:E,{1},{0}!A:A ,\">0\")";and the code to write:Write(string.Format(formula, sheetName, SLConvert.ToCellReference(StartRow, StartColumn + 2)), style2);(where 'Write' is a own method to use 'SetCellValue' and 'SetCellStyle' together)