Error when using .Formula

When I try the following

cells[11,3].Formula = “=average(offset(K3,0,-2,1,-1*3))”;

it throws an error about an invalid formula. However, this works with automation and if you just paste the formula into the cell.
I am I doing something wrong?

Hi, thanks for your consideration.

Please see the api document of Cell.Formula. Currently Aspose.Excel does not support “offset” function.

Now if you need this formula, you can set it directly in your designer file.

@DigitalC,

We recommend using Aspose.Cells which has its own enhanced formula calculation engine that supports(read, write and calculate) all the important formulas/functions (including OFFSET) which MS Excel (2007 - 2016/2019) supports, see the document for your reference:
Supported Formula/Functions
Moreover, if any formula/function (from the list) is not supported, we always welcome our users’ requirements and they can ask us to support their demanded formulas/functions, we will try to support their desired formulas soon.

Aspose.Cells is valuable for spreadsheet management tasks at every level. Aspose.Cells follows MS Excel standards and specifications and supports almost all the features which MS Excel has.
See the Aspose.Cells Docs for your reference:
Aspose.Cells Docs

Moreover, see the Examples/demos for your further reference:
GitHub