Subtotal But Exclude Certain Rows

Pixel_Donkey

New Member
Joined
Sep 23, 2011
Messages
12
Hello,

I'm having a problem excluding data from my Subtotal:

excelquestion.jpg


I need to make the subtotal only include:
  • Stone
  • Fabric
  • Glass
  • Paper

And Exclude:
  • Granite
  • Marble
  • Pebble
  • Cobble
  • Brick

How can I do this with a SUBTOTAL or SUMIF statement?

If a SUMIF statement is used I would need to exclude the Hidden rows as I filter this spreadsheet by Date.

Thanks for any help.
 
Hello,

Code:
=AVERAGE(
   IF(SUBTOTAL(2,OFFSET(C2,ROW(C2:C10)-ROW(C2),,1)),
   IF(ISNUMBER(MATCH(A2:A10,{"Stone","Fabric","Glass","Paper"},0)),
     $C$2:$C$10)))

Code:
=SUMPRODUCT(SUBTOTAL(9,OFFSET(C2,ROW(C2:C100)-ROW(C2),,1)),
--ISNUMBER(MATCH(A2:A100,{"Stone","Fabric","Glass","Paper"},0)))

Is there anyway I can turn these into sum's instead of a subtotal. I need to add a line that has the yearly total, not just the filtered subtotal.

Cheers!

I'm not clear...Are you asking for the non-subtotal versions of these formulas?
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Yeah I think so. I filter the spreadsheet by month and the formula displays the filtered results. I also need a row that's not effected by the filter and shows results for all months.

Thanks.
 
Upvote 0
Yeah I think so. I filter the spreadsheet by month and the formula displays the filtered results. I also need a row that's not effected by the filter and shows results for all months.

Thanks.

Control+shift+enter, not just enter:
Rich (BB code):
=AVERAGE(
    IF(ISNUMBER(MATCH(A2:A10,{"Stone","Fabric","Glass","Paper"},0)),
      C2:C10))

Just enter one of:
Rich (BB code):
=SUMPRODUCT(
    C2:C100,
    --ISNUMBER(MATCH(A2:A100,{"Stone","Fabric","Glass","Paper"},0)))
 
=SUMPRODUCT(
    SUMIF(A2:A100,{"Stone","Fabric","Glass","Paper"},C2:C10))
 
Upvote 0
Hi Aladin,

Thanks again.

My Year to Date averages are including the months not yet reached so it's adding a value of 0 for the empty fields which distorts my overall average.

Can I exclude fields where value equals nothing?

I've uploaded the spreadsheet here.
 
Upvote 0
Hi Aladin,

Thanks again.

My Year to Date averages are including the months not yet reached so it's adding a value of 0 for the empty fields which distorts my overall average.

Can I exclude fields where value equals nothing?

I've uploaded the spreadsheet here.

Control+shift+enter:
Rich (BB code):
=AVERAGE(
  IF(ISNUMBER(MATCH(A2:A10,{"Stone","Fabric","Glass","Paper"},0)),
  IF(ISNUMBER(C2:C10),C2:C10))))
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

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