VLOOKUP a Condition, Yield an average CYCLE TIME of the population within a date range

WADECIMA

New Member
Joined
May 3, 2018
Messages
6
Can't seem to get the right formula for Non-Conformance Closure Cycle time to measure how well one aspect of our NCR process is working.
NOTE: All of the information I am working with is DATA-LINKED from another system that can't be modified easily due to the front end design of the input template.


PROBLEM: Need to identify how many NCR's were closed within a user defined DATE range (i.e: 1/1/2018 - 1/31/2018)

We have a formula to count how many NCR's were closed within the user defined date range.

STEP 1 [=COUNTIFS('NCR DATA'!X:X,">="&C1,'NCR DATA'!X:X,"<="&C2+1)]

The 3 main data columns are as follows:

[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD]
Column A
[/TD]
[TD]
Column T
[/TD]
[TD]
Column X
[/TD]
[/TR]
[TR]
[TD]DATE OF CREATION
[/TD]
[TD]NCR STATUS
[/TD]
[TD]VERIFIED ON
[/TD]
[/TR]
[TR]
[TD]4/25/2018
[/TD]
[TD]OPEN
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4/12/2018
[/TD]
[TD]CLOSED
[/TD]
[TD]4/28/2018
[/TD]
[/TR]
[TR]
[TD]3/30/2018
[/TD]
[TD]PENDING
[/TD]
[TD]4/18/2018
[/TD]
[/TR]
[TR]
[TD]3/8/2018
[/TD]
[TD]CLOSED
[/TD]
[TD]3/15/2018
[/TD]
[/TR]
[TR]
[TD]3/1/2018
[/TD]
[TD]CLOSED
[/TD]
[TD]3/10/2018
[/TD]
[/TR]
[TR]
[TD]1/18/2018
[/TD]
[TD]CLOSED
[/TD]
[TD]1/20/2018
[/TD]
[/TR]
[TR]
[TD]1/18/2018
[/TD]
[TD]CLOSED
[/TD]
[TD]1/25/2018
[/TD]
[/TR]
[TR]
[TD]1/15/2018
[/TD]
[TD]CLOSED
[/TD]
[TD]1/29/2018
[/TD]
[/TR]
</tbody>[/TABLE]


Step 1: Identify the population of all CLOSED NCR's that fall within the user define DATE range. (GOT THAT PART)
Step 2: Calculate the closure cycle time in workdays for each CLOSEDNCR (Column X - Column A).
Step 3: Calculate the AVERAGE days based on the number of NCR's closed. =(SUM of all WORKDAYS TO CLOSE NCRS / Number of NCR's closed).

I would appreciate any ideas on how to accomplish this.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Welcome to the MrExcel board!

1. Why do you have C2+1 in your step 1 formula? To me, that would include any NCRs closed on 1 February if your date range ended on 31 January (C2). Until I hear otherwise, I will assume that '+1' is a mistake. And doesn't the countifs need to check for 'Closed' in column T to avoid the possibility of counting a 'Pending'?

2. Note that my dates are in d/m/y format.

3. I would recommend not using whole column references. Some functions can work out to only use the 'used rows' but others will calculate all 1,000,000+ rows! I have used to row 100 in my examples below but if this is what you want, adjust for whatever your data size is.

4. I have assumed workdays means Monday - Friday.

My 'NCR DATA' sheet is what you have shown above, using rows 1:9 in columns A, T and X.

Here is my results sheet. Does it do what you want?

Excel Workbook
BC
1Start1/01/2018
2End31/01/2018
3
4Count3
5WorkDays19
6Average6.333333333
Results
 
Last edited:
Upvote 0
Peter:

You were right to question the C2+1....I was trying to correct for a TIME-STAMP issue which turned out to be my error in selecting a default date format with '*d/mm/yyyy' instead of 'd/mm/yyyy'. I forgot the asterix(*) makes the date time sensitive which forced the COUNTIFS formula on my dashboard to ignore any data that was entered after 0:00:00.

I have since fixed the date format. And thanks for the formula, will let you know the outcome shortly.



[TABLE="width: 795"]
<tbody>[TR]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]
 
Upvote 0
The COUNT formula you provided in C4 works and provided an extra layer of validation (thanks).

The formula in C5 provides a '#VALUE!' result. I have checked the column/row references and they are in order. I also tried ARRAY bracket but that made no difference.

What am I missing?
 
Upvote 0
Had a realization the formula in C5 assumes the NCR initiation date is ">=" the start date for the data analysis from cell C1. Fact is some NCR could have started before the date entered in cell C1.

