+ Reply to Thread
Results 1 to 5 of 5

Nested if statements with vlookups

  1. #1
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60

    Nested if statements with vlookups

    I am trying to write a function where if vlookup returns 0 or is NA then the cell is "blank" otherwise it ruturns the value of the vlookup. The function is working in that if it is 0 it is returning blank but if it is NA it si giving me a #NA. How come the second half this function is not working properly.

    =IF(VLOOKUP($B12,Data!$A$7:$G$264,7,FALSE)=0,"",IF(ISNA(VLOOKUP($B12,Data!$A$7:$G$264,7,FALSE)),"",VLOOKUP(B12,Data!$A$7:$G$264,7,FALSE)))

    Thank you in advance for any help you can give. If you know a better way I am open to other ways to write this.
    Last edited by txbullets; 12-08-2011 at 11:02 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Nested if statements with vlookups

    Maybe try this rearrangement:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60

    Re: Nested if statements with vlookups

    Thank you I tried to flip them like that but it didn't work before. I copied and pasted yours and it worked perfect. I must have been missing some parenthesis somewhere.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Nested if statements with vlookups

    If you have Excel 2007 or 2010 you can also use IFERROR like this also:

    Please Login or Register  to view this content.
    abousetta

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Nested if statements with vlookups

    Yes, just one missing comma or parentheses anywhere and Excel throws a fit

    If you are satisfied with the responses then please mark the thread as solved.

    Good luck.

    abousetta
    Last edited by abousetta; 12-08-2011 at 01:52 PM.

+ 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