 Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Ignoring N/A Values in a Sum.

# Ignoring N/A Values in a Sum Written by Allen Wyatt (last updated August 21, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003

Chris has a series of worksheets in a workbook, one for each month of the year. On a summary worksheet he wants to sum the values in the same cell on each worksheet. Chris does this by using a formula similar to the following:

```=SUM(January:December!B19)
```

This works fine, except for those instances where one of the B19 cells in the range may contain the value #N/A. In that case, Chris gets #N/A in the result on the summary sheet, as well. What Chris would like is to have the #N/A results ignored for the sum, as if the cells were blank.

There are a couple of ways to approach this problem. Perhaps the best method is to look at the formula used in cell B19 of each month's worksheet. For instance, let's say that the formula on each worksheet looked like this:

```=SUM(B1:B18)
```

You could change the formulas on these individual worksheets so that they took the possibility of #N/A values into account. For instance, the following would work just fine at B19 on each worksheet:

```=SUMIF(B1: B18,"<>#N/A")
```

This causes the sum in cell B19, on each worksheet, to be based on all the non-N/A values in the range. Because of this, you might think you could do this on the summary sheet:

```=SUMIF(January:December!B19,"<>#N/A")
```

This won't work, however, because the SUMIF function is not "three-dimensional" in nature; it cannot be used on a range of worksheets in the manner shown. It is for this reason that the best solution is to go back to the individual values, on each worksheet, that are being tallied on the summary worksheet.

If your formula on the individual month worksheets don't use the SUM function, it is obviously not as easy to change them to use SUMIF. In that case, you may want to "enclose" the existing formula in a check to see if the formula returns an error value. This technique is done this way:

```=IF(ISERROR(<current_B19_formula>),0,<current_B19_formula>)
```

The IF function looks for a True/False value, which is returned by the ISERROR function. Thus, if the formula returns an error value (such as #N/A), then the IF function returns 0, otherwise it returns the result of the original formula. This approach checks for any error result; if you would prefer to have it only check for #N/A results and ignore them, then you can use the following variation:

```=IF(ISNA(<current_B19_formula>),0,<current_B19_formula>)
```

There is a big difference between these IF-based approaches and using the SUMIF approach mentioned earlier in the tip. The SUMIF approach returns a sum for all non-N/A values in the range, but the IF-based approach returns a 0 for the entire sum if there are any #N/A values in the range. This can obviously affect what shows up on your summary sheet, so you will need to determine which approach is best suited to the data you are working with.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3156) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Ignoring N/A Values in a Sum.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Returning Zero when a Referenced Cell is Blank

Reference a cell in a macro, and if that cell is blank Excel normally equates that to a zero value. What if you don't ...

Discover More

You can create hyperlinks to all sorts of worksheets in a workbook, but you cannot create a hyperlink to a chart sheet. ...

Discover More

Applying Consistent Shading to a Table

Formatting tables can be very time consuming. When you get a document from another person, you can spend a lot of time ...

Discover More Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

Extracting First and Last Words

When working with text phrases stored in cells, it might be helpful to be able to extract words from the phrase. In this ...

Discover More

Starting Out Formulas

When you enter a formula from the keyboard, Excel only knows it is a formula if you start it with an equal sign. You can ...

Discover More

Segregating Numbers According to Their Sign

Remember your number line from your early years in school? Some numbers can be below zero (negative numbers) and others ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven minus 1?

2016-10-26 04:10:34

Its very use full & good information guidance

##### This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.