+ Reply to Thread
Results 1 to 10 of 10

Locate approximate match

Hybrid View

  1. #1
    Registered User
    Join Date
    05-20-2012
    Location
    Taiwan
    MS-Off Ver
    Office 365
    Posts
    47

    Unhappy Locate approximate match

    Hi,

    Please refer to the attached spreadsheet.

    Column A string of text makes up part of Column B.
    Using the formula (refer to spreadsheet), I am able to locate the text in Column A from Column B. But I need it the other way round.

    Could someone help me with the tweak (or change) the formula? I can't seem to be able to.

    escapeT.xlsx

  2. #2
    Registered User
    Join Date
    10-07-2011
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Locate approximate match

    essentially, all you need to change is the reference of the first index array. this will tell it to only pick the cell value from column A, rather than column B.

    =INDEX(A:A,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(B:B,B2)),,),0))
    I think that formula is the one you're looking for?
    to be honest, i'm not sure what you're looking for. you need to explain exactly what you are trying to do.
    for example:
    I want cell D2 to be the formula, to search through column A, to find the cell value with text from cell B2.

    i'm assuming that's what you want, so the formula above seems to work for that. let me know though.
    Last edited by Apelcius; 08-18-2013 at 01:44 AM.
    --Apelcius--
    Learn. Share. Rinse, Repeat.

  3. #3
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: Locate approximate match

    Hi escapes88,

    Please see attached.
    Select a Cell D2 (formula), click fx to the left of the formula (in the formula bar), select either argument and row 7 is selected (wrong).
    Repeat for Cell E2 and row 2 is selected (correct).
    There is no difference between the formulas (except col and row references) so not sure what's causing this incorrect row selection.
    However, if you switch cols A and B, formulas in cols D and E both work (???).
    Would a simple Yes on No in cols D and E suffice ?

    Regards

    peterrc
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Locate approximate match

    @peterrc

    "Select a Cell D2 (formula), click fx to the left of the formula (in the formula bar), select either argument and row 7 is selected (wrong)."

    Actually, the result of 7 for the evaluation of this part of the formula: MATCH(TRUE,INDEX(ISNUMBER(SEARCH(A:A,B2)),,),0) that the OP currently has in cell D2 is perfectly correct. It's just that it's the wrong formula for what they want to do!

    It is, in effect, asking for the row number of the first entry in column A which can be found within the string in cell B2. None of the entries in rows 1-6 meet that criteria; however, the entry in the 7th row (a blank) is to be found within the string in B2, and hence the result of 7.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: Locate approximate match

    Hi XOR LX,

    Thanks for the explanation - very much appreciated - at least I now know why it wasn't working.

    Regards

    peterrc

  6. #6
    Registered User
    Join Date
    05-20-2012
    Location
    Taiwan
    MS-Off Ver
    Office 365
    Posts
    47

    Re: Locate approximate match

    Hi,

    Thanks for the reply.

    And yes, I want cell D2 to be the formula, through column A, to find the cell value with text from cell B2 and the results should be from coloum A.

    But the formula doesnt seem to work when I drag it down.

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Locate approximate match

    Hi,

    Your formula should be:

    =INDEX(A:A,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(B2,A:A)),,),0))

    Regards

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Locate approximate match

    @peterrc

    Sure - no worries. Actually, as an interesting aside to this, (and to redeem myself - I was not strictly correct in stating that the first match was found as a result of a blank being found within the string), it appears that the SEARCH function will return 1 when the search string is "", no matter what the contents of the searched cell, i.e.:

    =SEARCH("",A1) will return 1, regardless of the content of A1 (provided it's not an error, of course).

    Regards

  9. #9
    Registered User
    Join Date
    05-20-2012
    Location
    Taiwan
    MS-Off Ver
    Office 365
    Posts
    47

    Re: Locate approximate match

    Thank you so much, XOR LX your formula works.

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Locate approximate match

    You're welcome.

+ 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] Excel 2007 : Issue with vlookup and approximate match
    By Sylwia in forum Excel General
    Replies: 4
    Last Post: 06-15-2012, 12:25 PM
  2. Find Approximate Match
    By nvallev in forum Excel General
    Replies: 4
    Last Post: 07-06-2011, 07:31 AM
  3. Match or Lookup multiple approximate values from a table
    By fasih in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2009, 11:01 AM
  4. How to Locate a value and display the match item
    By wpm7113 in forum Excel General
    Replies: 7
    Last Post: 05-16-2008, 07:54 AM
  5. Use Match to locate a item in an array
    By chrisrita in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2007, 03:07 PM

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