+ Reply to Thread
Results 1 to 11 of 11

Formula needed for looking up matching text in separate data sets

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    USA, NY
    MS-Off Ver
    Excel 2013
    Posts
    7

    Formula needed for looking up matching text in separate data sets

    Hey guys, sorry for the weirdly worded title but basically I need to be able to search for matching text inside one workbook. This is better illustrated in the attached excel file.

    In the test example, I need something where if I search for "John", the formula or lookup will highlight all cases of "John" in both sets of data. Ideally I would need an interchangeable formula where the lookup keyword can change, e.g. searching for either, "John", "John Smith" or "[email protected]".

    Let me know if this feasible and thanks in advance!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Formula needed for looking up matching text in separate data sets

    Is this what you are looking for? Any cell that contains whatever is in M1 is highlighted green. It is done via conditional formatting, and is non case sensitive. If you want it to be case sensitive change the CF formula from SEARCH to FIND.
    test test.xlsx
    Please add reputation by clicking on the * if I have helped.
    Please mark the thread SOLVED if your issue has been resolved.
    Thanks, Glenn.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Formula needed for looking up matching text in separate data sets

    Change the Contents of B1 to run the macro.

    To view the macro right click on the sheet name at the bottom of excel and select view code.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Formula needed for looking up matching text in separate data sets

    Clever Solution GAK67

  5. #5
    Registered User
    Join Date
    07-17-2014
    Location
    USA, NY
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Formula needed for looking up matching text in separate data sets

    Awesome suggestions, thanks so much for the help guys!

  6. #6
    Registered User
    Join Date
    07-17-2014
    Location
    USA, NY
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Formula needed for looking up matching text in separate data sets

    Quick question GAK67, is there a way to copy the set-up of that cell over to my main worksheet or would I have to replicate it with conditional formatting? If so, would you be be able to give a brief walk through?

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Formula needed for looking up matching text in separate data sets

    Can I explain for you GAK67?

    Gak67 selected all the cells in the worksheet by clicking on the grey triangle at the top left of the spreadsheet.

    They then clicked on conditional formatting

    Insert new rule

    Use a formula

    And then he entered the formula

    Please Login or Register  to view this content.
    This code is written as if for the first cell in the range, A1 but will apply to all cells in the range, excel translates the formula for you,
    All you need to do is to make sure it works in A1 and it will work similarly in all cells in the range.

    The formula searches for the text in cell M1 in cell A1.

    Note that M1 is written $m$1, that means that as you move from cell to cell within your range, your formula will always refer to column M, $M and row1 $1.
    A1 is written without $'s because you want the row and column to change, for every cell in your range. Because you want to look in every cell in your range.

    finally >0, if the search text is found in your cell then the return the position of the search text, which will be greater than zero.

    Finally if the formula is true, The fill colour is changed to Green, click on format and fill to do that.l

  8. #8
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Formula needed for looking up matching text in separate data sets

    Thanks for the explanation mehmetcik (I wasn't online over the weekend). To add to it, to copy the formatting to another sheet, go through the same process as mehmetcik said on the new sheet, or Copy, Paste Special, Formats, but be careful as doing that will clear other formatting you might have already set up in the new sheet.
    Last edited by gak67; 07-20-2014 at 05:27 PM.

  9. #9
    Registered User
    Join Date
    07-17-2014
    Location
    USA, NY
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Formula needed for looking up matching text in separate data sets

    Hey guys, thanks for all your help, I really appreciate it. However, I was wondering if there was a formula that will highlight all cases of whatever I plug into the formula in the data-set (if I plug in "John" it doesn't matter if "John" is located by itself, within an email, or as part of a first-name/last-name ala "John", "[email protected], or "John Smith").

  10. #10
    Registered User
    Join Date
    07-17-2014
    Location
    USA, NY
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Formula needed for looking up matching text in separate data sets

    Some further clarification as to what I need, is there a way to analyze both data sets at once and simply determine if there is a match for the data in both sets?

  11. #11
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Formula needed for looking up matching text in separate data sets

    Quote Originally Posted by computer1234 View Post
    Hey guys, thanks for all your help, I really appreciate it. However, I was wondering if there was a formula that will highlight all cases of whatever I plug into the formula in the data-set (if I plug in "John" it doesn't matter if "John" is located by itself, within an email, or as part of a first-name/last-name ala "John", "[email protected], or "John Smith").
    My solution does that. B3, D3, H3 and I3 are all highlighted green, B3=John, [email protected], H3=John Smith and [email protected]

+ 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] Matching sets of data, need to line up, so adding rows when needed
    By jolenec in forum Excel General
    Replies: 12
    Last Post: 03-16-2014, 04:13 AM
  2. Data matching formula needed!
    By Rohan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-21-2014, 11:25 AM
  3. Formula needed for dividing 2 sets of cells and excluding adjacent text cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 06:45 PM
  4. Replies: 6
    Last Post: 01-22-2012, 12:39 PM
  5. Replies: 1
    Last Post: 01-12-2012, 04:37 AM

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