Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Cheese
 
Posts: n/a
Default Average Function with Day of Week Criteria

This is for Excel 2000.

I want to compute averages based on the day of the week listed in another
column but within the same row. I already have the day of the week figured
out, column A has numbers 1-7, 1=Sunday, 2=Monday, etc.

What I want is to take the AVERAGE of B1:B200, *if* the value in column A=1,
or whatever number or numbers I specify.
  #2   Report Post  
Max
 
Posts: n/a
Default Average Function with Day of Week Criteria

One way ..

Put in C1: =ROW()

Put in D1, and array-enter (press CTRL+SHIFT+ENTER):
=AVERAGE(IF(($B$1:$B$200<"")*($A$1:$A$200=C1),$B$ 1:$B$200))

Select C1:D1, copy down to D7

D1 to D7 will return the results
for the corresponding day of week listed in C1:C7
(You'd get the full list for days 1 - 7)
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Cheese" wrote in message
...
This is for Excel 2000.

I want to compute averages based on the day of the week listed in another
column but within the same row. I already have the day of the week figured
out, column A has numbers 1-7, 1=Sunday, 2=Monday, etc.

What I want is to take the AVERAGE of B1:B200, *if* the value in column

A=1,
or whatever number or numbers I specify.



  #3   Report Post  
Max
 
Posts: n/a
Default Average Function with Day of Week Criteria

... and a quick sample, in case needed:
http://cjoint.com/?lck01cr7y4
Cheese_newusers.xls

Note that the average formula as suggested will ignore empty cells or
formula cells within B1:B200 evaluating to null (""), re - the condition:
.... ($B$1:$B$200<"") ..

If we need it to ignore cells containing zeros as well,
then we could add-on say, the condition: .. ($B$1:$B$2000) ..
i.e. put instead in D1, array-enter as before, and copy down to D7:

=AVERAGE(IF(($B$1:$B$2000)*($B$1:$B$200<"")*($A$ 1:$A$200=C1),$B$1:$B$200))

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default Average Function with Day of Week Criteria

Max,

For the OPs information really, but it may not be appropriate to do the
blank test. If a week number is 1 and the value is blank, it may be correct
to include that in the average

=AVERAGE(IF($A$1:$A$200=C1,$B$1:$B$200))

BTW, brought a smile to my face seeing you use cjoint :-))

Regards

Bob


"Max" wrote in message
...
.. and a quick sample, in case needed:
http://cjoint.com/?lck01cr7y4
Cheese_newusers.xls

Note that the average formula as suggested will ignore empty cells or
formula cells within B1:B200 evaluating to null (""), re - the condition:
... ($B$1:$B$200<"") ..

If we need it to ignore cells containing zeros as well,
then we could add-on say, the condition: .. ($B$1:$B$2000) ..
i.e. put instead in D1, array-enter as before, and copy down to D7:


=AVERAGE(IF(($B$1:$B$2000)*($B$1:$B$200<"")*($A$ 1:$A$200=C1),$B$1:$B$200))

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--




  #5   Report Post  
Max
 
Posts: n/a
Default Average Function with Day of Week Criteria

Thanks for the comments, Bob. Think the options given would enable the OP to
figure out the conditional checks required, and how to add/remove conditions
as may be required.

BTW, brought a smile to my face seeing you use cjoint :-))

Ay, it was only the other day that I shared with Roger G the steps on using
cjoint <g. But I guess savefile.com still remains my primary choice, due to
its other features (project/folder feature for instance).
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--




  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default Average Function with Day of Week Criteria

"Max" wrote in message
...

Ay, it was only the other day that I shared with Roger G the steps on

using
cjoint <g. But I guess savefile.com still remains my primary choice, due

to
its other features (project/folder feature for instance).


Yes, savefile does seem to be more permanent, but for simple transient
files, I like the cjoint look and feel.


  #7   Report Post  
Cheese
 
Posts: n/a
Default Average Function with Day of Week Criteria

Thanks very much for your assistance. It worked great.
  #8   Report Post  
Max
 
Posts: n/a
Default Average Function with Day of Week Criteria

"Bob Phillips" wrote:
Yes, savefile does seem to be more permanent,
but for simple transient files, I like the cjoint look and feel.

For uploading cjoint seems much more accessible,
while savefile's quite full of late
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #9   Report Post  
Max
 
Posts: n/a
Default Average Function with Day of Week Criteria

Glad to hear that !
Thanks for the feedback (from us <g )
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Cheese" wrote in message
...
Thanks very much for your assistance. It worked great.



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 function and two criteria Paula M Excel Worksheet Functions 6 August 26th 05 02:24 PM
Average of numbers within a range meeting certain criteria opal23k Excel Worksheet Functions 4 August 25th 05 08:51 PM
Using ADD function within DCOUNT criteria DaveF2002 Excel Discussion (Misc queries) 4 June 19th 05 09:48 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Using the average function LostNFound Excel Worksheet Functions 5 March 16th 05 12:45 PM


All times are GMT +1. The time now is 01:48 AM.

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"