From an old post of mine ---
"Area under a curve"
To use Excel for evaluating the integral of, say, 2+3*(Ln(x))^0.6 using
Simpson's Rule (also see notes below):
1) Enter some labels:
2) Set some values:
3) Define some names:
Select A1:B3, then choose Insert->Name->Create. Make sure that only the
"Left Column" box is selected. If it isn't, you might have entered text
instead of numbers in the right column, or mis-selected the range. Press
4) Choose Insert->Names->Define
Enter each of the following names and their definitions, pressing Add
with each entry (you can copy and paste these):
(optional) If interested in a trapezoidal approximation, define
5) Close the Define Names box, and in, say, cell D1, array-enter
That is, type in the function, and hold ctl-shift when pressing Enter.
In general, ctrl-shift-enter =SUM(SimpWts*f(EvalPts))
where f() is a legitimate Excel expression that yields a scalar numeric
To use the trapezoidal method, substitute in the above expression
TrapWts for SimpWts.
(1) With this implementation, an odd number for NbrPanels doesn't cut it
(for Simpson's rule), so there will be no improvement moving from an odd
number to the next integer (odd ones are automatically changed to the
next even, internally).
(2) If you have "jumps" in your function, break it up at the points
where those occur, and add the pieces.
.... FWIW, consider Weddle weights instead of the Simpson ones. For a
single partition, they run [1 5 1 6 1 5 1], with the whole shebang
multiplied by (3/10). Error term is much tighter, the calc is just as fast.
James Silverton wrote:
> Hello, All!
> There have been no responses to a previous post but forgive me if I try
> again. If this is not regarded as a charting question, please let me
> know. Anyway, is it possible to write a statement evaluating the area
> under a graph by Simpson's rule without using VBA or helper columns?
> James Silverton
> Potomac, Maryland, USA