Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Cheri
 
Posts: n/a
Default Average non-adjacent cells if the cell does not contain zero

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero. How
would I do this?

Your help is greatly appreciated!!!

Cheri
  #2   Report Post  
DaveB
 
Posts: n/a
Default

Hello -
This formula will work, assume your values are in the range A1:A1000:

=AVERAGE(IF(A1:A1000<0,A1:A1000,""))

This is an array formula so enter it in using ctrl+shift+enter.

--
Regards,

Dave


"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero. How
would I do this?

Your help is greatly appreciated!!!

Cheri

  #3   Report Post  
Cheri
 
Posts: n/a
Default

Hi DaveB,

Thank you for the assistance. My problem is that there is other data in the
cells that are adjacent, so I cannot use a range. It must average different
specific cells in a row only if the cell does not contain a zero.

Thanks,
Cheri


"DaveB" wrote:

Hello -
This formula will work, assume your values are in the range A1:A1000:

=AVERAGE(IF(A1:A1000<0,A1:A1000,""))

This is an array formula so enter it in using ctrl+shift+enter.

--
Regards,

Dave


"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero. How
would I do this?

Your help is greatly appreciated!!!

Cheri

  #4   Report Post  
Biff
 
Posts: n/a
Default

Hi!

I have a spread sheet with data in non-adjacent cells.


We would need to know EXACTLY which cells you want to average.

Biff

"Cheri" wrote in message
...
I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero.
How
would I do this?

Your help is greatly appreciated!!!

Cheri



  #5   Report Post  
Cheri
 
Posts: n/a
Default

One row would be averaging what is in cells b5, d5, f5, and h5.

I look forward to your response! Thanks!!!

"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero. How
would I do this?

Your help is greatly appreciated!!!

Cheri



  #6   Report Post  
Biff
 
Posts: n/a
Default

Entered as an array using the key combo of CTRL,SHIFT,ENTER:

=AVERAGE(IF((MOD(COLUMN(B5:H5),2)=0)*(B5:H5<0),B5 :H5))

Biff

"Cheri" wrote in message
...
One row would be averaging what is in cells b5, d5, f5, and h5.

I look forward to your response! Thanks!!!

"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero.
How
would I do this?

Your help is greatly appreciated!!!

Cheri



  #7   Report Post  
Cheri
 
Posts: n/a
Default

Hi Biff,

That works GREAT! Now, is there a way to append the formula so that in the
event none of the cells have a greater than zero value that the cell will not
show the #DIV/0! error?

Thanks again!

"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero. How
would I do this?

Your help is greatly appreciated!!!

Cheri

  #8   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this (still an array):

=IF(SUMPRODUCT(--(MOD(COLUMN(B5:H5),2)=0),--(B5:H50))=0,"",AVERAGE(IF((MOD(COLUMN(B5:H5),2)=0 )*(B5:H5<0),B5:H5)))

If no values in the desired range are greater than zero the formula returns
a blank: ""

If you want something else to be returned just replace the "" in the
formula.

Biff

"Cheri" wrote in message
...
Hi Biff,

That works GREAT! Now, is there a way to append the formula so that in
the
event none of the cells have a greater than zero value that the cell will
not
show the #DIV/0! error?

Thanks again!

"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero.
How
would I do this?

Your help is greatly appreciated!!!

Cheri



  #9   Report Post  
Cheri
 
Posts: n/a
Default

No, that didn't work <frown If I input 95% and 100% in two of the cells the
answer with the first formula returns a correct average of 97.5%. With this
formula it returns a 96.2% and if I empty the cells or place a zero in them,
the 96.2% stays in the cell. I'm sure I should do something that would
update it, but it didn't recalculate on its own.

Thanks for trying...I can live with the #DIV/0!...it just isn't pretty <smile

Thanks!!!



"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero. How
would I do this?

Your help is greatly appreciated!!!

Cheri

  #10   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Hmmm....

The formula DOES work! I'll send you a sample file to prove it if you'd
like!

Did you make sure to enter it as an array?

I can't duplicate what you're describing and it's working just fine for me.

Biff

"Cheri" wrote in message
...
No, that didn't work <frown If I input 95% and 100% in two of the cells
the
answer with the first formula returns a correct average of 97.5%. With
this
formula it returns a 96.2% and if I empty the cells or place a zero in
them,
the 96.2% stays in the cell. I'm sure I should do something that would
update it, but it didn't recalculate on its own.

Thanks for trying...I can live with the #DIV/0!...it just isn't pretty
<smile

Thanks!!!



"Cheri" wrote:

I have a spread sheet with data in non-adjacent cells. I would like to
average the data in the cells only if the cell does not contain a zero.
How
would I do this?

Your help is greatly appreciated!!!

Cheri





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Cell Shading (based on the shading of other cells) Tubby Excel Worksheet Functions 2 June 20th 06 10:03 PM
How do I make a cell equal to another cells value and not it's fo. TroutKing Excel Worksheet Functions 2 January 17th 05 06:15 PM
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:17 AM
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:09 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM


All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"