# problems using subtotals for averages and median issues

##### New Member
Hi Everyone,

Learnt so much from the site and the advice you guys give..but cound'nt find an answer to a problem that I am facing....here goes

I have a column numbers of staff. I am currently using

=SUMPRODUCT(('SE A+B + CODED'!\$AP:\$AP>=1)*('SE A+B + CODED'!\$AP:\$AP<=5)*(SUBTOTAL(3,OFFSET('SE A+B + CODED'!\$AP:\$AP,ROW('SE A+B + CODED'!\$AP:\$AP)-MIN(ROW('SE A+B + CODED'!\$AP:\$AP)),0,1))))

=SUMPRODUCT(('SE A+B + CODED'!\$AP:\$AP>=1)*('SE A+B + CODED'!\$AP:\$AP<=5)*(SUBTOTAL(103,OFFSET('SE A+B + CODED'!\$AP:\$AP,ROW('SE A+B + CODED'!\$AP:\$AP)-MIN(ROW('SE A+B + CODED'!\$AP:\$AP)),0,1))))

which work well and produce the counts figures that I require using the multiple criteria...no problem showing the hidden and visisble, and visible only counts. Problem I am facing is that I need to do average staff per range on the same column and median staff per range. In case of averages I have used:

=SUMPRODUCT(('SE A+B + CODED'!\$AP:\$AP>=1)*('SE A+B + CODED'!\$AP:\$AP<=5)*(SUBTOTAL(1,OFFSET('SE A+B + CODED'!\$AP:\$AP,ROW('SE A+B + CODED'!\$AP:\$AP)-MIN(ROW('SE A+B + CODED'!\$AP:\$AP)),0,1))))

=SUMPRODUCT(('SE A+B + CODED'!\$AP:\$AP>=1)*('SE A+B + CODED'!\$AP:\$AP<=5)*(SUBTOTAL(101,OFFSET('SE A+B + CODED'!\$AP:\$AP,ROW('SE A+B + CODED'!\$AP:\$AP)-MIN(ROW('SE A+B + CODED'!\$AP:\$AP)),0,1))))

but I am not getting any values back only getting #DIV appearing in cells. Need your help on this formuale

For Median I am informed by your site that I can use subtotals as per range.... any suggestions for work around....still using subtotal inside statement as I need to difefrentiate from visible and hidden + visible your guidance and help would be gratefully appreciated.......

### Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Replies
0
Views
90
Replies
23
Views
463
Replies
6
Views
271
Replies
1
Views
164
Replies
78
Views
2K

1,126,904
Messages
5,621,571
Members
415,847
Latest member
nigeywigey

### 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.

### Which adblocker are you using?

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

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