Possible Combinations/Permutations Question

pikachu

New Member
Joined
Sep 8, 2015
Messages
14
I've got a question with regards to combinations, which is: I need to create combinations (permutations) for the content in two columns, but I only want combinations specific to unique items in Column A (and the matching data in Column B). Here's an example:

1234ABC0
1234ABC1
1234ABC2
1234ABC3
5678XYZ1
5678XYZ2

<tbody>
</tbody>

I want to pull so I get the following:

1234 ABC0
1234 ABC1
1234 ABC2
1234 ABC3
5678 XYZ1
5678 XYZ2

And not:

1234 ABC0
1234 ABC1
1234 ABC2
1234 ABC3
1234 XYZ1
1234 XYZ2
5678 ABC0
5678 ABC1
5678 ABC2 ...

I have thousands of rows of info, so it would be too time-consuming to break out all the unique values in column A. The formula I'm using is:

=IF(ROW()-ROW($F$2)+1>COUNTA(A:A)*COUNTA(B:B),"",INDEX(A:A,INT((ROW()-ROW($F$2))/COUNTA(B:B)+1))&INDEX(B:B,MOD(ROW()-ROW($F$2),COUNTA(B:B))+1))

<tbody>
</tbody>


... As always, thanks! You fine people are lifesavers. :D
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Does the value in column B ever repeat, ie are there duplicate values in column B?
 
Upvote 0
Isn't this just simply...

in C1
=A1

in D1
=B1
and copy down

in C2
=IF(A2=A1,A1,A2)
and copy down
 
Upvote 0
Yeah, I have to apologize. I read this over just now and realize how stupid my original question sounded. Here's what I'm looking for. Consider the following table:

IT 123
IT 123
IT 456IT 456
IT 789IT 789
EM 135EM135
EM 246EM 246
EM 357EM 357

<tbody>
</tbody>

Okay. I want to do the same thing I described earlier for this table. I should have 9 total combinations each for "IT" items and "EM" items (rather than the 36 possible combinations for everything). What's the best way to do this?

Hopefully that makes more sense than me literally asking to make a copy of two columns, hahah. Thanks!
 
Upvote 0
The two columns in post #4 are identical but for a missing space in B4.
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,892
Members
449,194
Latest member
JayEggleton

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