+ Reply to Thread
Results 1 to 22 of 22

Help: Hlookup against multiple array display closest match

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Help: Hlookup against multiple array display closest match

    Hi. I have been working on matching inexact data for about a month and ran into something that stumped me.

    I used a Fuzzy lookup to match the data that was shared between my two tables. I was able to run 3 different Fuzzy attempts to increase my accuracy because the source data had a lot of spelling errors and such.

    Now I am at a point where I need to analyze the 3 possible Fuzzy matches. I am kinda stumped on the best route to do this and thought that an approximate match Hlookup would be the best route but I can't seem to get it to work.

    Here is a pic of my table: http://i.imgur.com/BmD0B.jpg

    I am trying to match the cell outlined in red against the 3 cells outlined in green, when the best suited match is found I need to copy the green cell and the orange adjacent cells to it's left and right (ID# and Similarity). It would be best if the match threshold was in the low 90% range.

    Any help would be greatly appreciated!
    Attached Files Attached Files
    Last edited by LightingPop; 01-04-2013 at 09:08 PM.

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Help: Hlookup against multiple array display closest match

    "pics" are DEFINITELY not the best way to get answers...a sample WorkBook would help a lot more..
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup against multiple array display closest match

    Example is up. The actual table is about 250,000 rows.

  4. #4
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup against multiple array display closest match

    Any thoughts? I am really stumped.

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Help: Hlookup lookup vaule matching complete table array.

    I am trying to use Hlookup to match a complete table array.

    As in if my lookup value was "1" then every cell in the table array would also be "1" for it to find a match and copy the index cell. This is the function I have: =HLOOKUP(S2,T2:X2,1,FALSE) but this would be a true statement as long as S2 is found even once in T2:X2 but I need it to only be true if it appears in all of T2:X2.

    I think Hlookup is the best way to do this, does anyone have any advice?

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    May be this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    It seems to work, thanks. It produces the text "TRUE" when it finds the matches, is there anyone way to have it copy the cell S2?

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Is there anyone way to have it copy the cell S2?
    Not sure what do you mean in the above sentence

  9. #9
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    Like when the =COUNTIF(T2:X2,S2)=COLUMNS(T2:X2) formula finds a cell that matches the criteria it copies the cell S2 instead of the word "TRUE".

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Help: Hlookup lookup vaule matching complete table array.

    try this...
    =if(COUNTIF(T2:X2,S2)=COLUMNS(T2:X2),S2,"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Quote Originally Posted by LightingPop View Post
    Like when the =COUNTIF(T2:X2,S2)=COLUMNS(T2:X2) formula finds a cell
    I am not aware how the S2 cell is getting the input. Whether it is manually entered? or arrived by any formula used in the S2 cell?

    Do right click on the sheet Tab and select view code and copy and paste any one of the below code which suits for you based on the method of S2 cell value change...

    If S2 cell is manual entry then use this one

    Please Login or Register  to view this content.

    If it is arrived by the formula used in S2 cell then use the below code

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    Awesome thanks a ton.

    Last question: Is there anyway to add to the formula Match If 2 of 6 cell have S2?

  13. #13
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Match If 2 of 6 cell have S2
    Again I am not clear about the above statement

    Match should happen in which range? and T2 to X2 its only 5 cells then how you are getting 6?

  14. #14
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    Yeah between T2 and X2 sorry that was a typo.

    So the formula would be true if 2 of the 5 cells matched the lookup cell S2.

  15. #15
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Change this line

    If bMatchCount = bColCount Then Range("S2").Copy
    To

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    Ugh for the life of me I can't get the code to run. I go to the VBA module and pasted the code but when I go to the "run sub/user form" window there are no saved macros to run. How do I make the code run?

  17. #17
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Yes you wont get it there, since it is a sheet event code so it will trigger automatically when there is any change in S2 cell or if S2 value is arrived via formula then on calculation of the sheet the code will trigger automatically.
    So the code requires any of the above based on the method you used.

    Sent from mobile device

  18. #18
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    O really? Ok. So all I have to do is paste the code into that window and close it and then a change in S2 must occur?

    Is there anyway to make it so I have to run the code in it just runs down the length of the sheet checking for matches the whole way down?

  19. #19
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Yes its possible and the code needs to be altered. but at present I dont have access to computer and posting replies from my mobile device.

    I will post my reply tomorrow that is after 12 hours time, if you dont get any solution.

    Regret for the inconvenience

  20. #20
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    I understand. No problem about the wait, thank you for helping me I really appreciate it.

  21. #21
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Help: Hlookup lookup vaule matching complete table array.

    Is there anyway to make it so I have to run the code in it just runs down the length of the sheet checking for matches the whole way down?
    Ok... based on your above new requirement please explain what action to be performed when looping through each cells of column-s.

  22. #22
    Registered User
    Join Date
    11-13-2012
    Location
    ann arbor
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Help: Hlookup lookup vaule matching complete table array.

    Hi. Sorry about that.

    I am trying to do this: http://oi48.tinypic.com/24fg3h1.jpg

    I thought a pic would make it easiest.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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