Calculate the total value of a column in a query...

EDUARDOELLOCO

New Member
Joined
Jun 3, 2016
Messages
7
Hello friends,

I want to create a query that returns one value: the total (sum) of all values in a column of a table.

For example:

Let's say there is a table with 4 columns: Product, Quantity, Price and Value, being Value=Quantity * Price.
I want the query to return just 1 number: the Total Value for all Products in the table.

I hope it is clear and you can help me achieve that.

Thanks in advance,

Ed
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to the Board!

Do the following:
1. Create a new query, selecting your table as the source
2. Do NOT add any of the Table fields to your query, just add the following Calculated Field:
Code:
Value: [Quantity]*[Price]
3. Click on the Totals button in the Show/Hide ribbon in your menu (looks like a Sigma)
4. On the new Totals row it added under your Calculated Field, change the value from "Group By" to "Sum"

View your results. It should show one single number, the Sum of all the Values.
 
Upvote 0
You are welcome!
Glad I could help!
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,132
Members
451,743
Latest member
matt3388

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top