Average Cell Range based on Day of Week

kyddrivers

Board Regular
Joined
Mar 22, 2013
Messages
64
Office Version
  1. 365
Platform
  1. Windows
I am trying to average the values of a range of cells based on the day of the week.

The spreadsheet is setup as follows:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A:[/TD]
[TD]Column B:[/TD]
[/TR]
[TR]
[TD]1/4/15[/TD]
[TD]23.90%[/TD]
[/TR]
[TR]
[TD]1/5/15[/TD]
[TD]14.39%[/TD]
[/TR]
[TR]
[TD]1/6/15[/TD]
[TD]4.62%[/TD]
[/TR]
[TR]
[TD]1/7/15[/TD]
[TD]5.71%[/TD]
[/TR]
[TR]
[TD]1/8/15[/TD]
[TD]18.32%[/TD]
[/TR]
[TR]
[TD]1/9/15[/TD]
[TD]31.62%[/TD]
[/TR]
[TR]
[TD]1/10/15[/TD]
[TD]11.28%[/TD]
[/TR]
[TR]
[TD]1/11/15[/TD]
[TD]13.13%[/TD]
[/TR]
[TR]
[TD]1/12/15[/TD]
[TD]29.40%[/TD]
[/TR]
[TR]
[TD]1/13/15[/TD]
[TD]8.57%[/TD]
[/TR]
[TR]
[TD]1/14/15[/TD]
[TD]14.44%[/TD]
[/TR]
[TR]
[TD]1/15/15[/TD]
[TD]33.21%[/TD]
[/TR]
[TR]
[TD]1/16/15[/TD]
[TD]3.33%[/TD]
[/TR]
[TR]
[TD]1/17/15[/TD]
[TD]14.81%[/TD]
[/TR]
</tbody>[/TABLE]

What I am attempting to do is Average the cells in column b if the date in column a is a Sunday.

I have tried using a simple If(weekday(A1:A14)=1, Average(B1:B14), "") and this returns a #value error, but I don't think it would give me the answer of 18.52% I am looking for.

I have tried AverageIf(B1:B14, Weekday(A1:A14)=1) and I get #div/0!

Any help is greatly appreciated.

Thanks in advance!!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
This might be an overly complicated formula but it works:

=SUMPRODUCT(--(WEEKDAY(A2:A15)=1),B2:B15)/SUMPRODUCT(--(WEEKDAY(A2:A15)=1))
 
Upvote 0
Control+shift+enter, not just enter:

=IFERROR(AVERAGE(IF(WEEKDAY($A$2:$A$15,2)=7,$B$2:$B$15)),"")

where 7 = Sunday.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top