+ Reply to Thread
Results 1 to 14 of 14

Search for multiple words or values simultaneously

  1. #1
    Registered User
    Join Date
    06-16-2016
    Location
    Barcelona
    MS-Off Ver
    Office 365
    Posts
    6

    Search for multiple words or values simultaneously

    We work with company databases which include large number of emails, and many times we receive databases with personal mails such as hotmail or gmail accounts, or foreign domains (.mx, .it) which we need to delete in order to keep only the corporate local emails.

    I tried using "OR" in the search engine ("hotmail OR gmail OR yahoo...") but it didnīt work since Excel only allows for single word search.

    Is there a formula that allows for multiple word search simultaneously, and then select or highlight for deletion?

    Thank you for your assistance!

  2. #2
    Forum Contributor
    Join Date
    06-14-2016
    Location
    Brookland, Arkansas
    MS-Off Ver
    2007,2021
    Posts
    129

    Re: Search for multiple words or values simultaneously

    Re: Search for multiple words or values simultaneously
    Quote Originally Posted by Marceti View Post
    We work with company databases which include large number of emails, and many times we receive databases with personal mails such as hotmail or gmail accounts, or foreign domains (.mx, .it) which we need to delete in order to keep only the corporate local emails.

    I tried using "OR" in the search engine ("hotmail OR gmail OR yahoo...") but it didnīt work since Excel only allows for single word search.

    Is there a formula that allows for multiple word search simultaneously, and then select or highlight for deletion?

    Thank you for your assistance!
    Take a look at this, as you enter from any of the possible emails into the blacklist category, the emails in the far right column will turn red.
    Attached Files Attached Files

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Search for multiple words or values simultaneously

    One way...

    Data Range
    A
    B
    1
    I use Hotmail
    TRUE
    2
    Don't use Gmail
    TRUE
    3
    Yahoo sucks
    TRUE
    4
    What's this?
    FALSE


    This formula entered in B1 and copied down:

    =OR(ISNUMBER(SEARCH({"Hotmail","Gmail","Yahoo"},A1)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,915

    Re: Search for multiple words or values simultaneously

    Or try this ...

    =MAX(COUNTIF(A1,{"*Hotmail*","*Gmail*","*Yahoo*"}))>0

  5. #5
    Registered User
    Join Date
    06-16-2016
    Location
    Barcelona
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Search for multiple words or values simultaneously

    The first attached formula seems to be the closest to the answer that Iīm looking for.

    In the "email" column, I pasted 30 different emails, some which contained "hotmail" and "yahoo", and after writing "hotmail" and "yahoo" in the "blacklist" column the emails containing theses values did not turn red.

    Perhaps a formula that "contains" instead of is "equal to" the words that weīre looking for would solve the issue.

    Thanks again.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Search for multiple words or values simultaneously

    Deleted content
    Last edited by Tony Valko; 06-17-2016 at 05:55 AM.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Search for multiple words or values simultaneously

    Try this...

    Assuming the "blacklist" is in the range A9:A13 and does not contain any empty cells.

    Then, use this formula in conditional formatting:

    =OR(ISNUMBER(SEARCH(A$9:A$13,D2)))

  8. #8
    Forum Contributor
    Join Date
    06-14-2016
    Location
    Brookland, Arkansas
    MS-Off Ver
    2007,2021
    Posts
    129

    Re: Search for multiple words or values simultaneously

    In the blacklist box you only need to enter the site of the email address (yahoo,gmail,etc.) I updated the sheet so it will now find those names within the persons email address and highlight those cells red. Take a look.
    Attached Files Attached Files
    Who needs a life when you have Excel.

  9. #9
    Registered User
    Join Date
    06-16-2016
    Location
    Barcelona
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Search for multiple words or values simultaneously

    Hello and thank you for your support. This did it for me.

    The results however do not select (we would need to delete all selected) but rather highlight. What I did here was created a personalized filter where all highlighted cells are brought up, and then proceeded to select and delete them.

    If there is a quicker way to select all highlighted results let me know. Otherwise we really appreciate your help.

    Thank you!

  10. #10
    Forum Contributor
    Join Date
    06-14-2016
    Location
    Brookland, Arkansas
    MS-Off Ver
    2007,2021
    Posts
    129

    Re: Search for multiple words or values simultaneously

    I have an idea that might work, when I get a spare minute I will upload a version 3 of my sheet with that capability. If my theory ends up not working I'll also let you know.

  11. #11
    Registered User
    Join Date
    06-16-2016
    Location
    Barcelona
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Search for multiple words or values simultaneously

    OK thank you!

  12. #12
    Forum Contributor
    Join Date
    06-14-2016
    Location
    Brookland, Arkansas
    MS-Off Ver
    2007,2021
    Posts
    129

    Re: Search for multiple words or values simultaneously

    Quote Originally Posted by Marceti View Post
    OK thank you!
    Bad news it didn't work. I was able to get my concept to work on a test sheet (Test Find_V2), but when I transferred the macros over to the Sample email sheet it did not work.

    I'll attach both documents, maybe someone can point out what I did wrong.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-16-2016
    Location
    Barcelona
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Search for multiple words or values simultaneously

    OK donīt worry we have tried your second formula, and with the personalized filter to bring up highlighted cells and deleting them, it works out perfectly for us.

    Thank you for your support!!!

  14. #14
    Registered User
    Join Date
    06-16-2016
    Location
    Barcelona
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Search for multiple words or values simultaneously

    Hello again.

    I have a question regarding your formula. Is there a way to "lock" the rules in the conditional format?
    Let me explain: When we cut and paste emails to (or from) D column; or if we eliminate duplicates from D column, the values in the rules of the conditional format change; so we need to constantly open the conditional format to check if the rules are ok.

    Hopefuly the explanation was understood.

    Thank you for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Search for Values in Multiple Data Tables Simultaneously
    By slumeet in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-05-2016, 01:33 PM
  2. Search for Values that Multiple Search Words Share
    By Drew67209 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2014, 05:54 AM
  3. [SOLVED] Search box in Excel to search key words in sentences in multiple worksheets
    By fernandoii676 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2012, 01:42 PM
  4. Replies: 2
    Last Post: 10-19-2012, 11:11 AM
  5. Search for multiple strings simultaneously
    By denverdale in forum Excel General
    Replies: 5
    Last Post: 03-08-2011, 03:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1