Sumproduct with subtotal with filter

pugazh

New Member
Joined
Feb 21, 2010
Messages
11
OK Formula returns value:
=IF(J$1="F1",SUMPRODUCT(SUBTOTAL(109,OFFSET($F$11,ROW($F$11:$F$200)-ROW($F$11),)),J$11:J$200,$B$11:$B$200),IF(J$1="TGA",SUMPRODUCT(SUBTOTAL(109,OFFSET($F$11,ROW($F$11:$F$200)-ROW($F$11),)),J$11:J$200,$C$11:$C$200),0))

Not returning value when additional arguments are added: What is wrong with this formula?
=IF(M$1="F1",SUMPRODUCT(SUBTOTAL(109,OFFSET($E$11,ROW($E$11:$E$200)-ROW($E$11),)),J$11:J$200,$B$11:$B$200,$L$11:$L$200=$L5),IF(M$1="TGA",SUMPRODUCT(SUBTOTAL(109,OFFSET($E$11,ROW($E$11:$E$200)-ROW($E$11),)),J$11:J$200,$C$11:$C$200,$L$11:$L$200=$L5),0))
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try...

1.

=SUMPRODUCT(SUBTOTAL(109,OFFSET($F$11,ROW($F$11:$F$200)-ROW($F$11),0)),J$11:J$200,INDEX($B$11:$C$200,0,MATCH(J$1,{"F1","TGA"},0)))

2.

=SUMPRODUCT(SUBTOTAL(109,OFFSET($E$11,ROW($E$11:$E$200)-ROW($E$11),0)),J$11:J$200,($L$11:$L$200=$L5)+0,INDEX($B$11:$C$200,0,MATCH(M$1,{"F1","TGA"},0))
 
Upvote 0
Try...

1.

=SUMPRODUCT(SUBTOTAL(109,OFFSET($F$11,ROW($F$11:$F$200)-ROW($F$11),0)),J$11:J$200,INDEX($B$11:$C$200,0,MATCH(J$1,{"F1","TGA"},0)))

2.

=SUMPRODUCT(SUBTOTAL(109,OFFSET($E$11,ROW($E$11:$E$200)-ROW($E$11),0)),J$11:J$200,($L$11:$L$200=$L5)+0,INDEX($B$11:$C$200,0,MATCH(M$1,{"F1","TGA"},0))

Excellent. It works. Thank you very much. In-fact your formula is much simpler. :bow::bow::bow:
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

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