ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Average formula Counting zero's How do I get just the numers counted. (https://www.excelbanter.com/excel-discussion-misc-queries/133015-average-formula-counting-zeros-how-do-i-get-just-numers-counted.html)

[email protected]

Average formula Counting zero's How do I get just the numers counted.
 
Spreadsheet is created for a layover from other sources, therefore,
zeros will be present when data is laid on top of master spreadsheet.
Also, want to show no values by using a "-" when no numbers present
for easy recognition. Current formula is =IF(SUM(D9:GU9)=0,"-",
(AVERAGE(D9:GU9))) but if two numbers and a zero are present it
averages by three. Can anyone HELP?????


T. Valko

Average formula Counting zero's How do I get just the numers counted.
 
Can there be any negative numbers in your range?

Assuming not, try this:

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=IF(SUM(D9:GU9),AVERAGE(IF(D9:GU90,D9:GU9)),"-")

Biff

wrote in message
ps.com...
Spreadsheet is created for a layover from other sources, therefore,
zeros will be present when data is laid on top of master spreadsheet.
Also, want to show no values by using a "-" when no numbers present
for easy recognition. Current formula is =IF(SUM(D9:GU9)=0,"-",
(AVERAGE(D9:GU9))) but if two numbers and a zero are present it
averages by three. Can anyone HELP?????




MartinW

Average formula Counting zero's How do I get just the numers count
 
Hi

You could replace the (AVERAGE(D9:GU9) bit with
=SUM(D9:GU9)/COUNTIF(D9:GU9,"0")

HTH
Martin


All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com