Subtotals based on value in other cell

boydr

Board Regular
Joined
Apr 17, 2002
Messages
157
I'm trying to subtotal the values in a column (e.g. column A), based on what is filtered in column B (weekly total), and/or column C (monthly totals). For example, if week 13 is selected using the autofilter, it will calculate what is filtered and produce a weekly total based only on what is filtered. If I filter "all", it will add all of that column, and update monthly total as well. Can I do this without a macro? I'd like to know the best way to do this with and without a macro. The formula I have now doesn't calculate correctly when I filter a specific week.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I tried a sumif, but can't get it to work if I filter for only 1 week. Any ideas?
 
Upvote 0
On 2002-04-30 04:25, boydr wrote:
I tried a sumif, but can't get it to work if I filter for only 1 week. Any ideas?

That would indicate that you don't have a column in your data area which houses week numbers.

If you want to, post 10 rows of your data you're autofiltering: Activate an empty cell, type =, select 10 rows of data including the labels, hit F9, Copy what you see, and post the copied bit here in an follow-up posting.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,211
Members
448,554
Latest member
Gleisner2

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