Sumifs Subtotal Advanced Filtered List

JJLEFROGGE

New Member
Joined
Jul 23, 2020
Messages
9
Office Version
  1. 2016
Platform
  1. MacOS
I have a table of data which is advanced filtered. I want to create a sumifs subtotal using 2 criteria.

Period = M134
Variable = N139

Period Range: BV200:BV5199
Variable Range = BY200:BY5199
Sum Range = BZ200:BZ5199

Formula: =SUMPRODUCT(SUBTOTAL(9,OFFSET($BZ$200,ROW($BZ$200:$BZ$5199)-ROW($BZ$200),0,1)),--($BV$200:BV$5199=$M$134),--($BY$200:$BY$5199=N139))

Formula is returning #N/A

Note, the range of data has been pulled through with a vlookup. However, still getting same error when values are pasted into range.

Any help hugely appreciated.

thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
It appears your ranges are different sizes within sumproduct generating the error, array 1 is only one row high based on offset.
 
Upvote 0
It appears your ranges are different sizes within sumproduct generating the error, array 1 is only one row high based on offset.
Thank you. Any idea on how I fix it? I'm a little out of my depth on this one.
 
Upvote 0
First I suppose what is the use of using Subtotal and offset function. The result which it displays is the same as it would show in the range
I suppose instead of
SUBTOTAL(9,OFFSET($BZ$200,ROW($BZ$200:$BZ$5199)-ROW($BZ$200),0,1))

Select only $BZ$200:$BZ$5199

Sample Post

Book1
BCDEFGHIJKL
2
3Using Subtotal132600100TRUETRUE
4200TRUETRUE
5Without using Subtotal132600300TRUETRUE
6400TRUETRUE
7500TRUETRUE
8600TRUETRUE
9700TRUETRUE
10800TRUETRUE
11900TRUETRUE
121000TRUETRUE
131100TRUETRUE
141200TRUETRUE
151300TRUETRUE
161400TRUETRUE
171500TRUETRUE
181600TRUETRUE
191700TRUETRUE
201800TRUETRUE
211900TRUETRUE
222000TRUETRUE
232100TRUETRUE
242200TRUETRUE
252300TRUETRUE
262400TRUETRUE
272500TRUETRUE
282600TRUETRUE
292700TRUETRUE
302800TRUETRUE
312900TRUETRUE
323000TRUETRUE
333100TRUETRUE
343200TRUETRUE
353300TRUETRUE
363400TRUETRUE
373500TRUETRUE
383600TRUETRUE
393700TRUETRUE
403800TRUETRUE
413900TRUETRUE
424000TRUETRUE
434100TRUETRUE
444200TRUETRUE
454300TRUETRUE
464400TRUETRUE
474500TRUETRUE
484600TRUETRUE
494700TRUETRUE
504800TRUETRUE
514900TRUETRUE
525000TRUETRUE
535100TRUETRUE
54
55
56
Sheet1
Cell Formulas
RangeFormula
D3D3=SUMPRODUCT(SUBTOTAL(9,OFFSET(BZ200,ROW(BZ200:BZ250)-ROW(BZ200),0,1)),--($BV$200:BV$250=$M$134),--($BY$200:$BY$250=N139))
H3:H53H3=SUBTOTAL(9,OFFSET(BZ200,ROW(BZ200:BZ250)-ROW(BZ200),0,1))
J3:J53J3=($BV$200:BV$250=$M$134)
L3:L53L3=($BY$200:$BY$250=N139)
D5D5=SUMPRODUCT(H3#,--($BV$200:BV$250=$M$134),--($BY$200:$BY$250=N139))
Dynamic array formulas.
 
Upvote 0
First I suppose what is the use of using Subtotal and offset function. The result which it displays is the same as it would show in the range
I suppose instead of
SUBTOTAL(9,OFFSET($BZ$200,ROW($BZ$200:$BZ$5199)-ROW($BZ$200),0,1))

Select only $BZ$200:$BZ$5199

Sample Post

Book1
BCDEFGHIJKL
2
3Using Subtotal132600100TRUETRUE
4200TRUETRUE
5Without using Subtotal132600300TRUETRUE
6400TRUETRUE
7500TRUETRUE
8600TRUETRUE
9700TRUETRUE
10800TRUETRUE
11900TRUETRUE
121000TRUETRUE
131100TRUETRUE
141200TRUETRUE
151300TRUETRUE
161400TRUETRUE
171500TRUETRUE
181600TRUETRUE
191700TRUETRUE
201800TRUETRUE
211900TRUETRUE
222000TRUETRUE
232100TRUETRUE
242200TRUETRUE
252300TRUETRUE
262400TRUETRUE
272500TRUETRUE
282600TRUETRUE
292700TRUETRUE
302800TRUETRUE
312900TRUETRUE
323000TRUETRUE
333100TRUETRUE
343200TRUETRUE
353300TRUETRUE
363400TRUETRUE
373500TRUETRUE
383600TRUETRUE
393700TRUETRUE
403800TRUETRUE
413900TRUETRUE
424000TRUETRUE
434100TRUETRUE
444200TRUETRUE
454300TRUETRUE
464400TRUETRUE
474500TRUETRUE
484600TRUETRUE
494700TRUETRUE
504800TRUETRUE
514900TRUETRUE
525000TRUETRUE
535100TRUETRUE
54
55
56
Sheet1
Cell Formulas
RangeFormula
D3D3=SUMPRODUCT(SUBTOTAL(9,OFFSET(BZ200,ROW(BZ200:BZ250)-ROW(BZ200),0,1)),--($BV$200:BV$250=$M$134),--($BY$200:$BY$250=N139))
H3:H53H3=SUBTOTAL(9,OFFSET(BZ200,ROW(BZ200:BZ250)-ROW(BZ200),0,1))
J3:J53J3=($BV$200:BV$250=$M$134)
L3:L53L3=($BY$200:$BY$250=N139)
D5D5=SUMPRODUCT(H3#,--($BV$200:BV$250=$M$134),--($BY$200:$BY$250=N139))
Dynamic array formulas.
Thank you. I'm always stunned at how generous contributors are in these forums! Thank you so much - it worked and now I can relax!
 
Upvote 0
I'd recommend named ranges with the SUMIFS function. How is BZ200 returned with vlookup? Does it return text or row number?
Define name dialog:
Name: MySumRange
Refers to: =INDIRECT(vlookup1&":"&vlookup2)

Name: MyCriteriaRange1
Refers to: =INDIRECT(vlookup1&":"&vlookup2)

Name: MyCriteriaRange2
Refers to: =INDIRECT(vlookup1&":"&vlookup2)

Formula for answer =SUMIFS(MySumRange,MyCriteriaRange1,M134,MyCriteriaRange2,N139)
 
Upvote 0
I'd recommend named ranges with the SUMIFS function. How is BZ200 returned with vlookup? Does it return text or row number?
Define name dialog:
Name: MySumRange
Refers to: =INDIRECT(vlookup1&":"&vlookup2)

Name: MyCriteriaRange1
Refers to: =INDIRECT(vlookup1&":"&vlookup2)

Name: MyCriteriaRange2
Refers to: =INDIRECT(vlookup1&":"&vlookup2)

Formula for answer =SUMIFS(MySumRange,MyCriteriaRange1,M134,MyCriteriaRange2,N139)
Thank you! All fixed :giggle:
 
Upvote 0

Forum statistics

Threads
1,215,729
Messages
6,126,525
Members
449,316
Latest member
sravya

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