Cartolo

New Member
Joined
Jun 12, 2017
Messages
5
Hi All,

I have an issue with SUMIFs. I am trying to sum up a sub group of items that use the same main component i.e. apple. However, I only want to sum up the qty leftover from the main component item such as apple that is positive with no negative values.

The reason being is that the demand is on the finished good (pies,fritters,juice) not on the component i.e. apple.

=SUMIFS(B:B,C:C,[@[Sub Group]])

Here is the data set:

A. ItemB. Qty LeftoverC. Sub GroupD. Qty of Sub GroupE. Correct Qty of Sub GrpFGHI
1 Apple-20Apple-40-20
2Apple Pie-5Apple-40-20
3Apple Juice-15Apple-40-20
4Banana4Banana1111
5Banana Pie3Banana1111
6 Banana Fritter 4 Banana 11 11


<colgroup><col style="font-weight: bold; width: 30px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"><col style="width: 47px;"></colgroup><tbody>
</tbody>
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
So in your example, Apple would equal 0 and Banana 11, exact?

=SUMIFS(B:B,C:C,"Apple",B:B,">0") You could replace "Apple" by C2 in this formula.
 
Upvote 0
Correct. Unfortunately your solution does not work, but here is the solution I found:

=SUMIF(C:C,[@[Sub Group]],B:B)-IF(SUMIF(A:A,[@[Sub Group]],B:B)<0, SUMIF(A:A,[@[Sub Group]],B:B),0)

However, this formula runs extremely slow now :(.
 
Upvote 0
Hi,

Don't use Entire Column references (i.e. C:C, B:B, etc.), that's over 1 Million rows for Excel to process.

Use a range you know is greater than your data set, if you think you'll never have more than 100000 rows of data, use 125000, like C1:C125000
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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