+ Reply to Thread
Results 1 to 5 of 5

Compare Two columns, find a partial match and return occurrences

Hybrid View

  1. #1
    Registered User
    Join Date
    02-14-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Compare Two columns, find a partial match and return occurrences

    Hi, I really need help with this formula - I've tried several things and none of them have worked.

    I have Two columns A and B. They both have Headers, so the names begin from row 2 onwards....

    I need to see if the name in A2 appears anywhere in column B, and if it does, I need a yes/no (or better yet, would it be possible to say it appears x number of times, for example?)

    Another thing, I need to know if the entire name in A2, appears anywhere in column B, but it doesn't have to be an exact match. So if I'm looking for "car" in column B, I need it to match "car", "cartoon", "supercar" etc.

    Thanks so much!!!

  2. #2
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Compare Two columns, find a partial match and return occurrences

    Array enter (Ctrl+Shift+Enter)...
    Formula: copy to clipboard
    =COUNT(IF(LEN($B$2:$B$?)>LEN(SUBSTITUTE($B$2:$B$?,A2,"")),1,""))

    ...where ? is the extent of column B. Then copy or drag down.

  3. #3
    Registered User
    Join Date
    02-14-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Compare Two columns, find a partial match and return occurrences

    Thanks for the response. I'm not sure I understand the array part...? I'm using excel on a mac. I tried using ctrl+shift+enter and nothing happens? Do I have to select something first? I pasted the formula in C2 but it just says 0 when I drag down.

  4. #4
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Compare Two columns, find a partial match and return occurrences

    Copy formula in my post. Put cell C2 (or any row 2 cell of a blank column) in edit mode (either in cell or in formula bar). Paste. Replace 2x? as directed. (Mac) Press ^+↑+Return.

    Sorry, I wasn't aware Excel Mac had different array formula entry confirmation.

    Array formula:
    Mac entry confirmation... https://exceljet.net/keyboard-shortc...-array-formula
    General info... https://www.google.com/search?q=excel+array+formula

  5. #5
    Registered User
    Join Date
    02-14-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Compare Two columns, find a partial match and return occurrences

    Thanks for your response, but unfortunately I still wasn't able to get it work. But I found another way, I just used the Countif formula along with &"*" wildcard to find matches and get a total count of the number of matches. But I did learn something new about working with arrays, so thanks again!

+ 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] Find partial match between two columns and highlight cells that match
    By TomToms in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-18-2019, 01:07 PM
  2. [SOLVED] How to compare partial text in two columns and return value from adjacent cell
    By Ghys772 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-07-2014, 07:43 AM
  3. how to compare partial match in two columns
    By santosh.themagic in forum Excel General
    Replies: 4
    Last Post: 08-19-2013, 08:09 AM
  4. Replies: 2
    Last Post: 02-20-2012, 11:42 PM
  5. How to compare partial match in two columns
    By martinaquan in forum Excel General
    Replies: 2
    Last Post: 08-25-2010, 02:15 PM

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