Sorting by email address?

GLOpro

Board Regular
Joined
Jul 30, 2005
Messages
117
How can i make excel sort by email address? But exclude the first part of the email address and only sort by the domain?

ie. name@company.com

Its easy to sort by name, but how do i make it sort by company/domain???
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
the formula here gives the domainname of an emailaddress.
Code:
RIGHT(A1, LEN(A1)-FIND("@", A1))
you can then sort based on that.
 
Upvote 0
the formula here gives the domainname of an emailaddress.
Code:
RIGHT(A1, LEN(A1)-FIND("@", A1))
you can then sort based on that.

Thanks Harvey for the speedy reply.

Just to ensure that i have understood this properly, this should be used in a new column that will then extract the domain name, thus allowing me to sort by that column?
 
Upvote 0
yeap. You can also use it inside some other formula, just the way you like it :wink:
 
Upvote 0
Add a new column for domains,,then sort ,then delete the new column
 
Upvote 0
A. An alternative formula for the domainname is:
=REPLACE(A1,1,FIND("@",A1),"")

B. If you don't want/need lots of formulas, then another method to make the extra column to sort on is this:
1. Select the column of email addresses and copy/paste to an adjacent empty column.
2. Select the new column.
3. Edit|Replace...|Find what: *@|Replace with: leave blank|Replace All|OK|Close
 
Upvote 0

Forum statistics

Threads
1,217,357
Messages
6,136,081
Members
449,990
Latest member
orthodmd

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