Sorting by email address?

GLOpro

Board Regular
Joined
Jul 30, 2005
Messages
113
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
the formula here gives the domainname of an emailaddress.
Code:
RIGHT(A1, LEN(A1)-FIND("@", A1))
you can then sort based on that.
 

GLOpro

Board Regular
Joined
Jul 30, 2005
Messages
113
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?
 

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
yeap. You can also use it inside some other formula, just the way you like it :wink:
 

northwolves

Well-known Member
Joined
Jun 21, 2006
Messages
1,122

ADVERTISEMENT

Add a new column for domains,,then sort ,then delete the new column
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,413
Office Version
  1. 365
Platform
  1. Windows
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
 

Forum statistics

Threads
1,136,309
Messages
5,674,998
Members
419,541
Latest member
freddyboots

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
Top