Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditional Average Array with Dates, <blanks, 0


I have the following table:

A B C E F G
H
Dates Month Age Jan Feb Mar Apr
1/3/2006 1 11 Average 33 20 47 59
1/26/2006 1 55
1/3/2006 1 <blank
2/4/2006 2 20
3/6/2006 3 0
3/5/2006 3 47
4/2/2006 4 50
4/13/2006 4 0
4/23/2006 4 67

I'm looking for a formula that will calculate the average age for each
month excluding <blanks and 0 value cells. I know I can use the
SUMPRODUCT function but how do I formulate the exclusions in each
array? Any ideas?


--
tangomj
------------------------------------------------------------------------
tangomj's Profile: http://www.excelforum.com/member.php...o&userid=36314
View this thread: http://www.excelforum.com/showthread...hreadid=560957

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Conditional Average Array with Dates, <blanks, 0

Hi!

One way:

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

=AVERAGE(IF(($B2:$B10=COLUMNS($A:A))*($C2:$C100), $C2:$C10))

Copy across as needed.

Biff

"tangomj" wrote in
message ...

I have the following table:

A B C E F G
H
Dates Month Age Jan Feb Mar Apr
1/3/2006 1 11 Average 33 20 47 59
1/26/2006 1 55
1/3/2006 1 <blank
2/4/2006 2 20
3/6/2006 3 0
3/5/2006 3 47
4/2/2006 4 50
4/13/2006 4 0
4/23/2006 4 67

I'm looking for a formula that will calculate the average age for each
month excluding <blanks and 0 value cells. I know I can use the
SUMPRODUCT function but how do I formulate the exclusions in each
array? Any ideas?


--
tangomj
------------------------------------------------------------------------
tangomj's Profile:
http://www.excelforum.com/member.php...o&userid=36314
View this thread: http://www.excelforum.com/showthread...hreadid=560957



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditional Average Array with Dates, <blanks, 0


Thanks for the reply but still not working. I get an error with the
following:

=AVERAGE(IF(Schedule!Q7:Q46=COLUMNS(Schedule!P7:P4 6))*(Schedule!Z7:Z460,
Schedule!Z7:Z46))

Maybe I don't need to use the "Dates" P column but only the "Month" Q
column? The Z column contains the Age values.


--
tangomj
------------------------------------------------------------------------
tangomj's Profile: http://www.excelforum.com/member.php...o&userid=36314
View this thread: http://www.excelforum.com/showthread...hreadid=560957

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Conditional Average Array with Dates, <blanks, 0

Maybe I don't need to use the "Dates" P column but only the "Month" Q
column?


That's what I did, used the month column. It eliminates the need for an
additional function call.

=AVERAGE(IF(Schedule!Q7:Q46=COLUMNS(Schedule!P7:P 46))*(Schedule!Z7:Z460,
Schedule!Z7:Z46))


Change this portion:

=COLUMNS(Schedule!P7:P46)

To:

=COLUMNS($A:A)

What that is doing is, as you copy across, the column number returned will
increment corresponding to the month:

=COLUMNS($A:A) = 1 corresponding to Jan
=COLUMNS($A:B) = 2 corresponding to Feb
=COLUMNS($A:C) = 3 corresponding to Mar
etc

Also, make sure you enter the formula as an array.

Biff

"tangomj" wrote in
message ...

Thanks for the reply but still not working. I get an error with the
following:

=AVERAGE(IF(Schedule!Q7:Q46=COLUMNS(Schedule!P7:P4 6))*(Schedule!Z7:Z460,
Schedule!Z7:Z46))

Maybe I don't need to use the "Dates" P column but only the "Month" Q
column? The Z column contains the Age values.


--
tangomj
------------------------------------------------------------------------
tangomj's Profile:
http://www.excelforum.com/member.php...o&userid=36314
View this thread: http://www.excelforum.com/showthread...hreadid=560957



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditional Average Array with Dates, <blanks, 0


Thank you. The following formula works:

{=AVERAGE(IF((Schedule!$Q7:$Q46=COLUMNS($E:E))*(Sc hedule!$Z7:$Z460),
Schedule!$Z7:$Z46))}

But I'm getting the #DIV/0! error on the Months which I do not have any
data. How can I default the average to a "0" or <blank if no data is
available for that month, instead of the #DIV/0! error? Please provide
two solutions for "0" or <blank results. Thx.


--
tangomj
------------------------------------------------------------------------
tangomj's Profile: http://www.excelforum.com/member.php...o&userid=36314
View this thread: http://www.excelforum.com/showthread...hreadid=560957



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Conditional Average Array with Dates, <blanks, 0

Try this:

Still array entered:

To return a blank:

=IF(SUMIF(schedule!$Q7:$Q46,COLUMNS($A:A),schedule !$Z7:$Z46),AVERAGE(IF((schedule!$Q7:$Q46=COLUMNS($ A:A))*(schedule!$Z7:$Z460),schedule!$Z7:$Z46)),"" )

To return 0 just replace the double quotes "" with a zero.

Biff

"tangomj" wrote in
message ...

Thank you. The following formula works:

{=AVERAGE(IF((Schedule!$Q7:$Q46=COLUMNS($E:E))*(Sc hedule!$Z7:$Z460),
Schedule!$Z7:$Z46))}

But I'm getting the #DIV/0! error on the Months which I do not have any
data. How can I default the average to a "0" or <blank if no data is
available for that month, instead of the #DIV/0! error? Please provide
two solutions for "0" or <blank results. Thx.


--
tangomj
------------------------------------------------------------------------
tangomj's Profile:
http://www.excelforum.com/member.php...o&userid=36314
View this thread: http://www.excelforum.com/showthread...hreadid=560957



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
Average between two dates Ross Excel Discussion (Misc queries) 1 July 12th 06 10:57 AM
Conditional formating using array formula?? Andre Croteau Excel Discussion (Misc queries) 1 February 10th 06 09:43 PM
Average Array help with a formula chedd via OfficeKB.com Excel Worksheet Functions 2 January 30th 06 11:30 PM
conditional formatting overdue dates Joooooooo Excel Discussion (Misc queries) 1 February 7th 05 01:14 PM
Conditional Formatting Dates John Excel Worksheet Functions 11 December 29th 04 08:43 PM


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