+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    10-10-2007
    Posts
    2

    Replace #N/A from a lookup with 0 (zero)

    I have a project that I am trying to fully automate. I use a vlookup to return values from another source. The problem that I am having is that I want excel to return a zero when the value is not found. I have attached a sample of my problem. In column B you can see the lookup formula, which works fine, but I am having the problem in column D where I only want to see 0's when my lookup in B returns #N/A. I have tried everything that I can think of. Has anyone ever run into a solution for this? Your assistance would be greatly appreciated!

    Thanks!

    Kendra
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    without looking at the formula, if you substitute it below it should work

    if(your lookup=#n/a,0,your lookup)

    or

    if(iserror(your lookup),0,your lookup)

    Regards

    Dav

  3. #3
    Forum Guru VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    12,009
    Try

    =IF(ISERROR(B32),0,B32)
    or

    =IF(ISNA(B32),0,B32)
    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
    Registered User
    Join Date
    10-10-2007
    Posts
    2

    Thank You!!!

    Totally awesome!!! It worked perfectly. Thanks to everyone and thanks for the prompt response.

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.2.0