# Formula for adding values together in columns with certain criteria then averaging the data

#### Slehvin

##### New Member
Hopefully the title makes sense. I have searched and searched for the last couple months on various boards and search engines and only find basic CountIf type formulas.
I am trying to work out a formula that will take a number and add it to other numbers in the same row, though only if the column meets a certain criteria. Then average the numbers based on the occurrences of the criteria. Did that make sense?

 Bob 11 Sarah 9 Bob 3 John 5 David 6 Sarah 2 David 3 Sarah 4

<tbody>
</tbody>

So I am trying to get a formula that will show Bob = 7, Sarah = 5, John = 5, David = 4.5
I am working in a spreadsheet with just about 300 entries with 10 to 20 new entries each month so by the end of the year I should be close to 400 entries.

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try in C1 copied down

=SUMIF(A\$1:A\$100,A1,B1:B1)/COUNTIF(A\$1:A\$100,A1)

Sheet1

 A B C D E F 1 Bob 11 Bob 7 2 Sarah 9 Sarah 5 3 Bob 3 John 5 4 John 5 David 4.5 5 David 6 6 Sarah 2 7 David 3 8 Sarah 4

<colgroup><col style="width: 30px; font-weight: bold;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"></colgroup><tbody>
</tbody>

 Cell Formula F1 =SUMIF(\$A\$1:\$A\$100,E1,\$B\$1:\$B\$8)/COUNTIF(\$A\$1:\$A\$100,E1) F2 =SUMIF(\$A\$1:\$A\$100,E2,\$B\$1:\$B\$8)/COUNTIF(\$A\$1:\$A\$100,E2) F3 =SUMIF(\$A\$1:\$A\$100,E3,\$B\$1:\$B\$8)/COUNTIF(\$A\$1:\$A\$100,E3) F4 =SUMIF(\$A\$1:\$A\$100,E4,\$B\$1:\$B\$8)/COUNTIF(\$A\$1:\$A\$100,E4)

<tbody>
</tbody>

<tbody>
</tbody>

Excel tables to the web >> Excel Jeanie HTML 4

If you have Excel2007 or up, you can use :

( Using Dryver14's table)

F1, formula copy down

=AVERAGEIF(A\$1:A\$8,E1,B\$1:B\$8)

Regards

Thank you, I will try all these. I did forget to mention that I am using Excel 2010.

Replies
19
Views
555
Replies
1
Views
152
Replies
2
Views
392
Replies
0
Views
252
Replies
0
Views
452

1,206,754
Messages
6,074,750
Members
446,083
Latest member
kfunt

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