Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# How to use VLookUp or any other function to retrieve average values of cells?

Posted on 2013-12-18
Medium Priority
407 Views
Hello experts,

You can use the VLOOKUP function to search the first column of a range of cells, and then return a value from any cell on the same row of the range.

Is there anyway I can return all cells that meet my search criteria and average them, rather than only getting the first match.
0
Question by:Mehawitchi
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 43

Expert Comment

ID: 39726513
You can use MATCH to get the row number.

From that you can use the OFFSET function to get a number of columns in that particular row and then you can average it.
0

Author Comment

ID: 39726518
Thanks  ssaqibh

I'm not quite sure how to build this into a formula

Can you show me an example please
0

LVL 53

Assisted Solution

Rgonzo1971 earned 200 total points
ID: 39726523
Hi,

Why not use

``````=SUMIF(D1:D5,1,E1:E5)/COUNTIF(D1:D5,1)
``````
Regards
0

LVL 43

Assisted Solution

Saqib Husain, Syed earned 400 total points
ID: 39726525
Here is a sample
lookup-Average.xlsx
0

LVL 50

Accepted Solution

barry houdini earned 1400 total points
ID: 39726555
If you are using excel 2007 or later then AVERAGIF function allows you to average data based on a criterion, e.g. to average all cells in column B when column A = "x"

=AVERAGEIF(A:A,"x","B:B)

regards, barry
0

Author Closing Comment

ID: 39726594
Barry's solution is exactly what I need.
Thank you all
0

LVL 43

Expert Comment

ID: 39726596
I clearly misunderstood your requirements. You should have awarded all points to Barry.
0

Author Comment

ID: 39726618
No worries ssaqibh. You made a good attempt after all
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaacâ€¦
###### Suggested Courses
Course of the Month11 days, 10 hours left to enroll