+ Reply to Thread
Results 1 to 11 of 11

Can you treat "#N/A" as Zero?

  1. #1
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Can you treat "#N/A" as Zero?

    I have a situation where I'm using VLOOKUP to find a name in a sheet, and then give me a number next to the name.

    Unfortunately, I run into situations where the VLOOKUP can't find the name (because it's not in the list) and it gives me "#N/A" instead.

    I can understand the reason for this, but unfortunately I'm using SUM to calculate a total of these numbers, and the SUM is always "#N/A" until I manually delete all the cells that contain "#N/A" in the list.

    Is there a way I can make the cell equal "0" if the VLOOKUP fails?

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    01-04-2020
    Location
    Hull, UK
    MS-Off Ver
    2016
    Posts
    60

    Re: Can you treat "#N/A" as Zero?

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Re: Can you treat "#N/A" as Zero?

    Worked like a charm! Thanks so much for the quick answer!

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Can you treat "#N/A" as Zero?

    Use SUMIF rather than SUM. Instead of SUM(X3:X99), SUMIF(X3:X99,"<>#N/A").

    Or you could wrap your VLOOKUP calls inside IFERROR, so IFERROR(VLOOKUP(...),""); however, that traps ALL errors, so if you did anything which produced #REF! or #NAME? errors, IFERROR would hide them along with #N/A and any other error values. #REF! and #NAME? errors generally indicate serious problems, so best not to hide them.

    Tangent: one thing I love about Google Sheets is the ability to create arrays on the fly, so where Excel may need IFERROR(VLOOKUP(B4,Other!A3:B100,2,0),""), Google Sheets can use VLOOKUP(B4,{Other!A3:B100;B4,""},2,0).

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Can you treat "#N/A" as Zero?

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Re: Can you treat "#N/A" as Zero?

    I will gladly mark it as solved. How?

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.83 for Mac MS 365
    Posts
    8,480

    Re: Can you treat "#N/A" as Zero?

    to mark as solved go to the top of the post and use the thread tools dropdown there, it is in that dropdown list.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  8. #8
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Re: Can you treat "#N/A" as Zero?

    Thanks to all

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Can you treat "#N/A" as Zero?

    Quote Originally Posted by CriticalMass048 View Post
    I will gladly mark it as solved. How?
    The procedure was fully described in post #5. please don't waste our members time needlessly. Thanks

  10. #10
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Re: Can you treat "#N/A" as Zero?

    I thanked people several times. I appreciated the help. I also went and added reputation points to the members that helped me, just like you suggested.

    I'm very, truly sorry that I failed to notice your directions in Post #5, resulting in the wasting other members' times. I beg your forgiveness.

  11. #11
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Can you treat "#N/A" as Zero?

    You are hereby absolved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 02-07-2020, 11:00 AM
  2. Replies: 5
    Last Post: 09-22-2015, 01:55 PM
  3. How to treat "-" as 0 in conditional formating.
    By ABGPRB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2015, 03:42 AM
  4. Replies: 13
    Last Post: 04-15-2010, 10:23 AM
  5. How to treat "#N/A"s in IF functions
    By Geoff1184 in forum Excel General
    Replies: 12
    Last Post: 07-10-2009, 06:52 AM
  6. Replies: 4
    Last Post: 06-13-2006, 07:25 PM
  7. How can I make a Chart data series treat blanks as "Empty" cells
    By XLADLK in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 01-11-2006, 12:25 AM

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