Sumifs with cell range for criteria

bkrupa

New Member
Joined
Jun 29, 2018
Messages
17
Hi Everyone,

First post on the forum - I have been a long time reader of this forum and have been able to search out an answer for every question I have ever had until today so I finally had an excuse to make an account.

I am trying to use the below array formula which is a sumifs to return the sum of values in Table! page column P where multiple criteria are met. Where things get a little wonky is in the underlined section where my criteria range is Table!$K$16:$K$2500 and I am wanting to accept a range of criteria matches from cell reference D7:D11.

This is because D7:D11 contain the weeks in the period IE 5,6,7,8 and I am hoping to get a summed period to date number based on matching the other criteria and having any of the up to 5 weeks match as well.

The formula does not error when entered as an array but for some reason the PTD number where all of the weeks are considered is sometimes less than if I just lookup an individual week.... :confused:

{=IFERROR(SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$7:$D$11,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE)),"")}


Thank-you so much in advance!

-Brett
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Rather like this...

=SUMPRODUCT(SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$7:$D$11,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE)))
 
Last edited:
Upvote 0
It worked!

I will have to research why/how because I have never used a SUMPRODUCT formula before....it looks like it tells excel that the formula that follows it is an array for a sum equation?

Thanks again a ton!

-Brett
 
Upvote 0
It worked!

I will have to research why/how because I have never used a SUMPRODUCT formula before....it looks like it tells excel that the formula that follows it is an array for a sum equation?

Thanks again a ton!

-Brett

It's the same as:

SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$7,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$8,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$9,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$10,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$11,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))

SUMIFS thus returns a value for each cell of $D$7:$D$11, which would like like this...

{15;20;12;0;10}

The outer SUMPRODUCT sums this result array.
 
Upvote 0
Thank-you,

I really appreciate the explanation and help on this. Was banging my head against the wall for a while!

-Brett


It's the same as:

SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$7,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$8,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$9,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$10,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))+
SUMIFS(Table!$P$16:$P$25000,Table!$G$16:$G$25000,'By Article'!J17,Table!$J$16:$J$25000,'By Article'!$D$4,Table!$K$16:$K$25000,$D$11,Table!$L$16:$L$25000,VLOOKUP('By Article'!G17,'By Article'!$C$12:$D$13,2,FALSE))

SUMIFS thus returns a value for each cell of $D$7:$D$11, which would like like this...

{15;20;12;0;10}

The outer SUMPRODUCT sums this result array.
 
Upvote 0

Forum statistics

Threads
1,223,716
Messages
6,174,069
Members
452,542
Latest member
Bricklin

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