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

x
Solved

# I need an average for certain criteria in Excel 2007

Posted on 2011-02-15
Medium Priority
284 Views
I am trying to find an average number of days it takes to complete a task.

Column A has the agent name
column B has the date assigned
Column C has the date completed.

I want to average up the information for say, Agent John Smith across a large range. I will be referencing the agent names by a list in a cell range so i would need it to refernce A5 for "John Smith" (I have 183 agents so I dont want to have to type their names in a formula.

Thanks!
0
Question by:wrt1mea
[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
• 3
• 3

LVL 50

Expert Comment

ID: 34901412
Assuming you have data on data worksheet then try like this

=AVERAGE(IF(Data!A\$2:A\$1000=A5,Data!C\$2:C\$1000-Data!B\$2:B\$1000))

confirmed with CTRL+SHIFT+ENTER

assumes that all rows have both dates.....

regards, barry
0

LVL 50

Expert Comment

ID: 34901513
Here's an example of the above suggestion.....

regards, barry
26823898.xlsx
0

LVL 1

Author Comment

ID: 34901528
what if all the rows do not have both dates? I am returning an "#N/A"
0

LVL 1

Author Comment

ID: 34901585
OK, the "#N/A" error was due to me not adding another zero to the range fro A, B, & C....

I was able to correct that, but the value is coming up 0" for everything
0

LVL 50

Accepted Solution

barry houdini earned 2000 total points
ID: 34901914
Have you confirmed with CTRL+SHIFT+ENTER?

You can see that in my example - the formulas display enclosed in curly braces like { and }

To do that select the first cell with the formula, press F2 to select formula then hold down CTRL and SHIFT keys and press ENTER, you should then see the curly braces and get a result....

If you don't have both dates what do you want to do? If you want to ignore those rows completely then you can try another "array formula", i.e.

=AVERAGE(IF(Data!A\$2:A\$1000=A5,IF(Data!C\$2:C\$1000<>"",Data!C\$2:C\$1000-Data!B\$2:B\$1000)))

again, with CTRL+SHIFT+ENTER

or to avoid array formulas you can use AVERAGEIFS functions like this

=AVERAGEIFS(Data!C\$2:C\$1000,Data!A\$2:A\$1000,A5,Data!C\$2:C\$1000,"<>")-AVERAGEIFS(Data!B\$2:B\$1000,Data!A\$2:A\$1000,A5,Data!C\$2:C\$1000,"<>")

which also ignores rows that don't have a completion date

regards, barry
0

LVL 1

Author Closing Comment

ID: 34902141
=AVERAGEIFS(Data!C\$2:C\$1000,Data!A\$2:A\$1000,A5,Data!C\$2:C\$1000,"<>")-AVERAGEIFS(Data!B\$2:B\$1000,Data!A\$2:A\$1000,A5,Data!C\$2:C\$1000,"<>")

Works great! Thanks for the help!
0

## Featured Post

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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 Month8 days, 20 hours left to enroll