SUMPRODUCT(--('NCR DATA'!A2:A100>=C1),--('NCR DATA'!X2:X100<=C2),--('NCR DATA'!X2:X100<>""),NETWORKDAYS('NCR DATA'!A2:A100+0,'NCR DATA'!X2:X100+0)).


BC
Start
End
Count
WorkDays
Average

<colgroup><col style="width: 30px; font-weight: bold;"><col style="width: 86px;"><col style="width: 85px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]1[/TD]

[TD="align: right"]1/01/2018[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]2[/TD]

[TD="align: right"]31/01/2018[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]4[/TD]

[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]5[/TD]

[TD="align: right"]19[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=CACACA]#CACACA[/URL] , align: center"]6[/TD]

[TD="align: right"]6.333333333[/TD]

</tbody>

I made some changes to the Date of Creation for 2 of the sample data points.
[TABLE="width: 477"]
<tbody>[TR]
[TD](A)
DATE OF CREATION[/TD]
[TD](T)
NCR STATUS[/TD]
[TD](X)
VERIFIED ON[/TD]
[/TR]
[TR]
[TD]4/25/18[/TD]
[TD]OPEN[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]4/12/18[/TD]
[TD]CLOSED[/TD]
[TD]4/28/18[/TD]
[/TR]
[TR]
[TD]3/30/18[/TD]
[TD]PENDING[/TD]
[TD]4/25/18[/TD]
[/TR]
[TR]
[TD]3/8/18[/TD]
[TD]CLOSED[/TD]
[TD]3/15/18[/TD]
[/TR]
[TR]
[TD]12/1/17[/TD]
[TD]CLOSED[/TD]
[TD]1/31/18[/TD]
[/TR]
[TR]
[TD]11/15/17[/TD]
[TD]CLOSED[/TD]
[TD]1/20/18[/TD]
[/TR]
[TR]
[TD]1/18/18[/TD]
[TD]CLOSED[/TD]
[TD]1/25/18[/TD]
[/TR]
[TR]
[TD]1/15/18[/TD]
[TD]CLOSED[/TD]
[TD]1/29/18[/TD]
[/TR]
</tbody><colgroup><col span="3"></colgroup>[/TABLE]
 
Upvote 0
So, what are the expected results, calculated manually, for that latest sample data?
Any detail of how you made that (manual) calculation would also be beneficial.
 
Upvote 0
After looking at this with a student in our office, who is quite adept at Excel, he came up with this ARRAY formula which delivered the needed results. We did look at your formula which triggered an idea on is part. This is just test data to prove the formula works and I will apply your tip to limit the ROWS in the formulas.


EMBEDDED IN CELL E6 {=SUM(IF(B:B="CLOSED",IF(C:C<=B3,IF(C:C>=B2,NETWORKDAYS(A:A+0,C:C+0),0),0),0))/COUNTIF(B:B,"CLOSED")}


[TABLE="width: 558"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]START DATE[/TD]
[TD]1/1/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]END DATE[/TD]
[TD]2/28/2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]NCR CREATION[/TD]
[TD]NCR STATUS[/TD]
[TD]NCR CLOSURE DATE[/TD]
[TD] [/TD]
[TD]AVG CLOSURE NETWORKDAYS[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]3/1/2018[/TD]
[TD]CLOSED[/TD]
[TD]4/28/2018[/TD]
[TD][/TD]
[TD]13.4[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]2/20/2018[/TD]
[TD]CLOSED[/TD]
[TD]2/21/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]2/15/2018[/TD]
[TD]CLOSED[/TD]
[TD]2/22/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]2/9/2018[/TD]
[TD]CLOSED[/TD]
[TD]2/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]2/9/2018[/TD]
[TD]CLOSED[/TD]
[TD]2/23/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]1/16/2018[/TD]
[TD]CLOSED[/TD]
[TD]2/14/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]11/20/2017[/TD]
[TD]CLOSED[/TD]
[TD]1/20/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col></colgroup>[/TABLE]
 
Upvote 0
Made a few small changes.

=SUM(IF(C6:C12="CLOSED",IF(D6:D12<=C3,IF(D6:D12>=C2,NETWORKDAYS(B6:B12+0,D6:D12+0),0),0),0))/COUNTIFS(C6:C12,"CLOSED",D6:D12,"<="&C3,D6:D12,">="&C2)
 
Upvote 0
Glad that you got something that you are happy with. Thanks for letting us know. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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