"Average(If" not working

The Power Loon

New Member
Joined
Feb 7, 2020
Messages
34
Office Version
  1. 365
Platform
  1. Windows
I am currently averaging values in one table based off of their rankings in a separate table. I am doing so for each combination of the potential rankings. The formula below works for this purpose.

=AVERAGE(IF((Table2[ranking]=B2)+(Table2[ranking]=C2)+(Table2[ranking]=D2),Table3[Value]))

However, I want to also factor in the category into which the values fell. When I add "Category" to the formula, it doesn't return the correct values.

=AVERAGE(IF((Table2[ranking]=B2)+(Table2[ranking]=C2)+(Table2[ranking]=D2)+(Table5[category]=$L$2),Table3[Value]))

Attached is a picture with a small sample of data for demonstrative purposes. As you'll see in the picture, A2 should be the average of all values with a ranking of "1" AND a category of "1st to 2nd" (result should be 102.25). However, i am getting a different value that I have no idea how i'm getting.

Any ideas about what i'm doing wrong with this formula?
 

Attachments

  • Eval.PNG
    Eval.PNG
    27.9 KB · Views: 29

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I think this is what you want.

=AVERAGE(IF(((Table2[ranking]=B2)+(Table2[ranking]=C2)+(Table2[ranking]=D2))*(Table5[category]=$L$2),Table3[Value]))
 
Upvote 0
I think this is what you want.

=AVERAGE(IF(((Table2[ranking]=B2)+(Table2[ranking]=C2)+(Table2[ranking]=D2))*(Table5[category]=$L$2),Table3[Value]))
Thank you for the response.

Unfortunately, that did not work, though it did return different values than before.
 
Upvote 0
I suspect that it works just fine. I used the same references as the formula in your post, which is looking at 2nd to 3rd, not 1st to 2nd as you described.

You are correct. I didn't realize i had it set for $L$2 instead of $L$1. Thank you for your help
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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