Why is an @ symbol after = symbol in excel formula with EPPLUS?

Viewed 477

This is how the formula appears in excel:

enter image description here

I want to use Forecast formula in Excel with EPPLUS from c#. The formula in the code is correct but in Excel appears =@FORECAST(params).

        ExcelRange targetDate = sheet.Cells[listItems + 2, 2];
        ExcelRange values = sheet.Cells[2, 3, listItems+1, 3];
        ExcelRange timeLine = sheet.Cells[2, 2, listItems+1, 2];

        sheet.Cells[8, 4].Formula = "=FORECAST.ETS(" + targetDate + "," + values + "," + timeLine + ",1,1)";
        sheet.Cells[8, 4].Calculate();

I want to trim the @ from the formula in the excel file, like this:

=FORECAST.ETS(B8,C2:C7,B2:B7,1,1)

2 Answers

In code you don't need to put the '=' character

Just use:

  sheet.Cells[8, 4].Formula = "FORECAST.ETS(" + targetDate + "," + values + "," + timeLine + ",1,1)";

Similar Problem

I'm having a similar problem with a different formula: worksheet.Cells[y, x].Formula = "SUMME(C5:C35)";

gave me =@SUMME(C5:C35) within Excel.

Instead of =SUMME(C5:C35).


Solution

It seems that EPPLUS has problems with the German formula. The problem disappears when I use:

worksheet.Cells[y, x].Formula = "SUM(C5:C35)";

My generated Excel now looks like this: =SUMME(C5:C35) (which is what I need)


I know it's not the answer to the exact problem mentioned above. But I thought it might help someone. And maybe serves as a hint to the original question.

Related