Sumproduct of unique values in multiple ranges

Dan5977

Board Regular
Joined
Aug 7, 2008
Messages
108
Office Version
  1. 2010
Hi guys,

Hope you can help. I have a rather complicated (by my standards) spreadsheet and am stuck at this point. Example of type of problem shown below.

sgqzq1.jpg


So I have 3 ranges of data which each have a quantity and a length. I want to create from these ranges a list of unique values with the total quantity required of each value (as shown). Inputs on any column may be blank but where there is a length, there will be an adjacent quantity to the left.

I'm using Excel 2010.

As always, any assistance would be appreciated.

Thanks,

Dan.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Best to post a (dummy) spreadsheet not a picture, saves us having to reenter the data.
I'm at work and I cant see that picture. A spreadsheet however. . .
 
Upvote 0
Hi,

That link appears to be to a folder: can you clarify which file within that folder is the pertinent one?

Regards
 
Upvote 0
Not at all pretty, but seems to work.

B11:

Code:
=IFERROR(IFERROR(IFERROR(INDEX(B$2:B$7,MATCH(0,IF(B$2:B$7<>"",COUNTIF(B$10:B10,B$2:B$7)),0)),INDEX(D$2:D$7,MATCH(0,IF(D$2:D$7<>"",COUNTIF(B$10:B10,D$2:D$7)),0))),INDEX(F$2:F$7,MATCH(0,IF(F$2:F$7<>"",COUNTIF(B$10:B10,F$2:F$7)),0))),"")

A11:

Code:
=IF(B11="","",SUM(IF(B$2:F$7=B11,A$2:E$7)))

Both formulas need committing with CTRL+SHIFT+ENTER before copying down.

Matty
 
Upvote 0
Qty
Length
Qty
Length
Qty
Length
1
3500
1
3000
1
980
2
3020
1
1000
2
3020
1
1000
2
3500
1
1243
2
2500
1
3500
7
Desired Result
4
3500
1
3000
4
3020
1
980
2
1000
1
1243
2
2500

<TBODY>
</TBODY>

Add the following code for ARRAYUNION function to your workbook, using Alt+F11.

Now define LenghtData by means of Formulas | Name Manager as referring to:
Rich (BB code):
=arrayunion(Sheet1!$B$2:$B$7,Sheet1!$D$2:$D$4,Sheet1!$F$2:$F$6)

And define Ivec as referring to:
Rich (BB code):
=ROW(INDIRECT("1:"&COLUMNS(LengthData)))

A11, just enter and copy down:
Rich (BB code):
=IF($B11="","",SUMIF($B$2:$F$7,$B11,$A$2:$E$6))

B11, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($B$11:B11)<=$A$9, INDEX(LengthData,
  SMALL(IF(FREQUENCY(IF(LengthData<>"", 
  MATCH("~"&LengthData,LengthData&"",0)),Ivec),Ivec),
  ROWS($B$11:B11))),"")

Addendum. See the workbook that implements the set up of above:
https://dl.dropboxusercontent.com/u/65698317/Dan5977 unque items of a multicolumn range.xlsm
 
Last edited:
Upvote 0
Thanks guys.

That last one in particular looks pretty impressive stuff and appears to solve my problem. I'll try to work it into my ever developing spreadsheet over the next few days.

Thanks so much!
 
Upvote 0

Forum statistics

Threads
1,216,086
Messages
6,128,734
Members
449,466
Latest member
Peter Juhnke

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