average formula based on date

spacecaptainsuperguy

Board Regular
Joined
Dec 30, 2004
Messages
202
Office Version
  1. 365
Platform
  1. Windows
I am so close to the answer, but I've spent the last couple of days floundering on it and I'm to the point where I could use some suggestions. I've got some data that shows a resignation date and a refund date and a field that calculates the number of days between the two. What I'm looking to do is create a formula that will calculate the average number of days for a given year. So for example, what was the average wait time for people that were refunded in 2007? Here is some sample data that I've been using to try to figure this one out. I suspect it will need an array formula & I've built a few over the years, but I'm not awesome with them. Any suggestions are much appreciated.

If the formula can calculate the number of days within the formula that would be even more awesome, since I don't really need that column of data (column D below)
Excel Workbook
ABCD
1NameResignedRefundedNo. of Days
2Gary Wooton12/28/20052/24/200658
3Rand McQuinn12/1/20054/28/2006148
4William Washburn1/16/20056/5/2006505
5Anthony Phifer7/26/200612/12/2006139
6Trip Duperier7/28/20064/4/2007250
7F. O'neil Griffin8/24/20065/9/2007258
8Tracy Wodskow9/20/20066/20/2007273
9Charles Farrell12/6/200612/19/2007378
10Graham King5/11/20061/15/2008614
11Scott Thompson12/6/20061/21/2008411
12Larry Johnson12/15/0604/10/08482
13Walter Johnson12/16/065/30/2008531
14Harland Dunn12/20/20068/17/2008606
15Virginia Turner12/31/20068/18/2008596
Sheet1
Excel 2007
Cell Formulas
RangeFormula
D2=+C2-B2
D3=+C3-B3
D4=+C4-B4
D5=+C5-B5
D6=+C6-B6
D7=+C7-B7
D8=+C8-B8
D9=+C9-B9
D10=+C10-B10
D11=+C11-B11
D12=+C12-B12
D13=+C13-B13
D14=+C14-B14
D15=+C15-B15
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Unfortunately no, for two reasons. This data is broken up into various blocks with empty rows between sections of them and I'm wanting to put this information in an existing management summary that lies on another sheet.

Ideally I will have this formula sitting in a column with a result for each year shown on the management summary.
 
Upvote 0
I got this to work, I used a combination of helper cells and sumif/countif.

Insert a new column D, pushing #Days to column E.

D2= =TEXT(C2, "yyyy") --copy this down the column


In I1,J1,K1,L1,M1,.... put 2005,2006,2007,2008,... respectively.

In I2 put =SUMIF($D$2:$D$1460,I$1,$E$2:$E$1460)/COUNTIF($D$2:$D$1460,I$1)

Copy this formula across j2,k2,l2.....


Change the bounds of the array, i trialed this with 1460 records.

Does this make sense? Will it work with your data?
 
Last edited:
Upvote 0
Desu,
That works great. I will keep working to see if there is a way to do your column D calculation (for the year) withing the final formula, but as is, it gets me where I need to be.

Thank you very much.
 
Upvote 0

Forum statistics

Threads
1,224,531
Messages
6,179,379
Members
452,907
Latest member
Roland Deschain

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