+ Reply to Thread
Results 1 to 9 of 9

vlookup list

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    vlookup list

    I am using a vlookup formula to a series of data sets. I am trying to get something so that it will display the relevant score for that site. However the lists are not the same size, how do i get a vlookup to read a score for a site if it is the the array but display "0" if the site name is not in the array?

    It is coming up with #N/A and I can't do anything with that....
    Last edited by Back2Basics; 01-20-2009 at 10:23 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    You could use the error to return 0 by using ISERROR

    =if(iserror(vlookup(lookup_value,table_array,col_index_num,range_lookup)),0,vlookup(lookup_value,table_array,col_index_num,range_lookup))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    however it is better to only conduct the MATCH element rather than repeat the entire VLOOKUP, eg:

    =IF(ISNA(MATCH(lookup_value,lookup_array,0)),0,VLOOKUP(criteria,table_array,col_index_num,range_lookup))

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    and as your friend, AA, would suggest.. it is also better to look for positive results first...

    e.g. =IF(ISNUMBER(MATCH(lookup_value,lookup_array,0)),VLOOKUP(criteria,table_array,col_index_num,range_look up),0)
    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.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    he's not always right

    (ok, yes he is... well alright 99.9% of the time... though I guess Ron would argue otherwise based on our little INDEX Volatile chat the other day)

  6. #6
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123
    Thanks for the help guys - but it doesn't quite work.

    I have attached the spreadheet with what I have done and the suggested formula by NBVC - but it just comes out as 0 for all of them.
    Last edited by Back2Basics; 02-04-2009 at 08:23 AM.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    And also a good reason why it is always best to at least post the formula you currently have, so, at minimum, we can match up the references to ranges and sheets, so that most of the time all you need to do is copy/paste our formulas... or, at minimum, see how we incorporate your data references into our formulas.

+ 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