Totaling query

RCSully

New Member
Joined
Oct 13, 2009
Messages
17
I have a table containing the fields State/City/Sales_Person/Item. I need to write a query total items sold. I need to count if he sold just ‘Widgets’ or ‘Gadgets’ or ‘Both’. My result would look like:
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
Bill:
State
City Total sold … 100
Widget-40
Gadget 40
Both 20
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi RC,

can you describe your tables a bit better? Do you have just one table? Or do you have a header table with who and when (aren't you keeping track of dates?) and a detail table for items?

Do you have an Items table to use as a lookup with an ItemID or do you just store the text name of the item?

do you have a SalesPersons table to use as a lookup or do you just store the name of the person in your sales table?

do you have just 2 things that you sell?
 
Upvote 0
You could do this a couple of ways, but I'd do two queries. The first query would use the criteria, widget, gadget or both.

Then create a crosstab query from the first query. The City/State/Sales person would be your row headings, and item sold (widget, gadget, or both) would be the column heading.
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,293
Members
448,564
Latest member
ED38

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