Cohort Aging Analysis using AVERAGEIF and SMALL w/ IF criteria

krisrdagon88

New Member
Joined
Apr 29, 2016
Messages
4
Hello wise ones,

I am doing some cohort analysis, and it is my first time trying functions like SMALL, LARGE, AGGREGATE, etc. This is as far as I got, and I'm stuck! I've included a Dropbox link to an Excel file with select data. In summary -

(See Screenshot #1)
For work, I am doing cohort aging analysis on all online applications that have been submitted for month-to-date April. In the Excel file > Data tab, each row represents an application, and there are 3 columns: Date Added (aka submitted), Date Approved, Duration (from Date Added to Approved). FYI - You'll see in the file that many don't have Date Approved timestamps yet, because, well, they haven't been processed. I'll be exporting this data weekly so there will new approval timestamps every week.

(See Screenshot #2) Back to the cohort aging analysis, I'm trying to find out, on average, how many days it takes the first 25% of applications to go from Date Added to Date Approved, then the next 25%, and the next 25%, and so on. On top of that, I'd like to view each week's application submissions as their own cohort.

Question: You'll see that I attempted a formula for 2 of the cells (the rest I just put "X days" as placeholder), using a combination of AVERAGEIF and SMALL, and I get the "DIV/0" error. How should I correct it? And/or is there another better way to set up this formula?

Screenshot #1

Unknown
ABC
1Date AddedDate ApprovedDuration
24/6/16 17:524/18/16 15:0311.8830208
34/3/16 15:094/18/16 15:0814.999375
44/4/16 16:474/18/16 15:1113.9334028
54/1/16 16:594/18/16 15:1416.9271875
64/13/16 0:404/18/16 15:305.61798611
74/12/16 12:214/18/16 15:326.13277778
84/2/16 15:554/18/16 15:3515.9862384
94/6/16 18:564/18/16 15:3711.8616782
Data


Screenshot #2

FYI, I attempted to troubleshoot on my own - I isolated the nested formula

=SMALL(IF((Data!A:A>=B3)*(Data!A:A<B4),Data!B:B),5)​

The 5th smallest / earliest approval date, for apps that came in between 4/2 and 4/8, should be 4/18/2016 3:35:35 PM. However, it returned 4/18/2016 3:30:13 PM instead, literally the 5th earliest approval date of all applications, ignoring the nested Date Added criteria. Not sure why!


Unknown
ABCDE
1Average # of days from Date Added to Approved
2Date Added:>=4/2 and <4/8>=4/8 and <4/14>=4/15 and <4/21>=4/22 and <4/28
3Beginning4/2/164/8/164/15/164/22/16
4End4/8/164/14/164/21/164/28/16
5# of apps25325321053
61st quartile#DIV/0!X daysX daysX days
72nd quartile#DIV/0!X daysX daysX days
83rd quartileX daysX daysX daysX days
94th quartileX daysX daysX daysX days
Summary
Cell Formulas
RangeFormula
B5=COUNTIFS(Data!$A:$A,">="&B3,Data!$A:$A,"<"&B4)
B6{=AVERAGEIF(Data!$B:$B,"<="&SMALL(IF((Data!$A:$A>=B$3)*(Data!$A:$A),Data!$B:$B),B$5/4),Data!$C:$C)}
B7{=AVERAGEIF(Data!$B:$B,"<="&SMALL(IF((Data!$A:$A>=B$3)*(Data!$A:$A),Data!$B:$B),B$5/4*2),Data!$C:$C)}
C5=COUNTIFS(Data!$A:$A,">="&C3,Data!$A:$A,"<"&C4)
D5=COUNTIFS(Data!$A:$A,">="&D3,Data!$A:$A,"<"&D4)
E5=COUNTIFS(Data!$A:$A,">="&E3,Data!$A:$A,"<"&E4)
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
It would be helpful if you could post some expected result with smaller sample data.
 
Upvote 0
Sure, let me just use the same data first, this is what I'm expecting

For the 253 applications that came in between 4/2-4/8, the first 25% to get approved averaged 14 days to approval. That's the result I'm expecting.

FYI - First 25% would be 63 apps, but in the data set only 48 have been approved so far, so the 14 days cited above is actually of the first 48 apps.

Appreciate any guidance or suggestions, and happy to provide more clarification!


Unknown
AB
14Date Added:>=4/2 and <4/8
15Beginning4/2/16
16End4/8/16
17# of apps253
181st quartile14.03
192nd quartile
203rd quartile
214th quartile
Summary
 
Upvote 0
Here's a smaller sample, and below this I pasted what I would expect. I've added it to the Dropbox file.


Unknown
ABC
1Date AddedDate ApprovedDuration
24/6/16 17:524/18/16 15:0311.8830208
34/3/16 15:094/18/16 15:0814.999375
44/4/16 16:474/18/16 15:1113.9334028
54/1/16 16:594/18/16 15:1416.9271875
64/13/16 0:404/18/16 15:305.61798611
74/12/16 12:214/18/16 15:326.13277778
84/2/16 15:554/18/16 15:3515.9862384
94/6/16 18:564/18/16 15:3711.8616782
104/2/16 18:544/18/16 15:5115.872662
114/6/16 21:044/18/16 15:5211.7831134
124/2/16 16:244/18/16 15:5815.9814931
Example Data



Unknown
ABC
1Date Added:>=4/2 and <4/8>=4/8 and <4/14
2Beginning4/2/164/8/16
3End4/8/164/14/16
4# of apps82
51st quartile13.445.88
62nd quartile14.96
73rd quartile13.87
84th quartile13.88
Example expected summary
Cell Formulas
RangeFormula
B4=COUNTIFS('Example Data'!$A:$A,">="&B2,'Example Data'!$A:$A,"<"&B3)
B5=AVERAGE('Example Data'!C2:C3)
B6=AVERAGE('Example Data'!C4,'Example Data'!C8)
B7=AVERAGE('Example Data'!C9:C10)
B8=AVERAGE('Example Data'!C11:C12)
C4=COUNTIFS('Example Data'!$A:$A,">="&C2,'Example Data'!$A:$A,"<"&C3)
C5=AVERAGE('Example Data'!C6:C7)
 
Upvote 0
Hi, would anybody be able to enlighten me on this situation? or if I'm approaching it the wrong way and should try a new setup, open to that as well. Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,053
Messages
6,122,882
Members
449,097
Latest member
dbomb1414

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