+ Reply to Thread
Results 1 to 9 of 9

vlookup questions

  1. #1
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    vlookup questions

    Hello I noticed that everytime I use the vlookup function I get zeros on some of the cells. It works well, i just have that minor problem. I don't mind finding all and replacing but just wondering.

    Also when would it be good to use the range_lookup??? I don't know what that is and I don't get excels explanation of it... oh and on the col_index_num... I put a 2 because that's what i have in the samples to practice on but would any other number go there??? or is that always a 2???

    Thanks,
    Last edited by jgomez; 01-27-2011 at 02:52 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    Re: vlookup questions

    oh and sometimes I get #n/a

  3. #3
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: vlookup questions

    Quote Originally Posted by jgomez View Post
    Hello I noticed that everytime I use the vlookup function I get zeros on some of the cells. It works well, i just have that minor problem. I don't mind finding all and replacing but just wondering.
    close your forula with:

    )&"")

    this will get rid of zeros

    EDIT - to aid example

    Example

    =IF(VLOOKUP(C7,Sheet2!A8:L33,4,FALSE)=0,"",VLOOKUP(C7,Sheet2!A8:L33,4,FALSE))

    This vlookup is running twice, once for zeros, then again, which is inefficient and a ball ache to write.

    This however, is much shorter and does the same job

    =IF(C7="","",VLOOKUP(C7,Sheet2!A8:L33,7,FALSE)&"")

    Of course:

    Another option would be to put ="" into the cells in "Sheet2!" which would also stop the zero (not forgetting to format cell to general)


    Also when would it be good to use the range_lookup??? I don't know what that is and I don't get excels explanation of it... oh and on the col_index_num... I put a 2 because that's what i have in the samples to practice on but would any other number go there??? or is that always a 2???
    please post your spreadsheet and i'll demonstrate
    Last edited by Blake 7; 01-25-2011 at 11:10 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: vlookup questions

    Hi, maybe first take a look at Xl's help about the VLOOKUP function ( activated with F1) and come back for fine tuning your questions?

  5. #5
    Registered User
    Join Date
    01-24-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: vlookup questions

    If the source value is zero, then VLOOKUP returns 0. Likewise, if the source is blank, then VLOOKUP still returns the value 0. For some purposes, this may not do—you need to know whether the cell being looked up is blank or if it really contains a 0.
    Column index is decided by the column number of the field from which you need the information, for example, if you have table emp id, emp name, emp add. If you are using emp id to take the emp address details from the table. If you look at the table, it is present in the 3rd number column so the col index will be 3. So it is always decided by the position of the field name in the table from which you need the information.
    It will return #N/A when the value is not found in the table.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    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.

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

    Re: vlookup questions

    Blake7

    You'd only want to end the VLOOKUP() with &"" if you're looking up text values because it will convert numeric values to text.


    One more source for learning VLOOKUP()
    http://www.excelfunctions.net/ExcelVlookup.html
    Last edited by Cutter; 01-25-2011 at 11:13 AM.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: vlookup questions

    To hide zeroes you can use Tools -> Options -> View & uncheck Zeroes
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: vlookup questions

    Quote Originally Posted by Cutter View Post
    Blake7

    You'd only want to end the VLOOKUP() with &"" if you're looking up text values because it will convert numeric values to text.
    Thanks Cutter for that, i wasn't aware.

    @op - you can still use this old chesnut


    =IF(VLOOKUP(C7,Sheet2!A8:L33,4,FALSE)=0,"",VLOOKUP(C7,Sheet2!A8:L33,4,FALSE))

+ 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