+ Reply to Thread
Results 1 to 10 of 10

Vlookup

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    13

    Vlookup

    Hey, i'm trying to use VLOOKUP but the field i am searching is a complex formula and it wont recognize any of the values. Is there some trick to it??

    Column I is what i am working with..
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: VLOOKUP - not playing nice with formula values

    VLOOKUP(G2,C:D,2,FALSE)

    G2 is not found in column C

    Did you mean:
    VLOOKUP(G2,a:D,4,FALSE)
    ?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    06-22-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: VLOOKUP - not playing nice with formula values

    Quote Originally Posted by Cheeky Charlie View Post
    VLOOKUP(G2,C:D,2,FALSE)

    G2 is not found in column C

    Did you mean:
    VLOOKUP(G2,a:D,4,FALSE)
    ?


    No, because some of the numbers in G2 ARE found in column C. If you drag the formula that i have down, it doesn't recognize a single thing unless i manually type in the exact value (not calculate it with the formula in Column C)

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Vlookup

    No, because some of the numbers in G2 ARE found in column C
    Help me to help you. I'm not here for a game of Cluedo. Which?

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup

    its because of col g are not in same format as col c amongst other things! g is custom formatted 000000 to make them look 6 characters long like the text values on col c so that's one reason
    Last edited by martindwilson; 07-21-2010 at 11:36 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    07-20-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Vlookup

    Your version:
    =IF(G2="","",IF(COUNTIF(A:A,G2),VLOOKUP(G2,C:D,2,FALSE),"Obsolete"))
    You haven't fully defined the logical test in the if statement, and your column D is empty? so your vlookup range will not return anything



    Is this what you are hoping for?
    =IF(G2="","",IF(COUNTIF(A:A,G2)>0,VLOOKUP(G2,A:B,2,FALSE),"Obsolete"))

  7. #7
    Registered User
    Join Date
    06-22-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Vlookup

    Quote Originally Posted by Cheeky Charlie View Post
    Help me to help you. I'm not here for a game of Cluedo. Which?
    G16 for example.

    G16 is 050141RD, H16 is C.
    C302 is 050141RD, D302 is C

    All of these numbers match up so i column I should be blank for this particular example, but i am still getting a #N/A with my formula



    Quote Originally Posted by martindwilson View Post
    its because of col g are not in same format as col c amongst other things! g is custom formatted 000000 to make them look 6 characters long like the text values on col c so that's one reason
    Could this be problem? I've changed them both to Text format with no luck. I've also tried custom format 000000 and it too had no effect. I've tried copying all of column C and doing a special paste of just values and again, no change. I have to be doing something wrong because i know there is data that matches up in both columns..

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Vlookup

    Quote Originally Posted by ljungren13 View Post
    Your version:
    =IF(G2="","",IF(COUNTIF(A:A,G2),VLOOKUP(G2,C:D,2,FALSE),"Obsolete"))
    You haven't fully defined the logical test in the if statement, and your column D is empty? so your vlookup range will not return anything



    Is this what you are hoping for?
    =IF(G2="","",IF(COUNTIF(A:A,G2)>0,VLOOKUP(G2,A:B,2,FALSE),"Obsolete"))
    Ifs will interpret 0 as false and any value other than 0 as true, so you don't need >0

  9. #9
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Vlookup

    G16 for example.

    G16 is 050141RD, H16 is C.
    C302 is 050141RD, D302 is C
    Your formula in Column C leaves a trailing space - '050141RD C' remove the C = '050141RD '

    Simple fix =trim(your current formula)

    But it is pretty unwieldy, I'm confident there'd be a better way of writing that formula, again, not Sherlock Holmes, if you want to explain what that formula is for we could probably simplify it for you.

    HTH

    PS mdw, I love you, but formatting will never affect a lookup (except for misleading people about what is being looked up)

  10. #10
    Registered User
    Join Date
    06-22-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Vlookup

    Quote Originally Posted by Cheeky Charlie View Post
    Your formula in Column C leaves a trailing space - '050141RD C' remove the C = '050141RD '

    Simple fix =trim(your current formula)
    GREAT find!!! I didn't realize that b4 it work great now!!!
    Thank you SO much! This is such a great help!!

+ 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