+ Reply to Thread
Results 1 to 6 of 6

Can't figure out how to get rid of N/As in IF function with VLOOKUP.

  1. #1
    Registered User
    Join Date
    07-14-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Can't figure out how to get rid of N/As in IF function with VLOOKUP.

    I hate to ask for help when there is so much available through searching, but I've spent all day looking through other threads, and I'm just not
    making it click.

    Here is the formula I have:

    =IF(ISERROR(VLOOKUP(A12,AC!$A:$B,2,FALSE)=TRUE),VLOOKUP(A12,DC!$A:$B,2,FALSE),VLOOKUP(A12,AC!$A:$B,2,FALSE))

    I have three sheets. On sheet one, I have the formula above. The formula pulls data from sheets two and three, labelled AC and DC respectively.

    The problem is that depending on the day, there might not be any data on sheets two, three, or both - and it produces an N/A error.

    Any way I can add to the above formula so if I get an N/A it shows a blank cell instead?

    Thanks so much in advance!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Can't figure out how to get rid of N/As in IF function with VLOOKUP.

    You have a misplaced )

    =IF(ISERROR(VLOOKUP(A12,AC!$A:$B,2,FALSE)=TRUE),VLOOKUP(A12,DC!$A:$B,2,FALSE),VLOOKUP(A12,AC!$A:$B,2,FALSE))
    That is testing if the VLOOKUP is TRUE....Not the ISERROR..
    Should be
    =IF(ISERROR(VLOOKUP(A12,AC!$A:$B,2,FALSE))=TRUE,VLOOKUP(A12,DC!$A:$B,2,FALSE),VLOOKUP(A12,AC!$A:$B,2,FALSE))

    Also (although this is not actually 'wrong'), you don't need the =TRUE part.
    The IF needs a True or False result
    ISERROR already returns a True or False result.

    So
    =IF(ISERROR(VLOOKUP(A12,AC!$A:$B,2,FALSE)),VLOOKUP(A12,DC!$A:$B,2,FALSE),VLOOKUP(A12,AC!$A:$B,2,FALSE))

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Can't figure out how to get rid of N/As in IF function with VLOOKUP.

    You might also reduce the work effort the formula does with this:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can't figure out how to get rid of N/As in IF function with VLOOKUP.

    If the data type being returned is TEXT, try this:

    =LOOKUP("zzzzz",CHOOSE({1,2,3},"",VLOOKUP(A12,AC!$A:$B,2,0),VLOOKUP(A12,DC!$A:$B,2,0)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    07-14-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Can't figure out how to get rid of N/As in IF function with VLOOKUP.

    Thanks for the replies everyone - extremely helpful!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can't figure out how to get rid of N/As in IF function with VLOOKUP.

    You're welcome. We appreciate the feedback!

+ 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