Solved

# Combinations/Permutations

Posted on 2013-07-01
695 Views
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
Question by:Christopher Wright
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 2
• 2
• +1

LVL 27

Expert Comment

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

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 47

Assisted Solution

Martin Liss earned 167 total points
ID: 39291378
The recursive function shown in post #9 here looks interesting.
0

Author Comment

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 47

Expert Comment

ID: 39291557
0

Author Comment

ID: 39291852
I am still tinkering with it a bit.
0

LVL 43

Assisted Solution

Rob 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

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

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
###### Suggested Courses
Course of the Month3 days, 13 hours left to enroll