SUMPRODUCT with SIGN (Conditional Sum without duplicates)

collegeitdept

Board Regular
Joined
Nov 14, 2008
Messages
185
Hello,

Does any one know of the proper sumproduct function that's a conditional sum (lookup) without including the duplicates please? I believe it includes the SIGN function within:



Product GroupLevelModelCount
Boundless11013
Boundless11023
Brewery11018
Brewery11018
Brewery11018
Brewery11018
Brewery11026
Brewery11026
Brewery11037
Hideaway11016
Hideaway11016
Hideaway11016
Hideaway11016
Knife Set11016
Knife Set11016
Knife Set11026
Knife Set11026
Knife Set11026
Card Players11015
Card Players11015
Card Players11015
Card Players11015
Card Players11015
Brewery22016
Brewery22016
Brewery22025
Brewery22025
Brewery22025
Brewery22025
Brewery22025
Brewery22025
Brewery22025
Brewery22037
Brewery22037
Brewery22037
Brewery22037
Brewery22037
Brewery22037
Brewery22044
Brewery22044
Brewery22055
Brewery22055

<tbody>
</tbody>


Answer Grid:

Product GroupLevelRESULT
Boundless1
Brewery121
Hideaway1
Knife Set1
Card Players1
Brewery2

<tbody>
</tbody>


In the RESULT column, is where the formula should be to provide the sum total of units by Product Group & Level.

The function should use the sumproduct to lookup the PRODUCT GROUP against the LEVEL. Then sum the count numbers for ONLY the UNIQUE model numbers for each product group levels.

EX: Brewery 1: Result should be 21 (8+6+7) because for level 1 there 3 unique models (101=8, 102=6, 103=7)

Thanks
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Maybe

Assuming your data in A1:D43



F

G

H

1

Product Group​

Level​

RESULT​

2

Boundless​

1​

6​

3

Brewery​

1​

21​

4

Hideaway​

1​

6​

5

Knife Set​

1​

12​

6

Card Players​

1​

5​

7

Brewery​

2​

27​

<TBODY>
</TBODY>


Array formula in H2 copied down
=SUM(IF(FREQUENCY(IF($A$2:$A$43=F2,IF($B$2:$B$43=G2,MATCH($A$2:$A$43&$C$2:$C$43,$A$2:$A$43&$C$2:$C$43,0))),ROW($A$2:$A$43)-ROW($A$2)+1),$D$2:$D$43))

confirmed with Ctrl+Shift+Enter

Another possible formula...
=SUMPRODUCT(--($A$2:$A$43=F2),--($B$2:$B$43=G2),--(MATCH($A$2:$A$43&$C$2:$C$43,$A$2:$A$43&$C$2:$C$43,0)=ROW($C$2:$C$43)-ROW($C$2)+1),$D$2:$D$43)

confirmed with just Enter

I *think* the first formula is a tad faster

Hope this helps

M.
 
Upvote 0
Maybe

Assuming your data in A1:D43


F
G
H
1
Product Group​
Level​
RESULT​
2
Boundless​
1​
6​
3
Brewery​
1​
21​
4
Hideaway​
1​
6​
5
Knife Set​
1​
12​
6
Card Players​
1​
5​
7
Brewery​
2​
27​

<tbody>
</tbody>


Array formula in H2 copied down
=SUM(IF(FREQUENCY(IF($A$2:$A$43=F2,IF($B$2:$B$43=G2,MATCH($A$2:$A$43&$C$2:$C$43,$A$2:$A$43&$C$2:$C$43,0))),ROW($A$2:$A$43)-ROW($A$2)+1),$D$2:$D$43))

confirmed with Ctrl+Shift+Enter

Another possible formula...
=SUMPRODUCT(--($A$2:$A$43=F2),--($B$2:$B$43=G2),--(MATCH($A$2:$A$43&$C$2:$C$43,$A$2:$A$43&$C$2:$C$43,0)=ROW($C$2:$C$43)-ROW($C$2)+1),$D$2:$D$43)

confirmed with just Enter

I *think* the first formula is a tad faster

Hope this helps

M.



Why wouldn't the SIGN function apply?


I thought that's its purpose in SUMPRODUCT - to only sum/count the unique conditions?

Thanks
 
Upvote 0
I thought that's its purpose in SUMPRODUCT - to only sum/count the unique conditions?

No, SIGN function doesn't have any specific application in this type of calculation. SIGN, if applied to a single value, just returns 1 if that number is positive, -1 if negative and 0 if the number is zero.....but the usage that you are probably thinking of in SUMPRODUCT simply converts an array of TRUE/FALSE values to 1/0 values, so in Marcelo's suggested SUMPRODUCT formula you get the same result with

--($A$2:$A$43=F2)

as with

SIGN($A$2:$A$43=F2)
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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