Using the count function

Donna

New Member
Joined
Mar 20, 2003
Messages
15
I have a query where I want to count the number of branches per sale.

If Humberside appears on 4 rows it counts it as 4 rather than 1.

Is there a way to get around this?

Thanks
Donna
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Take the field that Humberside comes from and make another field except this one should be set to "Group by" where as the other one would be "Count". You can hide it if you don't want to see it.

Ziggy
 
Upvote 0
The trouble with this is in the query which I am using, I am also summing on product code so if I set the branch to group by, I then get 6 lines of the same product rather than total for one line.

I was hoping that there would be some code such as 'distinct' that I could write into the SQL statement.

I think I will have to use separate queries to get the information I need.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,340
Members
451,637
Latest member
hvp2262

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