Average to Ignore 0 & #N/A

Shogun

New Member
Joined
Sep 1, 2010
Messages
49
Ive done searching and found ignoring 0 all over the place and one for ignoring na but the individual made his 0 na. For graphing reasons i need keep the 0 so i need to the avg to ignore both NA and 0. Whats the best way to do this?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Ive done searching and found ignoring 0 all over the place and one for ignoring na but the individual made his 0 na. For graphing reasons i need keep the 0 so i need to the avg to ignore both NA and 0. Whats the best way to do this?
Try one of these...

Book1
A
198
20
331
428
50
6_
7#N/A
841
9#N/A
1038
Sheet1

This array entered** formula will work in any version of Excel:

=AVERAGE(IF(ISNUMBER(A1:A10),IF(A1:A10<>0,A1:A10)))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

If you're using Excel 2007 or later...

=AVERAGEIFS(A1:A10,A1:A10,"<>0",A1:A10,"<1E100")
 
Upvote 0
Ive done searching and found ignoring 0 all over the place and one for ignoring na but the individual made his 0 na. For graphing reasons i need keep the 0 so i need to the avg to ignore both NA and 0. Whats the best way to do this?

Control+shift+enter, not just enter:

=AVERAGE(IF(ISNUMBER(A2:A40),IF(A2:A40>0,A2:A40)))

will average all positive values from A2:A40.
 
Upvote 0
Control+shift+enter, not just enter:

=AVERAGE(IF(ISNUMBER(A2:A40),IF(A2:A40>0,A2:A40)))

will average all positive values from A2:A40.

Thak but i need to include both positve and negative numbers for functionality.


If you're using Excel 2007 or later...

=AVERAGEIFS(A1:A10,A1:A10,"<>0",A1:A10,"<1E100")


This works great but what does "<1E100" do to this formula or what does it mean?
 
Upvote 0
Thak but i need to include both positve and negative numbers for functionality....

Matchematicians do not like the idea of excluding 0's while both positive and negatives are included...

By the way...

=AVERAGE(IF(ISNUMBER(A2:A40),IF(A2:A40,A2:A40)))

will include both...
 
Upvote 0
Originally Posted by T. Valko
If you're using Excel 2007 or later...
=AVERAGEIFS(A1:A10,A1:A10,"<>0",A1:A10,"<1E100")
This works great but what does "<1E100" do to this formula or what does it mean?
1E100 is scientific notation for a very large number. 1 followed by 100 zeros. 1E100 is a really gigantic number!

It means: average all numbers that are less than 1E100.

The zeros are being excluded as a separate criteria: "<>0".

There is a 100% chance that the numbers you're dealing with will be less than 1E100 so we use that as a criteria to ensure that both positive and negative numbers will be included in the average while at the same time, ignoring the #N/A errors.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top