How To: Permutations from columns with various data

actruckin

New Member
Joined
Mar 15, 2013
Messages
4
I have to come up with a list of part numbers for my company and I have to come up with all the permutations for part numbers. I started to think that this was a simple manual task until I laid it out and realized the total number of permutations that would be listed. I'm asking for some help on how to set this up if anyone can help.

The (*) in the last column is a place holder that could be a blank (should be) in some part numbers. The whole part number would read from left to right. Any help would be appreciated.

M1311AAH5A*
15
2B1G10BA
173C215CB
204D320C
235E425
266530
3040
3250
4260
5280
60

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Am I reading this right:

part numbers are 10 character alpha-numeric strings
First position - always an M
Second position - one of 13,15,17,20,23,26,30,32,42,52,60
Third position - always a 1
Forth position - one of 1,2,3,4,5,6

etc.. And the task is to list all possible part numbers given the above seeds?

& if that's not it, can you describe again...
 
Upvote 0
Sticking my oar in, but you don't need VBA for this -- you can use MS Query, with the correct setup.
Do the following (I hope you have Excel 2007 or higher or you will run out of rows for the output...)
Place the contents of each column on a new sheet, with the generic headers Heading1 to Heading9 (one heading per sheet, change the heading text for each sheet).
Make sure there are no blank rows or columns, then save the file.
New file, save as the output file and launch MS Query. Pick Excel Files as the file type, navigate to the file you created with the multiple tabs, OK.
In sequence pick the sheets in the order you want to see the columns, then click the > button to add them to the grid. You should see Heading1 to Heading9 lined up below each other. Click OK, then OK for the warning message about not being able to join, then close MS Query (the outer one of the two windows).
You will be prompted to select the cell for the output. Pick A1 on your new file, wiat a while and you will have all permutations.
Now it's a simple case of going to J2 and entering =A2&B2&...&I2. Press ENTER; if you have 2007 or higher you have a data table layout, and all rows in column J will fill with the part nos.
When I ran it the output was around 180 K rows.

Denis
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,844
Members
449,051
Latest member
excelquestion515

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