+ Reply to Thread
Results 1 to 10 of 10

VLOOKUP

Hybrid View

Guest VLOOKUP 05-11-2006, 10:35 AM
Guest RE: VLOOKUP 05-11-2006, 10:40 AM
Guest RE: VLOOKUP 05-11-2006, 10:50 AM
Guest Re: VLOOKUP 05-11-2006, 10:45 AM
Guest Re: VLOOKUP 05-11-2006, 11:00 AM
Guest Re: VLOOKUP 05-11-2006, 12:30 PM
Guest Re: VLOOKUP 05-11-2006, 12:45 PM
  1. #1
    Mike McLellan
    Guest

    VLOOKUP

    I am trying to use VLOOKUP to use a lookup value B5 to access an array to
    return the value in column 2 of an array in another workbook. The expression
    is as follows:

    =VLOOKUP(B5,Temp!B5:D643,2,FALSE)

    My problem is that, although looking at the values in B5 and Temp!B5 they
    look identical, for some reason VLOOKUP is not recognising this. Also, if I
    try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not OK'. Furthermore,
    if I print out the ASCII character code for each character in each of the
    strings, they are identical.

    Can anyone help?

  2. #2
    hans bal(nl)
    Guest

    RE: VLOOKUP

    The problem lies in the fact that somehow Excel does not recognize the data
    as identical. Do you maybe have leading or trailing spaces in your data ? For
    instance if the text in B5 = "John" and the text in B7 = "John ", you wil
    get this problem.

    Hans

    "Mike McLellan" wrote:

    > I am trying to use VLOOKUP to use a lookup value B5 to access an array to
    > return the value in column 2 of an array in another workbook. The expression
    > is as follows:
    >
    > =VLOOKUP(B5,Temp!B5:D643,2,FALSE)
    >
    > My problem is that, although looking at the values in B5 and Temp!B5 they
    > look identical, for some reason VLOOKUP is not recognising this. Also, if I
    > try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not OK'. Furthermore,
    > if I print out the ASCII character code for each character in each of the
    > strings, they are identical.
    >
    > Can anyone help?


  3. #3
    Mike McLellan
    Guest

    RE: VLOOKUP

    Nothing like that I'm afraid. I've printed out the ASCII code for each
    character in both strings, from 1 to the last character +1, to prove this -
    the results are identical

    "hans bal(nl)" wrote:

    > The problem lies in the fact that somehow Excel does not recognize the data
    > as identical. Do you maybe have leading or trailing spaces in your data ? For
    > instance if the text in B5 = "John" and the text in B7 = "John ", you wil
    > get this problem.
    >
    > Hans
    >
    > "Mike McLellan" wrote:
    >
    > > I am trying to use VLOOKUP to use a lookup value B5 to access an array to
    > > return the value in column 2 of an array in another workbook. The expression
    > > is as follows:
    > >
    > > =VLOOKUP(B5,Temp!B5:D643,2,FALSE)
    > >
    > > My problem is that, although looking at the values in B5 and Temp!B5 they
    > > look identical, for some reason VLOOKUP is not recognising this. Also, if I
    > > try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not OK'. Furthermore,
    > > if I print out the ASCII character code for each character in each of the
    > > strings, they are identical.
    > >
    > > Can anyone help?


  4. #4
    Dave O
    Guest

    Re: VLOOKUP

    Most likely there is something different about the values in B5 and
    Temp!B5 that is preventing an exact match. Is B5 formatted as a
    number, and Temp!B5 is formatted as a string? It may be a leading or
    trailing blank space, for instance, or one of the values may start with
    an apostrophe(this usually happens when the value is imported from a
    database or another application). You can test for this *using a
    backed up copy of your data* copy copying the value in B5 to cell
    Temp!B5. If the VLOOKUP returns the expected value then you'll need to
    perform some secondary processing to remove the offending characters.

    How did you print out the ascii code for each char in each string?
    Just curious. Excel's CODE function, for instance, only returns the
    ascii value for the first char in a cell.


  5. #5
    Mike McLellan
    Guest

    Re: VLOOKUP

    I did as you suggested and the VLOOKUP call is still returning an error

    I used CODE(MID(x,y,1)) to print out all the ASCII codes

    "Dave O" wrote:

    > Most likely there is something different about the values in B5 and
    > Temp!B5 that is preventing an exact match. Is B5 formatted as a
    > number, and Temp!B5 is formatted as a string? It may be a leading or
    > trailing blank space, for instance, or one of the values may start with
    > an apostrophe(this usually happens when the value is imported from a
    > database or another application). You can test for this *using a
    > backed up copy of your data* copy copying the value in B5 to cell
    > Temp!B5. If the VLOOKUP returns the expected value then you'll need to
    > perform some secondary processing to remove the offending characters.
    >
    > How did you print out the ascii code for each char in each string?
    > Just curious. Excel's CODE function, for instance, only returns the
    > ascii value for the first char in a cell.
    >
    >


  6. #6
    Dave O
    Guest

    Re: VLOOKUP

    Do you have the Analysis Toolpak installed?


  7. #7
    Dave O
    Guest

    Re: VLOOKUP

    Your original post says
    Also, if I try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not
    OK'.

    Assuming this is a typo and the IF should read B5=Temp!B5, this
    suggests a formatting mismatch. If one is text and the other is
    numeric, it will pass your ascii char code test and still fail the
    VLOOKUP.


  8. #8
    Mike McLellan
    Guest

    Re: VLOOKUP

    Yes - it was a typo

    I've tried reformatting both ranges as text but it doesn't appear to make
    any difference

    "Dave O" wrote:

    > Your original post says
    > Also, if I try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not
    > OK'.
    >
    > Assuming this is a typo and the IF should read B5=Temp!B5, this
    > suggests a formatting mismatch. If one is text and the other is
    > numeric, it will pass your ascii char code test and still fail the
    > VLOOKUP.
    >
    >


+ 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