+ Reply to Thread
Results 1 to 11 of 11

number not recognised by Match function

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    Santa Cruz, CA
    MS-Off Ver
    Excel for Mac 2011
    Posts
    10

    Question number not recognised by Match function

    hey guys, I ran into a little weird issue. So I have a formula that rounds a certain number to 0.10. And then an index match function will use that number again. The match function does not recognise the number though.

    The value is 110.20 in cell B1. If I overwrite it with hardcoded 110.20, then the match function recognises it. I did a check by writing 110.20 in a different cell (A1), and then doing =A1=B1 with B1 being the formula value. And that says it is true. So there is no 110.1999999999999 going on or something like that.

    When I round to 0.5 and to 0.25, there is nothing going wrong. Does someone have any clue what this could be?

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: number not recognised by Match function

    Do you have a sample sheet for us to look at? Upload it to this thread. Usually when ROUND is involved it tends to be the reason the MATCH function acts weird, but we won't know until we see your work.

    - Moo

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: number not recognised by Match function

    If B1 is the calculated value 110.20, try these test formulas EXACTLY as shown:

    =(B1-110.20)=0

    =(B1-110.20) Format this one as Number and take it out to about 30 decimal places.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: number not recognised by Match function

    0.1 (and 0.2 therefore) does not have an exact representation in binary - it is a recurring decimal. Hence any way of representing it will have rounding errors, rather like 0.6666667 is not the same as 2/3 and neither is 0.66666666.

    Hope this helps.

    Pete

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

    Re: number not recognised by Match function

    Pete wins the answer contest, IMHO.

    Read http://www.cpearson.com/excel/rounding.htm for more information.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: number not recognised by Match function

    Quote Originally Posted by MarvinP View Post
    Pete wins the answer contest, IMHO.
    Is there a prize for that? LOL

    - Moo

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: number not recognised by Match function

    If there is a floating point rounding error it will be revealed by the test formulas I suggested.

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

    Re: number not recognised by Match function

    Hey Moo,

    Great question. I read a lot of these answers and many times wonder how the answer relates to the question. When the answer doesn't tell which cell the formula goes in and it relative based, it makes me wonder if it is any help or not. If the OP should supply a workbook so we understand the answer, why shouldn't we be supplying a sample with our formulas in it? We might at least supply a link that explains what we mean or give a source to our answer.

    I thought Pete's answer was a better example of what I'd like to have. I guess that makes him a winner in my book.

  9. #9
    Registered User
    Join Date
    09-24-2012
    Location
    Santa Cruz, CA
    MS-Off Ver
    Excel for Mac 2011
    Posts
    10

    Question Re: number not recognised by Match function

    Wow, looks like I opened up a can of worms here :-) Please find attached a sample sheet.

    I would say Pete and Marvin are the winners here for explaining the binary issue. Especially after I read the rounding article on cpearson.com.

    Tony Valko's little formula proved the point though. =B1-110.20 did not give any value on the first 30 decimals. =(b1-110.20)=0 did give a FALSE though.

    Any way I can work around this guys? Like multiplying and then divide in the end or so? I can change the match type but that feels wrong.
    Attached Files Attached Files
    Last edited by st!ngray; 01-28-2013 at 05:00 AM.

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: number not recognised by Match function

    Try this in D3, Drag/Fill Down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  11. #11
    Registered User
    Join Date
    09-24-2012
    Location
    Santa Cruz, CA
    MS-Off Ver
    Excel for Mac 2011
    Posts
    10

    Re: number not recognised by Match function

    Perfect,thanks. It does not look pretty but hey it works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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