A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Average formula where blank cells are counted as zeros



 
 
Thread Tools Display Modes
  #1  
Old April 28th, 2010, 08:44 PM posted to microsoft.public.excel.worksheet.functions
krwelling
external usenet poster
 
Posts: 1
Default Average formula where blank cells are counted as zeros

I am trying to write an average formula that takes into account the blank
cells.

I had only cells A2, A4, A6 filled out, but when I do =average(A1:A6), it is
not treating the blanks as zeros so the answer is much higher than it should
be.

Should I do a logic formula within the cells?
  #2  
Old April 28th, 2010, 09:24 PM posted to microsoft.public.excel.worksheet.functions
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Average formula where blank cells are counted as zeros

If you know the range, you could do the division yourself:

=sum(a1:a6)/6

But this would include other non-numeric cells in the count of cells (6), too.



krwelling wrote:

I am trying to write an average formula that takes into account the blank
cells.

I had only cells A2, A4, A6 filled out, but when I do =average(A1:A6), it is
not treating the blanks as zeros so the answer is much higher than it should
be.

Should I do a logic formula within the cells?


--

Dave Peterson
  #3  
Old April 28th, 2010, 09:30 PM posted to microsoft.public.excel.worksheet.functions
nadine
external usenet poster
 
Posts: 303
Default Average formula where blank cells are counted as zeros

=AVERAGE(IF($A$2:$A$60,$A$2:$A$6)) AND HIT Ctrl+Shift+Enter to enter the
array formula.


"krwelling" wrote:

I am trying to write an average formula that takes into account the blank
cells.

I had only cells A2, A4, A6 filled out, but when I do =average(A1:A6), it is
not treating the blanks as zeros so the answer is much higher than it should
be.

Should I do a logic formula within the cells?

  #4  
Old April 28th, 2010, 10:46 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Average formula where blank cells are counted as zeros

=AVERAGE(IF($A$2:$A$60,$A$2:$A$6))

I think the OP wants to include empty cells and evaluate them as numeric 0.

Try one of these this array formulas** .

This one assumes the range contains numbers or empty cells only. No TEXT, no
formula blanks "".

=AVERAGE(IF(A2:A6,A2:A6,A2:A6))

This one will account for (ignore) TEXT but will evaluate blank/empty cells
as numeric 0.

=AVERAGE(IF(ISNUMBER(A2:A6),A2:A6,IF(A2:A6="",0)))

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

--
Biff
Microsoft Excel MVP


"Nadine" wrote in message
...
=AVERAGE(IF($A$2:$A$60,$A$2:$A$6)) AND HIT Ctrl+Shift+Enter to enter the
array formula.


"krwelling" wrote:

I am trying to write an average formula that takes into account the blank
cells.

I had only cells A2, A4, A6 filled out, but when I do =average(A1:A6), it
is
not treating the blanks as zeros so the answer is much higher than it
should
be.

Should I do a logic formula within the cells?



  #5  
Old April 28th, 2010, 10:56 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Average formula where blank cells are counted as zeros

Or, it might be as simple as:

=SUM(A2:A6)/ROWS(A2:A6)

We'd need more details as to what the possible entries are in the range.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
=AVERAGE(IF($A$2:$A$60,$A$2:$A$6))


I think the OP wants to include empty cells and evaluate them as numeric
0.

Try one of these this array formulas** .

This one assumes the range contains numbers or empty cells only. No TEXT,
no formula blanks "".

=AVERAGE(IF(A2:A6,A2:A6,A2:A6))

This one will account for (ignore) TEXT but will evaluate blank/empty
cells as numeric 0.

=AVERAGE(IF(ISNUMBER(A2:A6),A2:A6,IF(A2:A6="",0)))

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

--
Biff
Microsoft Excel MVP


"Nadine" wrote in message
...
=AVERAGE(IF($A$2:$A$60,$A$2:$A$6)) AND HIT Ctrl+Shift+Enter to enter
the
array formula.


"krwelling" wrote:

I am trying to write an average formula that takes into account the
blank
cells.

I had only cells A2, A4, A6 filled out, but when I do =average(A1:A6),
it is
not treating the blanks as zeros so the answer is much higher than it
should
be.

Should I do a logic formula within the cells?





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.