+ Reply to Thread
Results 1 to 5 of 5

Match Function Not Returning Right Value

  1. #1
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Match Function Not Returning Right Value

    I am using the Index/Match function to find a value in an array and I am not sure why the match
    function is returning the wrong value. The data is as follows:

    Search array:

    A1 = 0
    B1= 9999
    C1= 0
    D1= 0
    E1= 0


    Formula using: Match(221,A1:E1,1)

    Based on what I read on how the match function is to work, the match type of 1 would find the
    largest value that matches the lookup value exactly or less than. Thus, it seems to me that
    the formula I have above should return the value of "1" because 221 is less than 9999. But, it
    is returning the value "5". Why is that?

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Match Function Not Returning Right Value

    Hi,

    For the ",1" argument to work, the lookup range needs to be in ascending order.

    https://support.microsoft.com/en-us/...rs=en-us&ad=us
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Match Function Not Returning Right Value

    The help file (https://support.microsoft.com/en-us/...9-533f4a37673a ) also explains that, when the 3rd argument is 1, the lookup values must be sorted in ascending order. In your example, they are not sorted, so the MATCH() will return incorrect results. I expect that internally MATCH() makes the observation that 221 is larger than the last (5th) entry in list (which is 0) and is returning 5 to reflect that observation.

    Solution is to sort row 1 left to right so that the 4 0s are in A1:D1 and E1 is 9999. If that is not possible, then you need a different approach to the lookup.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Match Function Not Returning Right Value

    Thank you very much for the link and the guidance. Sometimes Excel doesn't work as one would think it would.

  5. #5
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Match Function Not Returning Right Value

    Thank you for your reply and solution. I entered the data as you had indicated & Excel comes back with position 4,
    which I guess makes sense insofar as 4 is the "next lowest value" as referenced in the link to Microsoft support.
    So, I just have to restructure how I go about getting the value.

+ 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. If function with Index Match Returning #value
    By aking3806 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-08-2018, 12:21 PM
  2. [SOLVED] Index Match function returning #N/A
    By jac89 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-14-2017, 09:28 PM
  3. [SOLVED] Using MATCH function but returning both unique instances of match
    By bigmantitus in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-09-2013, 07:29 PM
  4. OFFSET/MATCH function not returning values
    By mjwebb07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2013, 02:27 AM
  5. Match Function returning #N/A
    By ron2k_1 in forum Excel General
    Replies: 3
    Last Post: 05-31-2011, 11:14 AM
  6. Match function not returning the right value
    By ih8xc in forum Excel General
    Replies: 2
    Last Post: 12-26-2010, 03:17 PM
  7. Index and Match function returning same values
    By Climaxgp in forum Excel General
    Replies: 4
    Last Post: 12-15-2009, 05:59 AM

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