Average

ApolloID

Well-known Member
Joined
Jun 8, 2010
Messages
769
Hi, i need an average formula with criteria.

Ex:

sheet1
555 1
882 3
555 8
555 5
321 1
555 20


in sheet2 i have:
555 and average formula (8.5)

I need an average formula like an Vlookup or sumif formula but to display the average for all "555".

Can this be done?
Thanks!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Or

=AVERAGE(IF(Sheet1!A1:A6=555,Sheet1!B1:B6))

confirmed with CTRL + Shift + Enter.
 
Upvote 0
You can use a sumif to get the toal for 555 and a countif to get the number of instances of 555. one divided by the other will give you the average.

Say your data is in a1:b50. A contains the reference and b the total then:

=sumif(a1:a50,"555",b1:b50) divided by =countif(a1:a50,"555")

You can anchor the cells as required using $.
 
Upvote 0
You're welcome. But something you should consider is if you have 555 with a value of "0" (zero) you will effect the average becuase the countif will include the instance but there will be not value.
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,317
Members
452,905
Latest member
deadwings

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