Average Cell Range based on Day of Week

kyddrivers

Board Regular
Joined
Mar 22, 2013
Messages
59
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:

Column A:Column B:
1/4/1523.90%
1/5/1514.39%
1/6/154.62%
1/7/155.71%
1/8/1518.32%
1/9/1531.62%
1/10/1511.28%
1/11/1513.13%
1/12/1529.40%
1/13/158.57%
1/14/1514.44%
1/15/1533.21%
1/16/153.33%
1/17/1514.81%

<tbody>
</tbody>

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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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,216,588
Messages
6,131,587
Members
449,657
Latest member
Timber5

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