+ Reply to Thread
Results 1 to 9 of 9

vlookup to stay blank if nothing selected

  1. #1
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690

    vlookup to stay blank if nothing selected

    hi guys
    i have this formula which works well

    Please Login or Register  to view this content.
    which returns the value 0 if nothing selcted
    how can i keep this blank if nothing is selected

    thanks in advance
    Last edited by stevesunfold; 11-23-2008 at 10:13 AM.

  2. #2
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    dont know if im explaining well enough

    but if nothing is selected in cell e29 then i want the cell with forula in to stay blank also

    many thanks

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your formula makes no sense.

    The item to look up is within the lookup Range.

    If it does return zero you could turn off zero values. Goto Tools > options > edit tab > untick zeros

    or use an if statement

    =IF(VLOOKUP($E29,$B:$E,2,0)=0,"",VLOOKUP($E29,$B:$E,2,0))
    http://spreadsheetpage.com/index.php...s_in_formulas/

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi vba
    the cell e29 is the look up reference

    it then goes further down the sheet to look up whats in e29 and cross refernces it then returns the code

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    the cell e29 is the look up reference
    Yes I know and you're look at Cols B to E at Secound column.

    So surely you're look up range would be Cols B to C?

    VBA Noob

  6. #6
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    HI VBA
    yes yoy are right
    i have ammended the code to
    Please Login or Register  to view this content.
    but it returns #na


    or if i use your code
    Please Login or Register  to view this content.
    it returns #n/a

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,766
    You can modify your formula like this

    =IF($E29="","",VLOOKUP($E29,$B:$C,2,0))

    You'll still get an #N/A error if E29 isn't found in column B

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    =if(isna(vlookup(e29,b:c,2,false)),"",if(vlookup(e29,b:c,2,false)=0,"",vlookup(e29,b:c,2,false)))

  9. #9
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    perfect
    cheers daddylonglegs

+ 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