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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

strive4peace

Well-known Member
Joined
Jul 6, 2009
Messages
678
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?
 

swGeof

New Member
Joined
Oct 29, 2009
Messages
33
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,447
Messages
5,642,209
Members
417,262
Latest member
andrewd1

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
Top