Average number of days between multiple events in a time interval.

flex33

New Member
Joined
Feb 23, 2012
Messages
37
Appreciate you folks possibly helping on this formula.

I am looking for a single cell formula, it will calculate the average number of days between orders during a 30 day period. (The value of the order doesn't matter) For simplicity imagine that three orders come in during the 30 days, on Days 3, 21, 22.


Date range is 1 through 30

The first interval average is 21-3=18

and the second interval is 22-21=1

The average interval overall is (18+1)/2 = 9.5 days



It seems easy, the hard part for me is the 'end of the first interval is the beginning of the second interval'. Maybe there is some advanced array formula that already does this?

2021-05-02 1315.jpg
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
If you're determining the average interval like that, then you don't need anything more than some counts. This assumes you manually set the range to begin when the first event occurs (that could be done in the formula too if desired):
Book3
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1
2Average interval6.33
3
4
5Day123456789101112131415161718192021222324252627282930
610010010022
Sheet1
Cell Formulas
RangeFormula
B2B2=(COLUMNS(D6:W6)-1)/(COUNT(D6:W6)-1)
 
Upvote 0
The yellow cells illustrate my last comment...the formula determines the first and last entries in the 30-day block and computes the average interval, and the formula in B2 can be ignored:
Book3
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1
2Average interval4.6
3Average interval4.6
4
5Day123456789101112131415161718192021222324252627282930
6100100100100100100
7
8Longhand231
9396
1092112
1121221
1222253
134.6
Sheet1
Cell Formulas
RangeFormula
B2B2=(COLUMNS(C6:Z6)-1)/(COUNT(C6:Z6)-1)
B3B3=(AGGREGATE(14,6,(COLUMN(B5:AE5)-COLUMN(A5))/(B6:AE6<>""),1) - AGGREGATE(15,6,(COLUMN(B5:AE5)-COLUMN(A5))/(B6:AE6<>""),1))/(COUNT(B6:AE6)-1)
D8:D12D8=C8-B8
D13D13=AVERAGE(D8:D12)
 
Upvote 0
Solution
OMG KRice. It's amazing how some brains work in such better ways for solutions - yours in this case. Thank you, this solution is perfect!
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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