Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nick
 
Posts: n/a
Default average based on weekday

I'm trying to average a column of numbers based on the day of the week.
Col A has the sequential days of the month, Col B has a number for each day.
I want to average all the numbers in Col B that are based on a weekday or
weekend.
--
Thanks,
Nick
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Nick,

For the weekend average,

=SUMPRODUCT((WEEKDAY(A1:A365,2)5)*B1:B365)/SUMPRODUCT((WEEKDAY(A1:A365,2)5)*1)

For the weekday average
=SUMPRODUCT((WEEKDAY(A1:A365,2)<6)*B1:B365)/SUMPRODUCT((WEEKDAY(A1:A365,2)<6)*1)

HTH,
Bernie
MS Excel MVP


"Nick" wrote in message
...
I'm trying to average a column of numbers based on the day of the week.
Col A has the sequential days of the month, Col B has a number for each day.
I want to average all the numbers in Col B that are based on a weekday or
weekend.
--
Thanks,
Nick



  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Weekends: =SUMPRODUCT(--(WEEKDAY(A2:A10,2)5),B2:B10)
Weekdays: =SUMPRODUCT(--(WEEKDAY(A2:A10,2)<=5),B2:B10)

--
HTH

Bob Phillips

"Nick" wrote in message
...
I'm trying to average a column of numbers based on the day of the week.
Col A has the sequential days of the month, Col B has a number for each

day.
I want to average all the numbers in Col B that are based on a weekday or
weekend.
--
Thanks,
Nick



  #4   Report Post  
Max
 
Posts: n/a
Default

Try, array-entered, i.e. press CTRL+SHIFT+ENTER:

For weekdays:
=AVERAGE(IF(WEEKDAY(A1:A8,2)={1,2,3,4,5},B1:B8))

For weekends:
=AVERAGE(IF(WEEKDAY(A1:A8,2)={6,7},B1:B8))

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Nick" wrote in message
...
I'm trying to average a column of numbers based on the day of the week.
Col A has the sequential days of the month, Col B has a number for each

day.
I want to average all the numbers in Col B that are based on a weekday or
weekend.
--
Thanks,
Nick



  #5   Report Post  
Nick
 
Posts: n/a
Default

WOW, three great answers with three different approachs and in such a short
time.

Thank you ever so much,
Nick


"Max" wrote:

Try, array-entered, i.e. press CTRL+SHIFT+ENTER:

For weekdays:
=AVERAGE(IF(WEEKDAY(A1:A8,2)={1,2,3,4,5},B1:B8))

For weekends:
=AVERAGE(IF(WEEKDAY(A1:A8,2)={6,7},B1:B8))

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Nick" wrote in message
...
I'm trying to average a column of numbers based on the day of the week.
Col A has the sequential days of the month, Col B has a number for each

day.
I want to average all the numbers in Col B that are based on a weekday or
weekend.
--
Thanks,
Nick






  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

I like this answer best Max, but haven't we been here before

=AVERAGE(IF(WEEKDAY(A1:A8,2)<=5,B1:B8))

<EVBG

Bob

"Max" wrote in message
...
Try, array-entered, i.e. press CTRL+SHIFT+ENTER:

For weekdays:
=AVERAGE(IF(WEEKDAY(A1:A8,2)={1,2,3,4,5},B1:B8))

For weekends:
=AVERAGE(IF(WEEKDAY(A1:A8,2)={6,7},B1:B8))

Adapt the ranges to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Nick" wrote in message
...
I'm trying to average a column of numbers based on the day of the week.
Col A has the sequential days of the month, Col B has a number for each

day.
I want to average all the numbers in Col B that are based on a weekday

or
weekend.
--
Thanks,
Nick





  #7   Report Post  
Max
 
Posts: n/a
Default

You're welcome !
Thanks for the feedback (from us <g) ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Nick" wrote in message
...
WOW, three great answers with three different approachs
and in such a short time.

Thank you ever so much,
Nick



  #8   Report Post  
Max
 
Posts: n/a
Default

"Bob Phillips" wrote
I like this answer best Max, but haven't we been here before
=AVERAGE(IF(WEEKDAY(A1:A8,2)<=5,B1:B8))
<EVBG


Yes (scratch-scratch) I vaguely recollect .. the conditional formatting
episode ? <bg. Heck, it's now confirmed as one of my several blind spots:
that 1 week = 7 days only, Bob ! Cheers.
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


  #9   Report Post  
Bob Phillips
 
Posts: n/a
Default

hey Max,

Greeting from Wessex

The best part is that you used the ,2 argument to make the list simpler, but
stopped one step short

=AVERAGE(IF(WEEKDAY(A1:A8,2)={1,2,3,4,5},B1:B8))

which I think is as previous.

Be content in that the concept was the best though <g

Bob

"Max" wrote in message
...
"Bob Phillips" wrote
I like this answer best Max, but haven't we been here before
=AVERAGE(IF(WEEKDAY(A1:A8,2)<=5,B1:B8))
<EVBG


Yes (scratch-scratch) I vaguely recollect .. the conditional formatting
episode ? <bg. Heck, it's now confirmed as one of my several blind

spots:
that 1 week = 7 days only, Bob ! Cheers.
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----




  #10   Report Post  
Max
 
Posts: n/a
Default

Be content in that the concept was the best though <g

Thanks for the view ! <g
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


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
plotted Average Micayla Bergen Charts and Charting in Excel 4 July 15th 05 12:13 PM
How can I enter a value and obtain an average based upon tiers. M Purvis Excel Discussion (Misc queries) 2 June 7th 05 11:09 AM
52 week average based on date tomandrobyn Excel Discussion (Misc queries) 5 June 3rd 05 07:34 PM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM
GradeBook WannaKooky Excel Worksheet Functions 1 November 4th 04 02:23 PM


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