+ Reply to Thread
Results 1 to 4 of 4

Thread: "VLOOKUP" and "IF" not working

  1. #1
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    155

    "VLOOKUP" and "IF" not working

    Hi,

    I have a formula in one of my cells that is:

    [=IF(D23="","",VLOOKUP(D23,Prices,IF(B23="Y",4,3)))]

    The problem that I am having is that the formula sometimes pulls up the wrong data.

    I used to have a formula that worked right, but it did not check to see if the "Y" was in a cell like I needed it too. That formula was this:

    [=IF(D23="","",VLOOKUP(D23,Prices,3,))]

    Why is the first formula not bring up the correct data? It is working like it is supposed to but it's pulling up the wrong data.

    Any help would be greatly appreciated.

    Thanks in advance!!!
    Last edited by whatsmyname; 09-11-2009 at 04:12 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2007
    Posts
    724

    Re: "VLOOKUP" and "IF" not working

    It seems like it should work, but sometimes I've found that adding False at the end of VLOOKUP works.
    So, try

    =IF(D23="","",VLOOKUP(D23,Prices,IF(B23="Y",4,3,FALSE)))
    modytrane

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2007
    Posts
    724

    Re: "VLOOKUP" and "IF" not working

    sorry, that should be

    =IF(D23="","",VLOOKUP(D23,Prices,IF(B23="Y",4,3),FALSE)))
    modytrane

  4. #4
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    155

    Re: "VLOOKUP" and "IF" not working

    Thank you so much.

    That fixed me right up!!!

    I appreciate it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0