+ Reply to Thread
Results 1 to 10 of 10

lookup - formula returns wrong value/sum

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    lookup - formula returns wrong value/sum

    Hello there!

    I am using this formula
    Please Login or Register  to view this content.
    to lookup the values for the empty column I on sheet 1, which are present on sheet 2 although in a different order and sometimes even non-existant.

    Here is the problem:
    I have, for testing purpose, a file with 2 identical sheets, only difference is that I deleted all numbers from column I on sheet 1, but all the values are present in column I on sheet 2.
    Each value in column is categorized by a unique number in column E, thus this is the way to find out the correct value for the listed unique number.
    Now, when I insert this formula in sheet 1 column I, It looks through sheet 2 and gets me to correct the value for each unique number. And here is the kicker: the total SUM of that generated number is different than from the original (and 100% correct) total I have on sheet 2.

    This formula works fine on my dummy sheet with 10 rows, but it does not in my actual workbook with 2000 rows...

    Help please!
    Thx, A2k
    Last edited by Armitage2k; 07-16-2009 at 01:07 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: lookup - formula problem

    Hi Armitage, perhaps this thread is more accurately titled "VLOOKUP FORMULAS RETURNING WRONG VALUES/SUMS"

    This sounds intriguing. Post up the book or a sample of it and point out where you're seeing the incorrect values/sums.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: lookup - formula returns wrong value/sum

    Thanks for the advice.

    Well, I have a sample where I tested the formula, and it successfully worked. It only does not work for my actual workbook where I have 2000 entries (and I cannot upload that one due to sensitive data). However, I changed the example from 10 lines to 100 lines and still have the correct result. I just dont know what it could be. There is absolutely no difference to the actual mainbook. I even checked for hidden lines or somehting similar, but no result.

    Thanks,
    A2k

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: lookup - formula returns wrong value/sum

    Ok, if you can't sanitize the data (change the names and dumbdown the values, i could do it in about 60 seconds...) so we can look, all I can think of is "hope you figure it out."


  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: lookup - formula returns wrong value/sum

    Well, I exactly did that and after 60 seconds I came to the result that there is no difference in the total sum

    but please, if it helps, enclosed my sanitized workbook which is causing me troubles.

    Thanks for the help,
    A2k
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: lookup - formula returns wrong value/sum

    you can't use lookup techniques like VLOOKUP with columns of data that have duplicated values...at least you can't in this situation based on what you're trying to do.

    On the first sheet in K5, put this formula and fill down:

    =I5=Sheet2!I5

    It SHOULD say TRUE all the way down. It doesn't. You have values in column E on sheet2 that are duplicated, so when that happens you keep getting the first instance over and over again.

    Is column F perhaps unique?

  7. #7
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: lookup - formula returns wrong value/sum

    I do know that colum I is not unique, since the F&B value is many times the same.
    However, I do not need to define lookup upon the F&B value, I need to lookup the confirmation (folio) in column E which is unique, and then the associated F&B consumption of that confirmation.
    so basically, find the same confirmation number, then insert the missing F&B consumtption of that number from sheet 2.

    Thanks,
    A2k

  8. #8
    Forum Contributor
    Join Date
    05-20-2008
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    174

    Re: lookup - formula returns wrong value/sum

    I think you may well find that there some errors in your data.

    On a quick look I found a few entries in column E that were duplicated therefore giving the wrong results. Also there were a couple of entries missing from column E therefore returning an error on the lookup.

    If you sort your Sheet1 by column E Lowest to highest here are the errors.

    Rows 45 & 46 Duplicate values in E
    Rows 350 & 351 Duplicate values in E
    Rows 681 & 682 Duplicate values in E
    Rows 873 & 874 Duplicate values in E

    Row 595 on Sheet2 you have a value in I that has two decimal points
    Rows 1142 & 1143 No entries in E

    Hope that helps?

  9. #9
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: lookup - formula returns wrong value/sum

    Well, thanks for looking.

    So, basically I have this difference in sums because the data is not unique. So basically if I remove all duplicates this should work out, right?

    hmm, guess the advanced filter could be of help.

    Thanks for the hint,
    A2k

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: lookup - formula returns wrong value/sum

    Well, is there ANY column that has unique values on every row? Column F?

+ 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