Change PivotTables and Formula resultes depending on Filtered Rows on Main Worksheet

geospatial

Active Member
Joined
Sep 2, 2008
Messages
290
I have set my main worksheet to Format as Table. I have two formulas referencing a column containing dates.

Code:
=MIN(Sheet1B:B)
Code:
=MAX(Sheet1B:B)

I would like these to change to correlate with the data I have filtered on my main worksheet table, but it still reads all data even after a filter.

On the same lines my PivotTable is setup to use the main worksheet table, and would like it to change it as well depending on the main worksheet filters.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Excel's SUBTOTAL Function can get you the result you are looking for.

For MAX: =SUBTOTAL(104, Sheet1B:B)
For MIN:
=SUBTOTAL(105, Sheet1B:B)

Check out this link for more information on the SUBTOTAL Function. You will see that there are many calculations that can be performed and you can either calculate on all cells in a range or ignore hidden cells which is what the 104/105 does for you.
 
Upvote 0
Thanks,

That worked for the dates.
Any thoughts on getting the PivotTable to work the same way?
 
Last edited:
Upvote 0
I could see possibly doing that with VBA but offhand I can't think of a way to do that in native Excel. There are many way more experienced SMEs on this Forum, possibly one of them can provide a solution.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,952
Members
448,535
Latest member
alrossman

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