+ Reply to Thread
Results 1 to 6 of 6

Match Index to an approximate value

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Pennsylvania, USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Match Index to an approximate value

    Hi everyone,

    I really appreciate any assistance that can provide. I will attach a sample template of the issue that I describe below. I am using the match, index and vlookup formulas together to pull information. The issue with the formula that I have is that if the information found in column B(always a number) is not found I want it to go to the previous value and pull the value found in column C. I feel like I explained that terribly so hopefully the attached spreadsheet will demonstrate my issue more clearly. I have the data in columns A, B and C. The formula found in G3 works but only when the value found in H1 is also matching to the chart data this is formula used in G3: {=INDEX($C$1:$C$24,MATCH(VLOOKUP($F$1,$A$1:$C$24,1,FALSE)&VLOOKUP($H$1,$B$1:$C$24,1,FALSE),$A$1:$A$24&$B$1:$B$24,0))}

    To account for wanting to find the approximate value in column b i changed the vlookup for that portion of the formula to TRUE. However, it only works some of the time, and I can't find a rhyme or reason when and why. The formula I tried in G11 is: {=INDEX($C$1:$C$24,MATCH(VLOOKUP($F$1,$A$1:$C$24,1,FALSE)&VLOOKUP($H$1,$B$1:$C$24,1,TRUE),$A$1:$A$24&$B$1:$B$24,0))}. In the case of this formula I would want the value to return $0.98 which is the next lowest value found in column B.

    Please let me know if any further clarification is needed.

    Thanks again!
    Attached Files Attached Files
    Last edited by bturner73; 05-20-2016 at 03:15 PM.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Match Index to an approximate value

    Try this array formula in G11
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Match Index to an approximate value

    What do you mean by "previous value?" Do you mean one shipment number less? Or do you mean the value above it in the table (which doesn't make sense since you can't find it)? Or do you mean the value that is next lowest in line, such as in the example, 14 is not found for 123 company so 9 is the next lowest number in line.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Match Index to an approximate value

    Wait a minute. I think I figured this out.

    First you have to find the shipment range that goes with the company name: IF(Table1[Company]=F9,Table1[Shipment],FALSE)

    Then we look for the value using VLOOKUP with the True flag (since shipments appear to be ordered ascending) VLOOKUP(H9,IF(Table1[Company]=F9,Table1[Shipment],FALSE),1,TRUE)

    This gets us the number or the number above it. So for company 123 and shipment 14, 14 isn’t found so it jumps up one to 10.

    Then we need to find out where shipment 10 is (assuming shipment numbers are unique): MATCH(VLOOKUP(H9,IF(Table1[Company]=F9,Table1[Shipment],FALSE),1,TRUE),Table1[Shipment],0)

    And finally, we take the index of that: =INDEX(Table1,MATCH(VLOOKUP(H9,IF(Table1[Company]=F9,Table1[Shipment],FALSE),1,TRUE),Table1[Shipment],0),3)

    As an array formula, of course.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-12-2015
    Location
    Pennsylvania, USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Match Index to an approximate value

    Thank you both very much, after working through both formulas they appear to do the same thing just in two slightly different ways (unless I am missing something).

    Thank you both once again it is much appreciated!

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Match Index to an approximate value

    Quote Originally Posted by bturner73 View Post
    Thank you both very much, after working through both formulas they appear to do the same thing just in two slightly different ways (unless I am missing something).

    Thank you both once again it is much appreciated!
    I think you are missing. Then formula by dflak will fail if you change values in H1. BTW, you don't need two formulas. The one I provided will work with all values.

+ 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. Need first approximate match returned
    By RRW119 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-09-2015, 10:19 AM
  2. match approximate 2 column
    By alaaabouelazm in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-24-2015, 12:08 PM
  3. [SOLVED] index match - 2 criteria, one approximate
    By abhishek007 in forum Excel General
    Replies: 11
    Last Post: 04-11-2015, 05:46 PM
  4. Index(Match) with 2 criteria, one of which is approximate
    By mikeronni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2014, 01:38 PM
  5. [SOLVED] INDEX & MATCH for approximate matches or combine VLOOKUP & HLOOKUP
    By michaljireht in forum Excel General
    Replies: 4
    Last Post: 12-01-2014, 08:41 PM
  6. [SOLVED] Locate approximate match
    By escapes88 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-18-2013, 10:18 AM
  7. Find Approximate Match
    By nvallev in forum Excel General
    Replies: 4
    Last Post: 07-06-2011, 07:31 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