Sum rows only existing in different smaller array

Martunis99

New Member
Joined
Aug 16, 2021
Messages
19
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

I am running into an issue with an excel formula. So the point is to sum Column D (in cell K2) only for the numbers that exist in column H, and only for those numbers that have Column B = 11 and Column C = 17.
I was able to partially get there with an array formula, but the problem is since the "arrays" are of different dimensions I am still getting an NA error.

I have also tried utilizing SUMIFS but that didn't work, at least the way I tried to use it. I also thought about SUMPRODUCT but I am not sure if that will work either due to the difference in "array" sizes.

Is there a way to make this work with one single formula? (I know this can be done by using a helper column and a simple SUMIFS but I was wondering if it can be done without adding clutter).

Attached an image with my sample data. Formula in K2 is the following: {=SUM(IF((ISNUMBER(MATCH(H2:H7,A2:A11,0)))*(B2:B11=11)*(C2:C11=17),D2:D11))}
 

Attachments

  • Capture.PNG
    Capture.PNG
    11.3 KB · Views: 15

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
How about
Excel Formula:
=SUM(SUMIFS(D:D,A:A,H2:H7))
 
Upvote 0
From your image I would think that you simply want
Excel Formula:
=SUMPRODUCT(SUMIFS(D2:D11,A2:A11,H2:H7,B2:B11,11,C2:C11,17))

edit:- for your information, your array formula would work if you swapped the 2 ranges in match, {=SUM(IF((ISNUMBER(MATCH(A2:A11,H2:H7,0)))*(B2:B11=11)*(C2:C11=17),D2:D11))} so that the array which is not the same size as the rest is the match range instead of the criteria.
 
Upvote 0
Solution
@Fluff that has to be entered as an array function though, right? If I try to enter it as a normal function it just returns the value of the first ID. Either way, as an array function it works so thank you!

@jasonb75 that one absolutely works, thank you! And I changed my formula and it does indeed work. Makes sense, if the lookup value is the bigger array, no chance of getting NAs anymore. Good idea! I like your and @Fluff 's idea much better though. Much simpler.

Thank you guys so much!
 
Upvote 0
@Fluff that has to be entered as an array function though, right?
Very possibly, as CSE entry is not required with 365 or 2021, I can't always remember what needs CSE & what doesn't.
 
Upvote 0
Very possibly, as CSE entry is not required with 365 or 2021, I can't always remember what needs CSE & what doesn't.
Right! I forget 365 has a few cool new tricks.

Thank you for your input!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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