AVERAGEIF question

Tazzbjs

New Member
Joined
Nov 2, 2011
Messages
37
I want to average all cells in a row based on the day of the week in another row and I only want it to include cells greater then 0. Essentially for the average returned in R2, the range is A2:N2, if A1:N1 is Sunday, return average for sundays and only include in the average if cell in row 2 is >0. I know this was a complicated explanation, but the best way I could tink to explain it.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]K[/TD]
[TD="align: center"]L[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]R[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Saturday[/TD]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[TD]Tuesday[/TD]
[TD]Wednesday[/TD]
[TD]Thursday[/TD]
[TD]Friday[/TD]
[TD]Saturday[/TD]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[TD]Tuesday[/TD]
[TD]Wednesday[/TD]
[TD]Thursday[/TD]
[TD]Friday[/TD]
[TD][/TD]
[TD][/TD]
[TD]DAY[/TD]
[TD]AVG[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]119[/TD]
[TD]36[/TD]
[TD]236[/TD]
[TD]246[/TD]
[TD]255[/TD]
[TD]254[/TD]
[TD]248[/TD]
[TD]116[/TD]
[TD]33[/TD]
[TD]241[/TD]
[TD]252[/TD]
[TD]265[/TD]
[TD]262[/TD]
[TD]254[/TD]
[TD][/TD]
[TD][/TD]
[TD]Sun[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][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]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Sat[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Start by making sure that the strings in column Q are the same as the strings in row 1. "Sunday", "Monday" etc, or "Sun", "Mon" etc.

(Or is the difference part of the problem that you need to solve?)

Then if you have Excel 2010 (2007?) or later, enter the following into R2 and copy down:

=AVERAGEIFS($A$2:$N$2, $A$2:$N$2, ">0", $A$1:$N$1, Q2)

If AVERAGEIFS does not work for you (#NAME error), let us know.
 
Last edited:
Upvote 0
Solution
So A1:N1 is text, NOT a date with a formatted cell that returns the day of the week?

Does this work?

=AVERAGEIFS(A2:N2,A1:N1,"Sunday",A2:N2,">0")
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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