TRIMMEAN in a Filtered Table

Trethia

New Member
Joined
Jul 27, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,
I have been struggling with including a TRIMMEAN formula into my data because I have a table that is filtered so it just calculates the entire array, when I only want it to show calculations for visible cells. I am calculating Delay and I have an entire column for Delay with numbers underneath that I want the TRIMMEAN to apply for at all times, even when the filter is on. I would like it to be similar to the AGGREGATE function in the sense that it will recalculate the data after the filter changes the table.

Does anyone have any suggestions?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Let's say that A2:A100 contains the data, the following formula will return the result based on the filtered data...

Excel Formula:
=TRIMMEAN(IF(SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-ROW(A2),0,1))>0,A2:A100),0.2)

To also exclude rows that are manually hidden, try the following formula instead...

Excel Formula:
=TRIMMEAN(IF(SUBTOTAL(103,OFFSET(A2:A100,ROW(A2:A100)-ROW(A2),0,1))>0,A2:A100),0.2)

Adjust the range and change the percent argument for SUBTOTAL accordingly.

Note that earlier versions of Excel need to confirm the formula with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0
Let's say that A2:A100 contains the data, the following formula will return the result based on the filtered data...

Excel Formula:
=TRIMMEAN(IF(SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-ROW(A2),0,1))>0,A2:A100),0.2)

To also exclude rows that are manually hidden, try the following formula instead...

Excel Formula:
=TRIMMEAN(IF(SUBTOTAL(103,OFFSET(A2:A100,ROW(A2:A100)-ROW(A2),0,1))>0,A2:A100),0.2)

Adjust the range and change the percent argument for SUBTOTAL accordingly.

Note that earlier versions of Excel need to confirm the formula with CONTROL+SHIFT+ENTER.

Hope this helps!
It worked well! Thank you so much for replying quickly :)
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

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