"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: 15

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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