Splitting a Column Based on Most Common Values

jimmymmm

New Member
Joined
Jan 15, 2013
Messages
2
Hi,


[TABLE="width: 424"]
<tbody>[TR]
[TD] userid[/TD]
[TD] email[/TD]
[TD]phone[/TD]
[TD]domain[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]a@abc.com[/TD]
[TD]123-123-4425[/TD]
[TD]abc.com[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]b@abc.com[/TD]
[TD]012-123-1232[/TD]
[TD]abc.com[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]c@abc.com[/TD]
[TD]382-228-2383[/TD]
[TD]abc.com[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]d@abc.com[/TD]
[TD]456-744-7821[/TD]
[TD]abc.com[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1@example.com[/TD]
[TD]123-123-3453[/TD]
[TD]example.com[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2@example.com[/TD]
[TD]354-751-6526[/TD]
[TD]example.com[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]3@example.com[/TD]
[TD]456-744-7821[/TD]
[TD]example.com[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]adsd@gmail.com[/TD]
[TD]398-574-4126[/TD]
[TD]gmail.com[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]adfsd@yahoo.com[/TD]
[TD]412-123-1232[/TD]
[TD]yahoo.com[/TD]
[/TR]
</tbody>[/TABLE]


What I'm trying to do is have all rows associated with the most occuring domains copied sheet1, then second most common domain go into sheet2. It will continue alternating between the two sheets: third most will go to sheet1, then fourth into sheet2, and so on.

Since I can use LEN and create a column of just the domains and sort by frequency it appears, is there a macro that could go down the "domain" column and copy all rows of the first value into sheet1, then once it recognizes a different value put those rows into sheet2, etc.?

Really mind boggled. Thank you.
 

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