Query to count two (or more) fields

Erick

Active Member
Joined
Feb 26, 2003
Messages
362
If I have a table with 2 fields :
Fld1 - Fld2
A - C
A - D
A - C
A - D
B - C
B - D
B - C
B - D

How can you create a query to count the number of each Fld1 & Fld2 combination (e.g. count of A - C, count of A - D,etc.)
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Place the two fields on the query grid, then add the second one again (so you have it twice).
In the design view, click the big Sigma icon to turn it into a Totals query. You now have a Totals row in the grid. Leave the first two as Group By, change the third to Count.

Denis
 
Upvote 0
Thanks Denis. I knew it would be something similar. I was adding the first 2 fields, then I was adding the same table again and linking the second fields together. I was then adding the 2nd field from the 2nd table in query and then doing a count on it...obviously it didn't give me what I wanted.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

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