Combining rows in dynamic array

depcdivr

Active Member
Joined
Jan 21, 2008
Messages
349
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a dynamic array of data from a large set of data so that I can create an interactive chart. I have the following columns
UnitNameRegionRepMonthYearPrice

I can create the dynamic array but I run into multiple rows where the first 6 columns are the same but only the last one is different. Is there a way to automatically combine those rows into one where the price is the sum of combinations where the first 6 columns are identical?

For example I have have these three rows in the array
Unit 1DepcdivrEastNoneJan2022$10,000
Unit 1DepcdivrEastNoneJan2022$20,000
Unit 1DepcdivrEastNoneJan2022$15,000

and I want to combine them to be

Unit 1DepcdivrEastNoneJan2022$45,000

I know this can all be handled by a pivot table the ultimate goal is to create an interactive chart where you can select different sets of data with just a click of a button.
 
One last question pertaining to this application. I want to add a sortby so that the data will always be sorted by largest to smallest. I know how the sort by works but what two arguments do I use in it. Well the array would be the formula from above but how would you specify the sortby value?
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
To sort use
Excel Formula:
=LET(u,UNIQUE(FILTER(CHOOSECOLS(A2:L6,1,3,4,5,6,7),D2:D6>0)),SORT(HSTACK(u,SUMIFS(L2:L6,A2:A6,CHOOSECOLS(u,1),C2:C6,CHOOSECOLS(u,2),F2:F6,CHOOSECOLS(u,5),G2:G6,CHOOSECOLS(u,6))),7,-1))
 
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,641
Members
449,325
Latest member
Hardey6ix

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