+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : Lookup of rounded number fails for certain numbers

  1. #1
    Registered User
    Join Date
    03-16-2011
    Location
    New England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Lookup of rounded number fails for certain numbers

    In the attached Excel 2007 workbook, test values that round to -0.102 or -0.104 lookup incorrectly, returning the next higher result in the table. Test values that round to the the other values in the lookup range return correct results (e.g. -0.100999, -0.105000). Truncating the rounded value causes all lookups to work, even though the rounded and truncated values test to equality.

    Can someone help me understand why the rounded loookups sometimes fail and justify why the truncation step (seemingly a no-op) is the correct resolution?
    Attached Files Attached Files
    Last edited by wildwilly1111; 03-17-2011 at 04:56 PM. Reason: clarify Excel version

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup of rounded number fails for certain numbers

    It's Excel precision quirks causing that.

    See here for details.

    If you use =ROUND(B1,3) instead of MROUND() it works...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-16-2011
    Location
    New England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Lookup of rounded number fails for certain numbers

    Thanks.

    Sorry - cross-posted at http://www.mrexcel.com/forum/showthread.php?t=536471

+ 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