Here's the JavaScript to add up the numeric values of a column (and average them, if you like). If your column contains null values or text, the script treats them as a zero for addition purposes, but doesn't include the zero value when the totals are averaged. All of what I'm posting here will go in your template page. First of all, here's the contents of a script tag, which you'll need to place inside your HEAD tags: Next, you'll need to build your template so your results are in a table. The first row () will have the titles of your columns, then you can add your template tag around the next row to display your results. You'll need to add a little SCRIPT tag inside the cell () that you want to add up or average. In the example below, we're going to display the results of "field1" and "field2", but capture the values of "field2" to add up: Next, you'll add a final row to the bottom of the table (outside of the template tag), where the added values will appear. Note the use of the tag w/ IDs, which is where the calculations will be displayed: Average: ... Finally, you'll need to add an onLoad event to your tag, to trigger the script to run once the page loads: That should do it. Now, as the page loads, each time you get a match, the value is added to a variable array. Once the page is finished loading, the script is launched, which adds the values of the array together. In the example I've placed above, those added values are then averaged. If you only want to display the total, change the "document.getElementById" line in the script to display the "colTotals" variable instead of the "colAvg" variable. Like this: document.getElementById("avg1").innerHTML = colTotals; I think that's it - I got this to work last week on a script I've implemented on my company's intranet (otherwise, I'd share the URL so everyone could see it in action). Feel free to post this or share w/ anyone you like. If you have any questions or comments, post them here, or email me at chris@bluej.com.