+ Reply to Thread
Results 1 to 14 of 14

lookup cell and report back the best matching result

  1. #1
    Registered User
    Join Date
    12-11-2016
    Location
    cardiff uk
    MS-Off Ver
    2016
    Posts
    9

    lookup cell and report back the best matching result

    Pulling on your expertise, I am learning as I go, no one told me Excel was so powerful...

    Ok, so I use Vlookup daily and never an issue HOWEVER

    I need to use Vlookup or match or another condition or group to pull data in as a best match.

    I have attached a spreadsheet.

    if anyone can point me in the right direction I will be very greatful.

    so I have a cell, I want to search for the closest matching cell in a collumn and report back an adjacent cell

    (exactly the same as Vlookup but with closest match rather than perfect match.

    Thank you so much for looking at this.
    Attached Files Attached Files
    Last edited by jaamba123; 12-12-2016 at 12:39 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,806

    Re: lookup cell and report back the best matching result

    What if there are two potential matches that cannot be separated (i.e. one is no better than the other)?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-11-2016
    Location
    cardiff uk
    MS-Off Ver
    2016
    Posts
    9

    Re: lookup cell and report back the best matching result

    Hi AliGW

    It would be good if it reported query in this instance however if the data is the same then the part number adjacent should be the same.

    It is the same data in different layouts and different formats but once it is matched 99% should report same part number.

    Thank you for looking, very much appreciated.

    James

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,806

    Re: lookup cell and report back the best matching result

    OK. Let's put it another way! Please could you provide a copy of your sample spreadsheet with your expected outcomes filled in manually and tell us why you think they are the best fit?

  5. #5
    Registered User
    Join Date
    12-11-2016
    Location
    cardiff uk
    MS-Off Ver
    2016
    Posts
    9

    Re: lookup cell and report back the best matching result

    Hello AliGW

    I am sorry I do not explain myself so well, I have edited the spread sheet to show what I am hoping for, I have used colours to show how I would like it to search and report.

    I will explain myself a little more in depth

    I have a website database that is in blocked fitment (sheet 1) (blocked year to year, make model"s")

    I have managed to source manufacturer data that is in single year (sheet 2) (Year, Make, Model)

    If the year make model can be matched between both and part number reported. (with out rewriting one or other file) It will save me a massive amount of time.

    I could import the data to website as I have it given to me but it is not as friendly and I believe makes it harder for people to search and use website.

    James

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,806

    Re: lookup cell and report back the best matching result

    OK - that's clearer now, thanks. Going to have to ponder this one! There are lots of real gurus around here who will no doubt see a solution faster than me.

  7. #7
    Registered User
    Join Date
    12-11-2016
    Location
    cardiff uk
    MS-Off Ver
    2016
    Posts
    9
    Quote Originally Posted by AliGW View Post
    OK - that's clearer now, thanks. Going to have to ponder this one! There are lots of real gurus around here who will no doubt see a solution faster than me.
    Thank you 👍

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: lookup cell and report back the best matching result

    Hi jaamba123 and welcome to the forum.

    If I have interpreted correctly this does what the instructions state.

    It requires two helper columns to establish the year ranges. In sheet 1 enter this in cell C2 (done in the attached). Then fill down and across column D.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in B2 array enter this formula and fill down. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  9. #9
    Registered User
    Join Date
    12-11-2016
    Location
    cardiff uk
    MS-Off Ver
    2016
    Posts
    9

    Re: lookup cell and report back the best matching result

    Thank you Flame Retired for your help and I must say you have done exactly what I asked and I am so grateful, I have spent days trying to understand and modify this so I can run it in a sheet with 16,000 columns not just the 45 in this sheet but alas failed miserably, I think I understand what you have done and think I can follow it "almost" but to replicate it is far over and above my ability.

    are there restrictions to using this formula

    James

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: lookup cell and report back the best matching result

    Quote Originally Posted by jaamba123 View Post
    Thank you Flame Retired for your help and I must say you have done exactly what I asked and I am so grateful, I have spent days trying to understand and modify this so I can run it in a sheet with 16,000 columns not just the 45 in this sheet but alas failed miserably ........
    James
    16000 rows

    That changes everything.

    I would guess it is taking a very long time to calculate if it doesn't crash Excel.

    If you are not aware of it array formulas are resource hungry. That creates a challenge.

    With that in mind I will attempt another formula solution. If I can it will likely require several helper columns.

    In the meantime I managed to shorten the array formula to this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: lookup cell and report back the best matching result

    This might be of some use to you. If you make a data table out of the data on Sheet2, you can substitute the names of the columns into the formula given by FlameRetired and you should be able to handle all the rows without further amendment.
    Here is FlameRetired's formula using Table references (the ranges automatically increase as the table increases). You will see that all reference to Sheet2 has been replace with a reference to Table1 with the appropriate column header from the table. This is still an ARRAY formula so enter with Ctrl+Shift+Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: lookup cell and report back the best matching result

    Why not just add filters to the data on Sheet2 and use the filters to extract the data that you want to see? You can select date ranges, models etc and matching data will be presented to you without having to use formulae to extract the data.
    Example:
    Capture.JPG

  13. #13
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: lookup cell and report back the best matching result

    I think newdeoverman's idea of filtering is the way to go.
    Just to offer another option - if you want to extract data to another sheet using filters then you might consider using Advanced Filter with multiple criteria.

    Here is a link to Advanced Filter tutorials on YouTube

    Here are a couple of links to web tutorials:
    Excel-Easy: Advanced Filter
    Contextures: Introduction to Advanced Filter
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: lookup cell and report back the best matching result

    Here is a copy of your example workbook with an Advanced Filter used. I changed the name of the worksheets to make the example filter more clear.
    Instructions on how to do this are included.
    Attached Files Attached Files

+ 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] Lookup to bring back first cell in the reference
    By 2136gamer in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 03-17-2015, 08:28 PM
  2. Pass function result to cell, not back to sub
    By GCW esq in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-02-2014, 05:29 PM
  3. Replies: 1
    Last Post: 08-29-2014, 11:57 PM
  4. Array Formula Lookup - Bring back Lowest Date + Bring Back Cell Location
    By Matt1998 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2014, 12:08 PM
  5. Hyperlinking back to cell with matching data
    By mattmc419 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2013, 07:25 PM
  6. lookup/report back a value and column header
    By tooleyr in forum Excel General
    Replies: 2
    Last Post: 01-14-2011, 04:36 PM
  7. Replies: 1
    Last Post: 10-22-2009, 05:26 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