use query or similar to get categories by month

ShadowRider

New Member
Joined
Sep 23, 2010
Messages
27
Office Version
  1. 365
Platform
  1. MacOS
  2. Web
I currently use
=query('2023'!E2:G, "select G, sum(E) where G is not null group by G")
to get a list of categories and their sums but I'd now like to get a sub total by month.
Column A in the sheet has the date, G is category and E is amount.

I could sort by month and create separate sheets for each month but think there should be an earlier solution.

Thanks!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
What version of excel is this? I have insiders beta edition, and I do not have the QUERY function.
Please update your profile so your version shows up on your profile "button"?

But, you can do this with a pivot table:

1700863347503.png


Mr Excel Questions 73.xlsm
ABCDEFGHIJKLMNOPQRSTU
1DatecolbcolccodAmtcolfCategory
22023-09-1211DSum AmtMon
32023-08-1224CCategoryJanFebMarAprMayJunJulAugSepOctNovDec
42023-09-1222CA182436202421
52023-01-0822EB291223212712
62023-12-1015CC13153728252422355315
72023-10-1211CD18463525161124
82023-03-1421DE22351619102216
92023-08-0912B
102023-06-1114A
112023-07-0920A
122023-07-1016B
132023-11-1616C
142023-11-0910A
152023-04-1210A
162023-03-1315C
172023-04-1112D
182023-09-1622E
192023-10-0824C
202023-11-1111A
212023-07-1616D
222023-11-1124C
232023-06-1322A
242023-04-1123D
252023-05-1315C
262023-05-1013C
272023-05-1521B
282023-07-1325C
292023-12-0824D
302023-03-1311E
312023-06-1019E
322023-04-0824C
332023-03-1324E
342023-02-0912B
352023-11-1216E
362023-02-0913C
372023-03-0823B
382023-01-1016B
392023-01-0913B
402023-03-1025D
412023-04-0914A
422023-06-1625D
432023-09-1010A
442023-04-0916E
452023-02-1418D
462023-07-1110E
472023-09-0914A
482023-04-0813C
492023-11-0913C
502023-03-0918A
512023-07-0811B
Sheet3
 

Attachments

  • 1700863275697.png
    1700863275697.png
    61.6 KB · Views: 5
Upvote 0
Solution
I must admit that I was not using excel but passing along a question my daughter asked me (she is apparently using google sheets). I have forwarded your answer and recommended she use a pivot table there as well.

As for me, I'm using excel for MAC version16. (386 subscription)

-Eric
 
Upvote 0
I must admit that I was not using excel but passing along a question my daughter asked me (she is apparently using google sheets). I have forwarded your answer and recommended she use a pivot table there as well.

As for me, I'm using excel for MAC version16. (386 subscription)

-Eric

Happy to help. But, of course the solution I gave is for an Excel solution.
Google Sheets questions should be posted here:

Best Wishes!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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