### Title

Best way to calculate and average a list of X*Y items.

### Post

Hello All,

I was wondering if there is a simple and easy way to calculate and average a list of X*Y numbers.

I currently do this with a (not so pretty) looping script. The data is entered like this:

1*2.18

1*2.33

7*1.18

6*1.38

1*1.70

2*.36

1*.66

2*.54

15*.54

And the script multiplies and sums the results, sums the number of items on the left of the *, then divides the result by the number of items giving the average.

33.31 / 36 = .9252777777777778

I would like to do this without a script and would like the entry to be less cumbersome.

I was thinking of creating a field where the user could enter the data in 1 line. as in:

1*2.18+1*2.33+7*1.18+6*1.38+1*1.70+2*.36+1*.66+2*.54+15*.54

Then some how calculate the total\number of items.

Any thoughts on this?

Thank you,

--StevenKW

Evaluate can take text and evaluate text in a field like it was an expression typed into a specify calculation dialog box.

If you wanted, you could define a field such as: Evaluate ( XYField ) and then you can define a summary field that computes the average of this new calculation field.

However, I don't see the need (you may have a very good reason for this, it's just not here for me to see), for using a single field to record both values if the expression is always going to be X*Y.

Define two fields: X, and Y. Define a calculation field, cProduct as X * Y and then your summary field can compute the average of cProduct.