# "Average(If" not working

#### The Power Loon

##### New Member
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
27.9 KB · Views: 12

### Excel Facts

Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

#### jasonb75

##### Well-known Member
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
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
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.

#### The Power Loon

##### New Member
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

Replies
0
Views
110
Replies
4
Views
145
Replies
0
Views
202
Replies
5
Views
150
Replies
11
Views
267

1,181,630
Messages
5,931,077
Members
436,774
Latest member
OKCIrish

### 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.

### Which adblocker are you using?

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

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