Forumla to work out average

nathan663

Board Regular
Joined
Dec 3, 2008
Messages
153
In column B i have a list of numbers eg. 671, 672, 673 etc. these numbers are repeated a number of times. In column O I have a list of numerical numbers that i need to work out the averages for.

So i need a formula that looks up all the 671's in column B and takes their scores from column O and works returns the average.
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Which version of Excel are you using? In Excel 2007 and later you can use AVERAGEIF function

=AVERAGEIF(B:B,671,O:O)
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Try

=AVERAGE(IF(B1:B100=671,O1:O100))

IMPORTANT
This is an array formula that requires CTRL + SHIFT + ENTER
After entering the formula, highlight the cell with the formula and press F2
Then press CTRL + SHIFT + ENTER
When entered correctly, the formula will be enclosed in {brackets}

Also, you cannot use entire column references like B:B, must use row #s like B1:B100
Unless in XL2007 or higher. And even then it's not recommended.
 

prabby25101981

Active Member
Joined
Jul 28, 2010
Messages
348
=SUMPRODUCT(--(B1:B100=671),AVERAGE(O1:O100))

Change the range accordingly. Hope this helps!
 

nathan663

Board Regular
Joined
Dec 3, 2008
Messages
153
i am still using 2000, but i will be getting 2007 soon, however i need the formula to work on both versions

thanks
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
OK then, you can use Jonmo's array formula suggestion or for a non-array version

=SUMIF(B1:B100,671,O1:O100)/MAX(1,COUNTIF(B1:B100,671))
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,856
Messages
5,513,815
Members
408,971
Latest member
kay_dee8

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top