+ Reply to Thread
Results 1 to 11 of 11

Unreliable MATCH formula

  1. #1
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Lightbulb Unreliable MATCH formula

    When I perform a match in L23, the formula returns 3 but it should be 4. = wrong
    When I perform the same match in L22, but I replace the reference cell L19 with the value in this cell (4,8) I get the right value (it returns 3 as it should be). = right

    In N21 I perform L19=4,8 and it returns TRUE... but why are these formulas not returning the same value?

    matchformula.png
    Column M shows the formula that is behind the cells in column L.

    Thank you for your insight!
    Last edited by Solvax; 05-26-2017 at 05:38 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,227

    Re: Unreliable MATCH formula

    Hi Solvax,

    I always forget the importance of the last parameter/argument in the Match function. For exact match it must be a zero. In your function you have a "1". This means your data must be sorted to get the results you might expect. Are you looking for an exact match?

    Look at the "Match Type" argument in:

    http://www.excelfunctions.net/ExcelMatch.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Unreliable MATCH formula

    Hello marvin,

    I am not looking for an exact match, I am looking for the same or a lower value.
    So I think match type 1 should be correct?


    EDIT:

    To return to my first post..
    To make it easier to understand, I added an excel example file.

    How can F8 and F9 have different values although H8 says they should be the same..
    Attached Files Attached Files
    Last edited by Solvax; 05-25-2017 at 09:06 PM. Reason: added example file

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,641

    Re: Unreliable MATCH formula

    No idea but try to round it:

    =MATCH(ROUND(F6,1),A1:D1,1)
    Quang PT

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,346

    Re: Unreliable MATCH formula

    My best guess -- computer round off error due to binary arithmetic. I suspect that 6.1-2.7 -- because decimals cannot be exactly represented in binary -- is returning a value ever so slightly smaller than 3.4. I don't have Excel on this computer, but I do have QuattroPro and Open Office. In QuattroPro, =6.1-2.7-3.4 returns -4e-16.

    Interestingly, Open Office Calc must do better (or guess better or use more precision or something), because I do not see the problem when I open your file in Open Office Calc. F8 and F9 both return 2 like you would expect.

    bebo's formula should help. Whatever you decide to do, I suspect that this is a result of normal computer round off error, and you will need to think through some kind of round function or other to make sure that your spreadsheet correctly handles these inevitable binary arithmetic errors.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

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

    Re: Unreliable MATCH formula

    HLOOKUP gives the same result. You could do this in F6:

    =ROUND(INDEX(A1:D1,1,MATCH(J3,A2:D2,1))-J2,1)

    It will be to do with a floating point error.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Unreliable MATCH formula

    to go further on MrShorty's response

    if you set excel to precision as displayed
    you will get the result you were expecting

    To enable/disable this option in excel 2010 , go to File > Options > Advanced > When calculating this workbook: > “Set precision as displayed”.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  8. #8
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Unreliable MATCH formula

    I have tried the round function, and it gives me the results i'm expecting.
    Thank you everyone for your kind help!

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,641

    Re: Unreliable MATCH formula

    Got this link (fed by my friend) to explain about this issue:

    https://en.wikipedia.org/wiki/Numeri...icrosoft_Excel

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,266

    Re: Unreliable MATCH formula

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,347

    Re: Unreliable MATCH formula

    Or for those pedantic about not to rounding their data maybe :

    Please Login or Register  to view this content.
    as an array formula (confirm with ctrl+shift+enter)

    I note similar equal items not equaling came up recently in this thread

    https://www.excelforum.com/excel-for...f-anomaly.html
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

+ 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. changing or removing unreliable data
    By Zydrunas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2015, 04:51 AM
  2. [SOLVED] I can't find the reason why function gives unreliable results
    By Hein in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 08-21-2013, 02:57 PM
  3. Application.Calculate being unreliable
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-14-2013, 04:06 AM
  4. Unreliable pivot table
    By amalfaro in forum Excel General
    Replies: 9
    Last Post: 07-16-2012, 10:25 AM
  5. Unreliable macro to create pivot table
    By rockyire in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2007, 10:15 AM
  6. [SOLVED] Scrolling in Excel unreliable
    By Peter in forum Excel General
    Replies: 0
    Last Post: 06-20-2006, 09:35 PM
  7. V Lookup w/ unreliable data
    By hshayh0rn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2006, 04:55 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