How do I isolate all company addresses ?

Maverick27

Active Member
Joined
Sep 23, 2010
Messages
329
Office Version
  1. 2013
Platform
  1. Windows
Attn all Excel Gurus

I have an Excel sheet of 500K Email Addresses.

How do isolate all company addressess eg addresses which DON'T have the following domains ?

@Yahoo ;
@gmail ;
@Hotmail ;
@Live ;
@ymail ;
@msn

Anyone care to share a Excel function or Macro to filter out the company address domains.

Below is a screenshot of the Excel list.

Thanks in Advance.

excel.jpg
 
I've run some tests on 300k rows of data & it definitely doesn't work, I only end up with about 34k rows visible when there should be a lot more.
i think transpose works like mod 65.536, for example 300,000 rows => 300,000 mod 65536 = 37,856
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
But you didn't get an error?
No error, just filtered out a lot of rows that should be visible.

This method is not based on partial matches. With the filter(filter(filter method, it also finds "@live.uk.nl" because the word "@Live" is found
Yes but the Filter method will also filter out something like @Livery_Stables.com
 
Upvote 0
Yes of course, could be enough if there aren't email addresses like that. The Regex will do, but the transpose limit ruins it again(n)
 
Upvote 0
+1.000.000 rows, 0,4 sec
perhaps add an extra "." for extensions "hotmail.com", "hotmail.be", etc
VBA Code:
FL = Filter(FL, it [U][I][B]& "."[/B][/I][/U], 0, vbTextCompare)
(tried to underline and bold the & "." but didn't work out)

VBA Code:
Sub TestPlus65000()
     Dim b()   As Variant
     a = ActiveSheet.UsedRange.Resize(, 2)
     ReDim b(1 To UBound(a))
     For i = 1 To UBound(a): b(i) = a(i, 1): Next
     FL = Filter(b, "@", 1, vbTextCompare)

     For Each it In Array("@Yahoo", "@gmail", "@Hotmail", "@Live", "@ymail", "@msn")
          If UBound(FL) = -1 Then Exit For
          FL = Filter(FL, it, 0, vbTextCompare)
     Next
     If UBound(FL) = -1 Then
          MsgBox "nothing left"
     Else
          MsgBox Join(FL, vbLf), vbInformation, UCase("emailaddresses left")
     End If

End Sub
 
Last edited:
Upvote 0
+1.000.000 rows, 0,4 sec
perhaps add an extra "." for extensions "hotmail.com", "hotmail.be", etc
VBA Code:
FL = Filter(FL, it [U][I][B]& "."[/B][/I][/U], 0, vbTextCompare)
(tried to underline and bold the & "." but didn't work out)

VBA Code:
Sub TestPlus65000()
     Dim b()   As Variant
     a = ActiveSheet.UsedRange.Resize(, 2)
     ReDim b(1 To UBound(a))
     For i = 1 To UBound(a): b(i) = a(i, 1): Next
     FL = Filter(b, "@", 1, vbTextCompare)

     For Each it In Array("@Yahoo", "@gmail", "@Hotmail", "@Live", "@ymail", "@msn")
          If UBound(FL) = -1 Then Exit For
          FL = Filter(FL, it, 0, vbTextCompare)
     Next
     If UBound(FL) = -1 Then
          MsgBox "nothing left"
     Else
          MsgBox Join(FL, vbLf), vbInformation, UCase("emailaddresses left")
     End If

End Sub
Output

output.jpg
 
Upvote 0
After all, you can use a helper column.
Pull this down and then filter for false in that column

Excel Formula:
=ISNUMBER(LOOKUP(100,SEARCH({"@Yahoo.","@gmail.","@Hotmail.","@Live.","@ymail.","@msn."},A2)))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,946
Members
449,198
Latest member
MhammadishaqKhan

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