SUM If Adjacent Values Are Unique

L

Legacy 143009

Guest
Hi,

PRODUCTS LOT NO.ERROR TYPEERROR COUNTTOTAL LOT QT.
PRODUCT11ERROR12200
PRODUCT11ERROR23200
PRODUCT11ERROR35200
PRODUCT12ERROR12500

<tbody>
</tbody>

I have a similar table to follow production errors. To be able to create a graph later, I don't use a Pivot Table to report this data.

So have another table to show error percentages. One sample cell is given below to represent it:

PRODUCTSERROR1ERROR2ERROR3
PRODUCT1=SUMIFS(ERROR COUNT, PRODUCTS, THIS PRODUCT, ERROR TYPE, THIS ERROR)/SUMIF(PRODUCTS, THIS PRODUCT, TOTAL LOT QT)*100
PRODUCT2
PRODUCT3
PRODUCT4

<tbody>
</tbody>

..and same for the other products and errors.

For ERROR1, the formula above will calculate "4/1100*100" but this is not I want. In fact, the first 3 record line belong to the same LOT NUMBER. So 200 is the same quantity for different ERROR records.

Last of all, the right calculation, for intance speaking about ERROR1, should be "4/700*100". Total amount of product entered to my depot is totally 700 actually.

Now, somewhere in the denominator section I have to say "Sum if LOT Numbers are distinctive".

Waiting for your helps. Have a nice day fellas!
 
Last edited by a moderator:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
@Flashbond, given your syntax, it looks to me like you'd want this:

=SUMIFS(ERROR COUNT, PRODUCTS, THIS PRODUCT, ERROR TYPE, THIS ERROR)/SUMIFS(TOTAL LOT QT, PRODUCTS, THIS PRODUCT, ERROR TYPE, THIS ERROR)*100
 
Upvote 0
Nope, let's assume the last line of the first table is ERROR2. My formula will calculate "2/1100*100". Your formula will calculate "2/200*100". What I want is "2/700*100".
 
Upvote 0
Yes, I see. Try this:

=SUMIFS(ERROR COUNT, PRODUCTS, THIS PRODUCT, ERROR TYPE, THIS ERROR)/SUMPRODUCT((PRODUCTS=THIS PRODUCT)*(1/COUNTIF(LOT NO., LOT NO.))*(TOTAL LOT QT.))*100
 
Upvote 0
Yes, I am not with my PC but this might seem to be work. I know the right fonction is sumproduct but I don't know exactly how to use it. I'll try ASAP. Is this an array function?
 
Last edited by a moderator:
Upvote 0
Hi,

Is that what you were looking for?

=SUMPRODUCT(--($C$2:$C$5&B2=C2&B2),$D$2:$D$5)/SUMPRODUCT(--($C$2:$C$5&B2=C2&B2),$E$2:$E$5)*100
 
Upvote 0
Yes, I see. Try this:

=SUMIFS(ERROR COUNT, PRODUCTS, THIS PRODUCT, ERROR TYPE, THIS ERROR)/SUMPRODUCT((PRODUCTS=THIS PRODUCT)*(1/COUNTIF(LOT NO., LOT NO.))*(TOTAL LOT QT.))*100
Yes, this is the right formula! Thanks :)
 
Upvote 0
I don't want to keep alive this post but I have one question about SUMPRODUCT. It needs a specific range of values like "C1:C64" But I need a solution for general usage because I am keeping mounthly tracks on seperate spread sheets, so my row counts vary. Can anyone provide a solution can be apllied generally? Thanks
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

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