SUMPRODUCT with nested SUMIFS and range as criteria

TG2812

Board Regular
Joined
Apr 15, 2015
Messages
180
Hello,

I have the below formula which is working when I only have 1 range as criteria. As soon as I add a second range as criteria (to perform a subtotal - roll up of several product family), the formula works but the result it returns is wrong.

Formula working:
=IFERROR(SUMPRODUCT(SUMIFS(Sheet2!$F:$F,Sheet2!$C:$C,Sheet1!$A$26:$A$28,Sheet2!$D:$D,Sheet1!$B8,Sheet2!$G:$G,"<"&TODAY(),Sheet2!$G:$G,">="&DATE(YEAR(TODAY()),1,1)))/SUMPRODUCT(SUMIFS(Sheet2!$E:$E,Sheet2!$C:$C,Sheet1!$A$26:$A$28,Sheet2!$D:$D,Sheet1!$B8,Sheet2!$G:$G,"<"&TODAY(),Sheet2!$G:$G,">="&DATE(YEAR(TODAY()),1,1))),0)

Formula not working as soon as second range as criteria is inserted (in red bold):
=IFERROR(SUMPRODUCT(SUMIFS(Sheet2!$F:$F,Sheet2!$C:$C,Sheet1!$A$26:$A$28,Sheet2!$D:$D,Sheet1!$B$5:$B$8,Sheet2!$G:$G,"<"&TODAY(),Sheet2!$G:$G,">="&DATE(YEAR(TODAY()),1,1)))/SUMPRODUCT(SUMIFS(Sheet2!$E:$E,Sheet2!$C:$C,Sheet1!$A$26:$A$28,Sheet2!$D:$D,Sheet1!$B$5:$B$8,Sheet2!$G:$G,"<"&TODAY(),Sheet2!$G:$G,">="&DATE(YEAR(TODAY()),1,1))),0)

Any idea how I could possibly adjust the formula?

Thank you in advance for your time and great help
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
That's probably because the range size is different for Sheet1!$A$26:$A$28 and Sheet1!$B$5:$B$8 ...
 
Upvote 0
@Domenic , thank you for your time and reply.

How can I modify the formula to deal with the different range size? I'm afraid I cannot change the ranges in my case.
 
Upvote 0
Try posting a small sample of the data, along with the actual expected result.
 
Upvote 0
Sheet1:
1576100263346.png


Sheet2 (I cannot include the entire data set)
1576100325159.png


Hope this helps clarify.
 
Upvote 0
Can you please copy/paste the data as text into your post, instead of providing an image? With images, we're not able to copy/paste into Excel for testing purposes. Also, for clarity, please confirm how you want the calculation to take place.
 
Upvote 0
Hi,

Basically the formula should do a division between column 2 and column 1 following a set of criteria.
  • First criteria is the country (column C - Sheet2, criteria Sheet1 range A13:A15)
  • Second criteria is the product family (column D - Sheet2, criteria Sheet2 range B5:B8)
  • Third criteria is the date (less than today and equals to this year = 2019)
I'm sorry I can't find a quick and easy way to replicate the image in a simple format here..
 
Upvote 0

Forum statistics

Threads
1,215,527
Messages
6,125,336
Members
449,218
Latest member
Excel Master

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