Merge Rows and Multiply Column Values

a68tbird

New Member
Joined
Nov 15, 2011
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hello all -
I have a number of products in my table identified by a ProductID, that list the Color variants and the Size variants in separate rows. What I want to achieve is the total number of variant possibilities for each productID. I've attached some sample data.

Book1
ABCD
1ProductIdNameOptionsVariants
27ColorBlack,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink12
37SizeXS,S,M,L,XL5
49ColorWhite,Charcoal,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink10
59SizeXS,S,M,L,XL5
611ColorBlack,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink12
711SizeXS,S,M,L,XL5
814ColorWhite,Black,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink13
914SizeXS,S,M,L,XL5
1016ColorBlack,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink12
1116SizeXS,S,M,L,XL5
1220ColorWhite,Charcoal,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink10
1320SizeXS,S,M,L,XL5
1421ColorWhite,Charcoal,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink10
1521SizeXS,S,M,L,XL5
1623ColorWhite,Black,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink13
1723SizeXS,S,M,L,XL5
1825ColorWhite,Black,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink13
1925SizeXS,S,M,L,XL5
Sheet1


My intended outcome would be for ProductID 7, total variants would be 60 (12 * 5), for ProductID 9, total variants = 50 and so on.

Any suggestions on how to achieve this?
Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also can you post a sample of your expected output?
 
Upvote 0
One way (using 365):

042423MiscMrExcel.xlsm
ABCDEFG
1ProductIdNameOptionsVariantsProduct IDTotal V
27ColorBlack,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink12760
37SizeXS,S,M,L,XL5950
49ColorWhite,Charcoal,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink101160
59SizeXS,S,M,L,XL51465
611ColorBlack,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink121660
711SizeXS,S,M,L,XL52050
814ColorWhite,Black,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink132150
914SizeXS,S,M,L,XL52365
1016ColorBlack,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink122565
1116SizeXS,S,M,L,XL5
1220ColorWhite,Charcoal,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink10
1320SizeXS,S,M,L,XL5
1421ColorWhite,Charcoal,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink10
1521SizeXS,S,M,L,XL5
1623ColorWhite,Black,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink13
1723SizeXS,S,M,L,XL5
1825ColorWhite,Black,Navy,Charcoal,Purple,Heather Grey,Royal Blue,Light Blue,Teal Ice,Caribbean Blue,Heather Royal,Charity Pink,Heather Hot Pink13
1925SizeXS,S,M,L,XL5
Sheet14
Cell Formulas
RangeFormula
F2:F10F2=UNIQUE(A2:A19)
G2:G10G2=PRODUCT(FILTER($D$2:$D$19,F2=$A$2:$A$19))
Dynamic array formulas.


One alternative (not using 365):
Code:
=PRODUCT(IF(TRUE=(F2=$A$2:$A$19),$D$2:$D$19,1))
 
Last edited:
Upvote 0
Solution
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also can you post a sample of your expected output?
I'm Windows, 365. Account details updated.

My expected output would just be one row for each unique ProductID and the Total Variants for that ID.
 
Upvote 0
My expected output would just be one row for each unique ProductID and the Total Variants for that ID.
In that case it looks as though kweaver has you sorted. :)
 
Upvote 0
Thanks for the profile update and happy to hear the solution worked for you. Cheers.
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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