Do aggregate functions work properly in 'Group by' queries?

JHSam

Board Regular
Joined
Feb 17, 2002
Messages
62
For some reason I can't get the DCount aggregate function to work properly in a Group By query. I'm trying to get the counts of different responses grouped by location. The expression looks something like this:

CountPos: Count("[Cond]","<sourcedata>","[Cond]='Pos'")

The problem is that it is not propertly grouping the counts, but instead returns the (same) total number of counts for the 'Pos' in the [Cond] field for both groups.

Any thoughts on resolving this would be appreciated.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Why are you using Dcount? Why not add [Cond] twice set one to Group By and one to Count.
 
Upvote 0
Re: Do aggregate functions work properly in 'Group by' queri

The simplest approach always works the best ... thanks for the reply - it works fine now.
 
Upvote 0

Forum statistics

Threads
1,221,710
Messages
6,161,445
Members
451,706
Latest member
SMB1982

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