#1   Report Post  
rmellison
 
Posts: n/a
Default Array functions

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an error
code. (Not sure if this is relevent but I have specified any error code to be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?
  #2   Report Post  
David Billigmeier
 
Posts: n/a
Default

Yes you can, is there any pattern to the discontinuous cells? In your
example, it looks like you want an average of just the odd numbered rows? In
that case you can use this formula (array formula entered Ctrl+Shift+Enter):

=AVERAGE(IF(MOD(ROW(A1:A10),2)=1,A1:A10,""))

Similarly, If you would like the average of the even rows then use:

=AVERAGE(IF(MOD(ROW(A1:A10),2)=0,A1:A10,""))

If you would like the average of every third row use:

=AVERAGE(IF(MOD(ROW(A1:A10),3)=0,A1:A10,""))

Does that help?
--
Regards,
Dave


"rmellison" wrote:

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an error
code. (Not sure if this is relevent but I have specified any error code to be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way (array-entered):

=AVERAGE(IF(MOD(ROW(A1:A10),2),IF(ISNUMBER(A1:A10) ,A1:A10)))

In article ,
rmellison wrote:

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an error
code. (Not sure if this is relevent but I have specified any error code to be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?

  #4   Report Post  
rmellison
 
Posts: n/a
Default

Yes and no.

The array function works, but i'm still unsure as to how to disregard cells
containing "#N/A". I'm trying a variation on the theme with:

{=AVERAGE(IF(--(MOD(COLUMN(L8:U8),2)=1)*(--(MOD(COLUMN(L8:U8),2)<"#N/A")),L8:U8,""))}

But it still yields #N/A if one of these appears within the cell range.

Could it be something to do with the fact that the #N/A cell within the
array itself is returned from a function - it is returned in an IF function
as #N/A rather than the string "#N/A". Perhaps this is relevant?


"David Billigmeier" wrote:

Yes you can, is there any pattern to the discontinuous cells? In your
example, it looks like you want an average of just the odd numbered rows? In
that case you can use this formula (array formula entered Ctrl+Shift+Enter):

=AVERAGE(IF(MOD(ROW(A1:A10),2)=1,A1:A10,""))

Similarly, If you would like the average of the even rows then use:

=AVERAGE(IF(MOD(ROW(A1:A10),2)=0,A1:A10,""))

If you would like the average of every third row use:

=AVERAGE(IF(MOD(ROW(A1:A10),3)=0,A1:A10,""))

Does that help?
--
Regards,
Dave


"rmellison" wrote:

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an error
code. (Not sure if this is relevent but I have specified any error code to be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?

  #5   Report Post  
RagDyeR
 
Posts: n/a
Default

Typo John:

=AVERAGE(IF(MOD(ROW(A1:A10),2)=0,IF(ISNUMBER(A1:A1 0),A1:A10)))

--

Regards,

RD
----------------------------------------------------------------------------
-------------------
Please keep all correspondence within the Group, so all may benefit !
----------------------------------------------------------------------------
-------------------

"JE McGimpsey" wrote in message
...
One way (array-entered):

=AVERAGE(IF(MOD(ROW(A1:A10),2),IF(ISNUMBER(A1:A10) ,A1:A10)))

In article ,
rmellison wrote:

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an

error
code. (Not sure if this is relevent but I have specified any error code to

be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?





  #6   Report Post  
David Billigmeier
 
Posts: n/a
Default

Try this (entered Ctrl+Shift+Enter):

=AVERAGE(IF((MOD(COLUMN(L8:U8),2)=1)*ISNUMBER(L8:U 8),L8:U8,""))
--
Regards,
Dave


"rmellison" wrote:

Yes and no.

The array function works, but i'm still unsure as to how to disregard cells
containing "#N/A". I'm trying a variation on the theme with:

{=AVERAGE(IF(--(MOD(COLUMN(L8:U8),2)=1)*(--(MOD(COLUMN(L8:U8),2)<"#N/A")),L8:U8,""))}

But it still yields #N/A if one of these appears within the cell range.

Could it be something to do with the fact that the #N/A cell within the
array itself is returned from a function - it is returned in an IF function
as #N/A rather than the string "#N/A". Perhaps this is relevant?


"David Billigmeier" wrote:

Yes you can, is there any pattern to the discontinuous cells? In your
example, it looks like you want an average of just the odd numbered rows? In
that case you can use this formula (array formula entered Ctrl+Shift+Enter):

=AVERAGE(IF(MOD(ROW(A1:A10),2)=1,A1:A10,""))

Similarly, If you would like the average of the even rows then use:

=AVERAGE(IF(MOD(ROW(A1:A10),2)=0,A1:A10,""))

If you would like the average of every third row use:

=AVERAGE(IF(MOD(ROW(A1:A10),3)=0,A1:A10,""))

Does that help?
--
Regards,
Dave


"rmellison" wrote:

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an error
code. (Not sure if this is relevent but I have specified any error code to be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?

  #7   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Nope.

Your formula averages the even rows. OP asked for the odds.

In article ,
"RagDyeR" wrote:

Typo

  #8   Report Post  
RagDyeR
 
Posts: n/a
Default

I missed that.

Foot-in-mouth disease!<g
--

Regards,

RD
----------------------------------------------------------------------------
-------------------
Please keep all correspondence within the Group, so all may benefit !
----------------------------------------------------------------------------
-------------------

"JE McGimpsey" wrote in message
...
Nope.

Your formula averages the even rows. OP asked for the odds.

In article ,
"RagDyeR" wrote:

Typo



  #9   Report Post  
rmellison
 
Posts: n/a
Default

Thanks to all! Both suggested methods work well!


"rmellison" wrote:

Thought I was getting the hand of array functions. Clearly not....

Can I use an array function with a set of discontiguous cells, for example
(A1,A3,A5,A7,A9) rather than A1:A10?

If not can someone suggest away of finding the average value of a set of
discontiguous cells, some of which may have numbers, others may have an error
code. (Not sure if this is relevent but I have specified any error code to be
#N/A to ensure that I can still use the data set for a line chart, and not
return a zero value for a cell with errors)?

Is there a way without using an array function?

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
Entering Array Functions Jaytee Excel Discussion (Misc queries) 1 August 28th 05 04:11 PM
Array functions ARGHH! Marc Fleury Excel Discussion (Misc queries) 1 March 16th 05 08:17 PM
array functions and ISNUMBER() Henrik Excel Worksheet Functions 1 February 10th 05 12:12 AM
Array Functions from Alan Beban Josh O. Excel Worksheet Functions 13 February 5th 05 12:54 AM
Array Functions - Two Questions MDW Excel Worksheet Functions 3 January 12th 05 06:54 PM


All times are GMT +1. The time now is 06:41 PM.

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

About Us

"It's about Microsoft Excel"