"Average(If" not working

The Power Loon

New Member
Joined
Feb 7, 2020
Messages
17
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: 7

Excel Facts

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

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
14,564
Office Version
  1. 365
Platform
  1. Windows
I think this is what you want.

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

The Power Loon

New Member
Joined
Feb 7, 2020
Messages
17
Office Version
  1. 365
Platform
  1. Windows
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.
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
14,564
Office Version
  1. 365
Platform
  1. Windows
Unfortunately, that did not work,
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.
 
Solution

The Power Loon

New Member
Joined
Feb 7, 2020
Messages
17
Office Version
  1. 365
Platform
  1. Windows
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
 

Forum statistics

Threads
1,148,250
Messages
5,745,638
Members
423,965
Latest member
visionquest1972

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
Top