Date durations with multiple criteria

Aubreybake

New Member
Joined
Sep 16, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi!
I was trying to automate a column for duration (column E) between cycles (column D). Each cycle will have a discipline associated with it (Column B) and a date the cycle has been updated (column C). Each discipline also falls under a program (column A). Users of the spreadsheet will fill in columns A-D while E should automatically generate the duration since the last cycle update. The data input won’t be filtered so the program and discipline won’t be for an easy Datedif formula.

eg:
Program Discipline Date Cycle Duration
Shop 1 Permit 5/15/21 0 0
Shop 2 Design 8/10/21 0 0
Shop 1 Permit 5/30/21 1 15
Shop 3 Permit 9/05/21 0 0
Shop 2 Design 9/01/21 1 22
Shop 2 Permit 9/05/21 0 0

Sorry just typed this up on my phone and didn’t have access to the spreadsheet to share a snippet.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
do you mean
The data input won’t be filtered so the program and discipline won’t be for an easy Datedif formula.

As you are using version 365 - then I have used a MAXIFS () to calculate the Date and then a datedif
Also a countifs()

Hopefully the sample you showed is representative all all possible data entry - otherwise the formula will not work , as the dates need to be ascending, for this to work

Book1
ABCDEFGH
1ProgramDisciplineDateCycleDurationCycleDuration
2Shop 1Permit5/15/210000
3Shop 2Design8/10/210000
4Shop 1Permit5/30/21115115
5Shop 3Permit9/5/210000
6Shop 2Design9/1/21122122
7Shop 2Permit9/5/210000
Sheet1
Cell Formulas
RangeFormula
G2:G7G2=COUNTIFS($A$2:A2,A2,$B$2:B2,B2)-1
H2:H7H2=IF(MAXIFS($C$1:C1,$A$1:A1,A2,$B$1:B1,B2)=0,0,DATEDIF(MAXIFS($C$1:C1,$A$1:A1,A2,$B$1:B1,B2),C2,"D"))
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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