+ Reply to Thread
Results 1 to 4 of 4

INDEX/MATCH error cannot be explained

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    Indiana
    MS-Off Ver
    Office 2013
    Posts
    40

    INDEX/MATCH error cannot be explained

    Having a bizarre INDEX/MATCH error I cannot resolve.

    In range A1:A20 I have the list of percentages shown below (with corresponding numeric values for each in B1:B20. These column B values are irrelevant, but you could simply use 100.000 for each in column B as it really doesn't matter since the error is during the MATCH check.

    3.000%
    3.125%
    3.250%
    3.375%
    3.490%
    3.500%
    3.625%
    3.750%
    3.875%
    3.990%
    4.000%
    4.125%
    4.250%
    4.375%
    4.490%
    4.500%
    4.625%
    4.750%
    4.875%
    4.990%

    In C1:C20 I have the corresponding "numeric" (non-percentage) value of the percentages in A1:A20, i.e. 3.000, 3.125, 3.250, etc. In column D I am doing a simple INDEX/MATCH function to find the lookup value of C/100 in the A column, and then returning B value.

    I work with INDEX/MATCH all the time in a variety of projects, and the only time I legitimately get an error is if the lookup value is in fact NOT in the lookup range, or there's some data formatting issue and I need to apply some TRIM/CLEAN functions to resolve.

    For the above range of %'s, all return correctly except 3.99%. I can confirm and validate a boolean TRUE/FALSE statement that (C10/100) = A10, but my formula is still returning a "no available value" error for:

    =INDEX($B$1:$B$20,MATCH((C10/100),$A$1:$A$20,0))

    No idea why and no guess as to how and resolve since it is not a data formatting problem that could be cured with TRIM/CLEAN. Any suggestions???

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,621

    Re: INDEX/MATCH error cannot be explained

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: INDEX/MATCH error cannot be explained

    Quote Originally Posted by lsargent View Post
    For the above range of %'s, all return correctly except 3.99%.
    [....]
    =INDEX($B$1:$B$20,MATCH((C10/100),$A$1:$A$20,0))
    Change the formula to =INDEX($B$1:$B$20,MATCH(ROUND(C1/100,5),$A$1:$A$20,0)).

    Round to 5 decimal places because you want comparisons to be accurate to 3 percentage decimal places.

    Do not round to an arbitrary number of decimal places like 10, as some people suggest. There is always example that will fail.

    The problem is an anomaly of 64-bit binary float-point, which is how Excel represents values internally. Consequently, most decimal fractions cannot be represented exactly.

    Note that 3.99% is 0.03990. The internal representation is exactly 0.0398999999999999,97968291864935963531024754047393798828125.

    In contrast, 3.99/100 is represented exactly as 0.0399000000000000,0490718576884319190867245197296142578125.

    I use period for the decimal point and comma to demarcate the first 15 significant digits, which is all that Excel formats.

    MATCH(...,0) does an exact binary comparison. Obviously, the two binary representations are not the same.

    It was only a coincidence that your original formula worked for other values in columns A and C.

    It might be tempting to suggest changing the formula to =INDEX($B$1:$B$20,MATCH(C1/100,$A$1:$A$20,1)).

    But that works, too, only by coincidence. The binary representation of 3.99/100 is larger than the binary representation of 3.99%. But that is not always the case.


    Quote Originally Posted by lsargent View Post
    I can confirm and validate a boolean TRUE/FALSE statement that (C10/100) = A10
    That works because sometimes, Excel "=" does not do an exact binary comparison. Instead, Excel compares the values rounded to 15 significant digits.

    For this particular example, both 3.99% and 3.99/100 round to 0.0399000000000000.

    This is part of a dubious heuristic that is described under the misleading title "Example When a Value Reaches Zero"
    in http://support.microsoft.com/kb/78113.

    The heuristic is not applied consistently. For example, C10/100 - A10 = 0 would return FALSE (!).
    Last edited by joeu2004; 10-28-2016 at 07:58 PM. Reason: cosmetic

  4. #4
    Registered User
    Join Date
    10-08-2012
    Location
    Indiana
    MS-Off Ver
    Office 2013
    Posts
    40

    Re: INDEX/MATCH error cannot be explained

    Abandoned this for a bit and was coming back to post my worked and find out that joeu2004 solved my issue. Thank You!!!!!!!!!!

+ 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. unable to get match property error in userform derived index match
    By alexcrofut in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2015, 09:21 PM
  2. Index, Match and lookups explained (hopefully)
    By Michael in Nanchang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-04-2015, 02:10 AM
  3. [SOLVED] Index and Match Error
    By nironto in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-19-2015, 08:54 PM
  4. INDEX MATCH Error
    By rikapple in forum Excel General
    Replies: 16
    Last Post: 08-17-2014, 03:34 AM
  5. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  6. Index & Match error
    By vb613 in forum Excel General
    Replies: 3
    Last Post: 04-24-2007, 06:12 AM
  7. Index Match #N/A error, please help
    By jhahes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2005, 04:05 PM

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