+ Reply to Thread
Results 1 to 4 of 4

If vlookup

  1. #1
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    If vlookup

    I'm trying to write a vlookup that will look at an array of 3 columns.... the vlookup returns the second column but if there is an NA in the second column then it moves to take the value in the thirs column. Is this possible? I have attached an excel as an example. thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If vlookup

    Assuming that you have a true #N/A error in your second column (i.e. resulting from a formula) then in B3 dragged down

    =IF(ISERROR(VLOOKUP(A3,$G$2:$I$8,2,FALSE)),VLOOKUP(A3,$G$2:$I$8,3,FALSE),VLOOKUP(A3,$G$2:$I$8,2,FALSE))
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: If vlookup

    Thanks you. I would also need to be able to do this if it contained the text NA. Is that possible

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If vlookup

    ChemistB is offline so I'll try to adjust what he gave you:

    =IF(OR(ISNA(VLOOKUP(A3,$G$2:$I$8,2,0)),VLOOKUP(A3,$G$2:$I$8,2,0)="NA"),VLOOKUP(A3,$G$2:$I$8,3,0),VLOOKUP(A3,$G$2:$I$8,2,0))


    If it works for you make sure to click on ChemistB's scales to thank him.

+ 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