eqivalent of sumif?

byrne

New Member
Joined
Feb 20, 2003
Messages
15
Hello,

I'm trying to do an access query which will sum 'Amount' based on 'Status'. I don't want to put them in separate columns, because there are three status options and I want a column for each one. eg column 1 - 'Amount' (sumif status = 1), column 2 - 'Amount' (sumif status =2), etc.

Thanks in advance for your assistance.

Best regards.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Select the same field three times in the Query Design Grid. Select the Totals button on the Toolbar (the one that looks like the Sum button, the letter E, in Excel). In the Totals row, select Sum for all three fields. In the first column, [Yourtable.Status]=1 as criteria, 2nd field [Yourtable.status]=2, and 3rd column [Yourtable].[status]=3.

*Check that; don't make three columns. Make only one "Amount" column and put these criteria on three separate "Or" lines. Your recordset should then have three records.
 
Upvote 0
Thanks for your reply. I have tried entering... [tblSavings]![StatusID] =3 but am getting an error when I try to run it.."You tried to execute a query that does not include the specified expression '[tblSavings]![StatusID] =3' as part of an aggregate function."

Any other suggestions?
 
Upvote 0
You have to have an Aggregate function in every field. That columns that you're not summing, you should have "Group By" in the Totals field. Is this the case?
 
Upvote 0

Forum statistics

Threads
1,223,434
Messages
6,172,110
Members
452,444
Latest member
ShaImran193

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