Solved

I need an average for certain criteria in Excel 2007

Posted on 2011-02-15
6
278 Views
Last Modified: 2012-05-11
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
Comment
Question by:wrt1mea
  • 3
  • 3
6 Comments
 
LVL 50

Expert Comment

by:barry houdini
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

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

regards, barry
26823898.xlsx
0
 
LVL 1

Author Comment

by:wrt1mea
ID: 34901528
what if all the rows do not have both dates? I am returning an "#N/A"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:wrt1mea
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

by:
barry houdini earned 500 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

by:wrt1mea
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now