Here is the procedure function code from the Simpson tool in the TK Solver math library. You could link your spreadsheet with TK and have it do the calculations for you. In this case, the best solution is just to do the calculus.
n is the number of function "slices" to evaluate.
a...
The built-in DOT function returns the sum of products of the elements of two lists. For example, if list A contains the values {1,3,6,8,4} and list B contains the values {5,6,2,3,9} then the expression DOT('A,'B) returns 95. You can set up your data in a table to make it easier to edit.
I...
1. You can use the TK Solver List Solve Wizard to generate tables of solutions based on sets of equations.
2. You can write a procedure function to loop through a set of assignment statements which reference arrays.
The best solution depends upon whether you are looking to solve a problem once...