Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default Follow-up AVERAGEIF question

Office Excel 2007

The other day, someone here pointed me to the AVERAGEIF function as a way of
averaging a range of cells, but excluding from the computation any cell in
the range that had a zero value.

I've been able to get that to work...partially. But if I insert new rows,
the formula does not update to include those rows.

For example, if I have number entries in cells A1 through A5, and if cell A6
is =AVERAGEIF(A1:A4,"<0"), I get a result in A6. However, if I then insert
a new row above A6 and enter a value there...of course the old A6 becomes
A7, but the formula in the new A7 still read =AVERAGEIF(A1:A4,"<0"). I
would have expected it to change to (A1:A5,"<0")

This is what happens with the AVERAGE function. (Or the SUM function, for
that matter.)

How do I get the AVERAGEIF function to update to include newly-added rows?

Thanks!

Ken Isaacson
SILENT COUNSEL, a legal thriller
www.KenIsaacson.com


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Follow-up AVERAGEIF question

One way:

A6: =AVERAGEIF(A$1:INDEX(A:A,ROW()-2),"<0")


In article ,
"Ken" wrote:

Office Excel 2007

The other day, someone here pointed me to the AVERAGEIF function as a way of
averaging a range of cells, but excluding from the computation any cell in
the range that had a zero value.

I've been able to get that to work...partially. But if I insert new rows,
the formula does not update to include those rows.

For example, if I have number entries in cells A1 through A5, and if cell A6
is =AVERAGEIF(A1:A4,"<0"), I get a result in A6. However, if I then insert
a new row above A6 and enter a value there...of course the old A6 becomes
A7, but the formula in the new A7 still read =AVERAGEIF(A1:A4,"<0"). I
would have expected it to change to (A1:A5,"<0")

This is what happens with the AVERAGE function. (Or the SUM function, for
that matter.)

How do I get the AVERAGEIF function to update to include newly-added rows?

Thanks!

Ken Isaacson
SILENT COUNSEL, a legal thriller
www.KenIsaacson.com

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Follow-up AVERAGEIF question

It depends on where you insert the new row. You said:

if I then insert a new row above A6 and enter a value there


But you didn't say *exactly* where you inserted the new row. If you insert a
new row that is *within* the referenced range then Excel will include that
row in the calculation and adjust the range references accordingly. For
example:

AVERAGEIF(A1:A4,"<0")


If you insert a new row 5 Excel does nothing since row 5 is not *within* the
referenced range. If you insert a new row 1 Excel adjusts the range to
A2:A5. If you insert a new row 4 then Excel will include that new row 4 and
adjust the references to A1:A5.

--
Biff
Microsoft Excel MVP


"Ken" wrote in message
...
Office Excel 2007

The other day, someone here pointed me to the AVERAGEIF function as a way
of averaging a range of cells, but excluding from the computation any cell
in the range that had a zero value.

I've been able to get that to work...partially. But if I insert new rows,
the formula does not update to include those rows.

For example, if I have number entries in cells A1 through A5, and if cell
A6 is =AVERAGEIF(A1:A4,"<0"), I get a result in A6. However, if I then
insert a new row above A6 and enter a value there...of course the old A6
becomes A7, but the formula in the new A7 still read
=AVERAGEIF(A1:A4,"<0"). I would have expected it to change to
(A1:A5,"<0")

This is what happens with the AVERAGE function. (Or the SUM function, for
that matter.)

How do I get the AVERAGEIF function to update to include newly-added rows?

Thanks!

Ken Isaacson
SILENT COUNSEL, a legal thriller
www.KenIsaacson.com



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
Follow-up Question for Dave Peterson Roger Excel Discussion (Misc queries) 3 February 28th 08 04:27 PM
Follow-up to Logical Test Question Lance Excel Worksheet Functions 11 March 17th 06 08:14 PM
follow-up question regarding secondary Y-axes Patience Charts and Charting in Excel 1 November 11th 05 01:43 AM
Follow-Up (Clarification) to MIN question Odawg Excel Discussion (Misc queries) 4 October 20th 05 04:04 AM
Follow on from simple question 12/8/2004 Ajay Excel Discussion (Misc queries) 1 December 9th 04 11:55 PM


All times are GMT +1. The time now is 05:48 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"