# query help

#### buggy2

##### Board Regular
I am looking to run a query on a table which will determine the weighted average of a field. The table is designed as follows:

Name | Amount | Rating

I am trying to calculate Sum((Amount*Rating)/Sum of Amount), but I keep on getting aggregate errors relating to 'Sum of Amount'. Any ideas.

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### Philem

##### Active Member
Hullo. Let me see if I understand this correctly. What you have is, in effect:
Code:
``Sum((A*R)/Sum of A)``
Right? Here's hoping you have A calculated elsewhere. Try this instead:
Code:
``Sum((A*R)/A)``
and see if that gets you want you want.

HTH

P

#### buggy2

##### Board Regular
thanks the sum piece was incorrect before this query.

It was one of the those monday morning things.

Thanks again.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,038
Messages
5,856,969
Members
431,843
Latest member
Malahhai

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back