Average Ifs not working

RoganLogan

New Member
Joined
Dec 7, 2011
Messages
45
Hi

I was trying to use averageifs to average numbers I have in row 1 from A1:AV1 by a corresponding criteria number I have in row 2 from A2:AV2. So if the numbers in the cells in row 1 have a 1 below in the criteria row 2 they are averaged in row 3 and the same for all the other criteria numbers. The criteria numbers in row 2 go from 1 to 20. This is what i want to achieve below with the formula in row 3 giving me the average

[TABLE="width: 200"]
<tbody>[TR]
[TD]10[/TD]
[TD]20[/TD]
[TD]25[/TD]
[TD]20[/TD]
[TD]40[/TD]
[TD]50[/TD]
[TD]30[/TD]
[TD]40[/TD]
[TD]50[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]18.33[/TD]
[TD]18.33[/TD]
[TD]18.33[/TD]
[TD]36.66[/TD]
[TD]36.66[/TD]
[TD]36.66[/TD]
[TD]40[/TD]
[TD]40[/TD]
[TD]40[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]


I tried using avergeifs but have since discovered that averageifs works on AND condition not OR. So I've tried using array formulas but still cant get it to work. Any help would be greatly appreciated.

Many thanks,

RL
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hard to follow.

What do we have in row 1? Data that you want to average?

What does row 2 contain?

What does row 3 contain?
 
Upvote 0
Yes, in row 1 is the data that I want to average by the criteria in row 2 with the result in row 3. Sorry if its hard to follow.
 
Upvote 0
Hi Eric, Yeah the Averageifs formula doesn't work and just gives me a #DIV/0! if I try any more than one criteria. I think averageifs works on a AND condition and I think I need it to do an OR to achieve what I'm after. Thanks for looking though.
 
Upvote 0
My test sheet matches your output exactly:

ABCDEFGHIJ
50
3

<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]40[/TD]

[TD="align: right"]30[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]10[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]

[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]18.33333333[/TD]
[TD="align: right"]18.3333[/TD]
[TD="align: right"]18.3333[/TD]
[TD="align: right"]36.6667[/TD]
[TD="align: right"]36.6667[/TD]
[TD="align: right"]36.6667[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]10[/TD]

</tbody>
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH]A3[/TH]
[TD="align: left"]=AVERAGEIFS($A$1:$AV$1,$A$2:$AV$2,A2)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




How are your requirements different? If you were to copy the formula to K3, you'd get a #DIV/0 error because there are no matching values. AVERAGEIFS can have more than one condition, but they are AND conditions as you surmise. But there are other ways to handle OR conditions. But please explain how your requirements differ from your example.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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