Using Subtotal (Average) with IF

mgclements

New Member
Joined
Jan 17, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All,
Struggling with this one, can someone help?

I have an excel table, columns B to E are used for data grouping (for slicing/filtering), columns F to AO for months. Row 3 through 131 for data.

I want to have a subtotal at the bottom of each column that averages the non-zero value according to the slicer/filters.

I have many cells that show '0' and the average is taking these into account which I do not want.

There doesn't see to be a SUBTOTALIF and other threads are too confusing for me.

I currently use =SUBTOTAL(1,[Jan-22]) to average the data in the column, but I need to add somehow to ignore '0' numbers.

HELP?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Add a helper column (I've called it IsVisible) with this formula
Excel Formula:
=subtotal(103,B2)
change the range to look at a column that will always have a value.
An then you can use
Excel Formula:
=averageifs([jan-22],[jan-22],"<>0",[IsVisible],1)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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