find longest duration between 2 dates based on specic criteria

learning1984

New Member
Joined
Mar 2, 2016
Messages
14
Hello,

this formula works great, (=MAX(TODAY()-MAX(Log!$D$5:$D$482),AGGREGATE(14,4,Log!$D$6:$D$482-Log!$D$5:$D$481,1))-1)) to find the longest duration between all incidents

i'm just wondering if I can add an "if" to the beginning of the formula,

i am wanting to find the longest duration between incidents that occurred in section 1, team 1, section 1 team 2 etc

the formula I have come up with so far just results in false.

=IF(Log!$EU$5:$EU$499=AC18,IF(Log!$I$5:$I$499=AC17,MAX(TODAY()-MAX(Log!$D$5:$D$482),AGGREGATE(14,4,Log!$D$6:$D$482-Log!$D$5:$D$481,1))-1))

in the "log" sheet, column EU contains the Team number, column I is the section number

this is both with and with out ****, Ctrl, Enter.

example of basic sheet, without the section and team columns in view

M.I RefInvestigatorDatePeriod
-team 125/09/20161
2609161934team 126/09/20161
2609161640team 726/09/20161
team 427/09/20161
team 101/10/20161

<tbody>
</tbody>
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,627
Messages
6,120,610
Members
448,973
Latest member
ChristineC

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