+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP Error when lookup value references a cell that is a sum.

  1. #1
    Registered User
    Join Date
    10-03-2007
    Posts
    21

    VLOOKUP Error when lookup value references a cell that is a sum.

    Hi,

    I am having an issue with Vlookup and would really appreciate some help.

    When using the Vlookup function I keep getting random #N/A errors. The lookup value is referring to a cell that is a "sum" of several cells. It works sometimes but other times it throws a #N/A error. When I replace the value with the same exact number it works.

    For example:
    -A1 is the lookup value (7.20)
    -A1 references F14
    -F14 =SUM(F1:F13); which is 7.20
    -B2 is the Vlookup function and the lookup value =A1 but is throwing the #N/A error.
    -When I replace A1 with the actual number 7.20 it works just fine.

    Please see attached and thank you for your time!
    Attached Files Attached Files
    Last edited by Joeg101; 05-31-2013 at 12:06 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VLOOKUP Error when lookup value references a cell that is a sum.

    hmm weird, but this fixed it...

    A1 =ROUND(F14,2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: VLOOKUP Error when lookup value references a cell that is a sum.

    Fdibbins already provided to workaround

    but those that want to know why
    Floating point bug
    http://support.microsoft.com/kb/315961
    Last edited by humdingaling; 05-31-2013 at 02:21 AM.

  4. #4
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP Error when lookup value references a cell that is a sum.

    I think FDibbins got it...you seem to be experiencing 'Round-Off' errors...as decimal numbers do not easily convert to Binary numbers, there is always a 'Round Off at the extreme lowere end of the number, so, even though the numbers may look the same, some where around the 14-15 digit of significance, the rounding is different between the 2 numbers...1 might be "7.2" and the other may be "7.2000000000001" or "7.199999999999999",; when displayed, they both may show as "7.2", but they are not actually "7.2", so they do not equal the condition...

    Hope this helps

    Edit-
    An easy way to check this is change the formatting of A1 or F14 to number--> 15 decimal places, expand the column to display 18 digits, then you can see if the value is actually = to the test number
    Last edited by dredwolf; 05-31-2013 at 02:45 AM.
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VLOOKUP Error when lookup value references a cell that is a sum.

    Thanks for the back-up guys

  6. #6
    Registered User
    Join Date
    10-03-2007
    Posts
    21

    Re: VLOOKUP Error when lookup value references a cell that is a sum.

    I love this forum!

    I can't express how much I appreciate your prompt and effective responses.
    @FDibbins, your suggestion worked like charm...but you already knew that Thank You!

    And a Big thanks to Dredwolf and Humdingaling for the added support. The explanation of why it occurred was very helpful and as result, I am sure it will help me in other function related errors.


    Thank You,

    -Joe

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VLOOKUP Error when lookup value references a cell that is a sum.

    Happy to help and its great to have you here

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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