Solved

Combinations/Permutations

Posted on 2013-07-01
8
674 Views
Last Modified: 2013-07-03
Greetings Everyone.  I have attached a workbook that I created to breakout unique Part Numbers Based on Size Options and Color Codes.  It seems pretty clunky so I know there has to be a better way to code this than what I have done.  Can someone provide some feedback for learning here?  Thanks!
Permutations1.7.3.xls
0
Comment
Question by:Christopher Wright
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 27

Expert Comment

by:d-glitch
ID: 39291322
You need all the data (and so do we).

What are the possible colors and sizes?
Do you need a serial number as well?  Or do all the red, size 10 shirts have the same Part No.
0
 
LVL 27

Accepted Solution

by:
d-glitch earned 167 total points
ID: 39291334
How many base part numbers are there?

Do you want the part number to make sense:   SHRT-10-RED  vs  314-10-02
0
 
LVL 46

Assisted Solution

by:Martin Liss
Martin Liss earned 167 total points
ID: 39291378
The recursive function shown in post #9 here looks interesting.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Christopher Wright
ID: 39291407
Hi d-glitch.  The base part numbers are dynamic.  They vary depending on the manufacturer we are dealing with.  The same applies to the Size Options and Color Codes.  Maybe I should have went with a free text for all columns.  Would that have been a better approach?

Also, I should not have placed the word permutation in the title since I am really going after combinations.  None of the values change, I am simply looking for a concatenated list that has all three columns combined in every possible combination.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39291557
Did you try to adapt that recursive function to your code?
0
 

Author Comment

by:Christopher Wright
ID: 39291852
I am still tinkering with it a bit.
0
 
LVL 42

Assisted Solution

by:Rob Jurd, EE MVE
Rob Jurd, EE MVE earned 166 total points
ID: 39295442
The easiest way to achieve this would to use a database.  Have tables for each of the elements eg product code, colour, size etc

Then by doing a simple SELECT query would bring in all combinations

SELECT PartNo, Size, Color FROM tblParts, tblSizes, tblColors
0
 

Author Closing Comment

by:Christopher Wright
ID: 39296405
Great help from everyone.  I took a little from each and ultimately finished with a database.  Thanks for all of your help Gents!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Make a Cell act like a Date 7 38
Excel Conditional Statements 11 32
Countifs formula not counting data points 5 20
Excel format formula for currency 15 21
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now