Custom formulas

I would like to write a custom formula which I can use in the grid.

For example, my function foobar would add all the cells in a list together.

Once written, I would like to be able to assign a cell to be the value returned by the function.

Ideally this function would be added to the list of available functions.

How can this be accomplished?

no idea sir.
but thought is quite interesting.
Hope this community help you with this.
Regards

Unfortunately it is not available to build your own math formulas for the grid cells.
You may only try to create a custom “counter” for your grid footer:
https://docs.dhtmlx.com/grid__statistics_counter.html#creatingcustomcounters