If I write function like AVG MIN MAX Worksheet.Range.Formula works, but for IF statement it doesnt work and throws Exception from HRESULT: 0x800A03EC, this is my code:
private void writeCp(int letter, int positionY)
{
string code = "=IF(" + (char)letter + "11=0;\"Cp > 100\";(" + (char)letter + "7-" + (char)letter + "6)/(6*" + (char)letter + "11))";
ws.Cells[12, positionY].Formula = code;
}