+ Reply to Thread
Results 1 to 5 of 5

Vlookup formula responds selectively for some and not all values

  1. #1
    Registered User
    Join Date
    08-18-2009
    Location
    Coral Springs, Florida
    MS-Off Ver
    Excel 2003
    Posts
    9

    Talking Vlookup formula responds selectively for some and not all values

    Hello,
    =IF(G88="PT",VLOOKUP(B88,Vlookup1!A:R,5),IF(G88="OT",VLOOKUP(B88,Vlookup1!A:R,6),IF(G88="ST",VLOOKUP(B88,Vlookup1!A:R,7),FALSE)))

    Two tabs in an excel spreadsheet. One with this formula and another one named Vlookup1 with the info (three columns indicating diagnosis codes for PT (Physical Therapy), OT (Occupational Therapy) and ST (Speech Therapy).

    Out of approximately 350 rows, this formula works perfectly fine with all but three customers’ names. It seems to be only with the last three customers –sorted alphabetically– and can’t figure out how to solve it.
    Have reduced the amount of rows in the info tab / have changed the format of all cells for these 3 customers / have retyped all information under another row and inserted above all the conflict rows but it always brings “0” as the cell value – not even False….

    Help!!
    Last edited by Amarilis Abreu; 08-24-2009 at 03:09 PM.

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

    Re: Vlookup formula responds selectively for some and not all values

    change all to this format then it will only look for exact match
    VLOOKUP(B88,Vlookup1!A:R,5,false) then come back with what doesnt match .probably spaces or something you havent noticed
    "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

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

    Re: Vlookup formula responds selectively for some and not all values

    Can be shortened to:

    =VLOOKUP(B88,Vlookup1!A:R,LOOKUP(G88,{"OP","PT","ST"},{6,5,7}),FALSE)

    and includes FALSE qualifier.. maybe they aren't actually sorted as you think..
    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.

  4. #4
    Registered User
    Join Date
    08-18-2009
    Location
    Coral Springs, Florida
    MS-Off Ver
    Excel 2003
    Posts
    9

    Talking Re: Vlookup formula responds selectively for some and not all values

    That's fantastic. Thanks so much for the replies and for the shorter version!!! The formula is fixed. I applied Trim function to the patients names and it worked!!!
    Thanks so much!

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

    Re: Vlookup formula responds selectively for some and not all values

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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