Hoube78

New Member
Joined
Mar 27, 2014
Messages
43
Hi,

I have a data set like below and need to create a subtotal of the sections. I cant use the sum if function as the table will be filtered and need the section subtotals to be dynamic in line with the table filter.

The filters are setup for BRAND,REGION,AREA and SITE. The idea is I have a separate chart which subtotals as the user applies filters

Any help please?

Thanks in Advance

Col A
Col B
Col C
Col D
Col E
Col F
Col G
Col H
BRAND
REGION
AREA
SITE
SITE NO
SECTION NAME
RC 1 RESULTS
RC 2 RESULTS
client 1
North
Taz
Beds
01
CASH
80%
91%
client 1
North
Taz
Beds
01
REVENUE
95%
82%
client 1
North
Taz
HULL
02
CASH
81%
83%
client 1
North
Taz
HULL
02
REVENUE
58%
94%
client 1
US
BILL
NY
03
CASH
60%
99%
client 1
US
BILL
NY
03
REVENUE
78%

<tbody>
</tbody>
 
Amazing,

However i think i was not clear i dont need four seperate formula but one as the user would apply a filter to to the table.

e.g. the formula would subtotal only visible rows with cash and then i would have another formula which would subtotal only the rows visible for revenue.

i'm guessing i just need to remove the part which points towards columns B and D?

Thankyou think you have got me started and so will have a go / play in a couple of hours.

Thanks,
John
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Amazing,

However i think i was not clear i dont need four seperate formula but one as the user would apply a filter to to the table.

e.g. the formula would subtotal only visible rows with cash and then i would have another formula which would subtotal only the rows visible for revenue.

i'm guessing i just need to remove the part which points towards columns B and D?

Thankyou think you have got me started and so will have a go / play in a couple of hours.

Thanks,
John

You are still not very clear. Judging from what you seem to say above, you probably just need SUBTOTAL()...
 
Last edited:
Upvote 0
Hi sorry,

If I subtotal the column I would not get the CASH and REVENUE results broken down? I would get the overall average.

I have an excel table which is hidden from the users on another sheet, On a report sheet I have the Titles Cash and Revenue and the slicers for Region, Area and Title.

The user would select an option for the slicer and the Cash and Revenue figures would update. So what I need is a Subtotal formula with an if clause in it to only average the rows visible in the table for Cash and Revenue?

I cant attach an excel workbook otherwise I would which would make it clear a for you sorry.

John
 
Upvote 0
Hi,

Not sure if this will make it any clearer for you but here is the formula:

=IF(Table1[[#All],[SECTION_NAME]]=[@[SECTION_NAME]],SUBTOTAL(1,Table1[[#All],[RC - 1 RESULTS]]),"")
 
Upvote 0
You are still not very clear. Judging from what you seem to say above, you probably just need SUBTOTAL()...

Hi thanks for your help today,

I'm nearly got it to work??

using:
=AVERAGE(IF(Table1[[#All],[SECTION_NAME]]=[@[SECTION_NAME]],IF(SUBTOTAL(102,OFFSET($G$12,ROW(Table1[RC - 1 RESULTS])-ROW(G$12),0)),Table1[RC - 1 RESULTS])))

However the issue I'm having is the results seem to be for the section below e.g. Revenue is below the Cash section the Revenue result appears in the Cash Result?

I have tested the above formula on my table and its working as I want apart form the result being for the wrong Section the one below it?

Thanks again for today you got me on the right track with an array.
John
 
Upvote 0
Hi thanks for your help today,

I'm nearly got it to work??

using:
=AVERAGE(IF(Table1[[#All],[SECTION_NAME]]=[@[SECTION_NAME]],IF(SUBTOTAL(102,OFFSET($G$12,ROW(Table1[RC - 1 RESULTS])-ROW(G$12),0)),Table1[RC - 1 RESULTS])))

However the issue I'm having is the results seem to be for the section below e.g. Revenue is below the Cash section the Revenue result appears in the Cash Result?

I have tested the above formula on my table and its working as I want apart form the result being for the wrong Section the one below it?

Thanks again for today you got me on the right track with an array.
John

Convert Table1 to range, post upper part of 10 rows including the headers. And post the desired answer for that range.
 
Upvote 0
Convert Table1 to range, post upper part of 10 rows including the headers. And post the desired answer for that range.

Thank you so much for your help with this, its all working as it should with he below formula:

=AVERAGE(IF(Table1[SECTION_NAME]=[@[SECTION_NAME]],IF(SUBTOTAL(102,OFFSET($G$13,ROW(Table1[RC - 1 RESULTS])-ROW(G$13),0,1)),Table1[RC - 1 RESULTS])))

Just in case someone views the above formula is entered as an array e.g. hold down Ctrl & Shift and press enter.

Saved me so much grief :)
J
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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