Calculating the unique days across overlapping date ranges

Strexxin

New Member
Joined
Feb 18, 2025
Messages
6
Office Version
  1. 365
Good day,

I am having some problems writing out a formula to calculate the number of unique days a system has been down if there are 2 or more tickets raised against it at the same time. In the below example data the result for System 1 being down would be 22 days as that is the difference between the start date on the first ticket and the end date on the second ticket. However every formula I write calculates each ticket individually and gives me a downtime of 32 days.



Ticket Number
Serial NumberSystem TypeTicket Start DateResolution Date
1234SN0001System 109/01/202528/01/2025
5678SN0001System 118/01/202531/01/2025

My current attempt is
=LET(_min, MINIFS($E$2:E5, $E$2:E5, "<"&F5, $F$2:F5, ">"&MIN($F$2:F5), $D$2:D5, $K$1),
_max, MAXIFS($F$2:F5, $F$2:F5, MAXIFS($F$2:F5, $D$2:D5, $K$1)),
_max - _min)


I have managed to tie myself in knots so any help on this would be appreciated
 
I am still getting 0 from Eric' formula and I am getting 1 from Cubist' formula
I get 1's with my formula when the dates are text. Test your date columns with =ISNUMBER().See column L.
Book1
ABCDEFGHIJKLMNOPQR
1Ticket NumberTicket StatusTicket OwnerSerial NumberSystem TypeSystem LocationTicket Start DateTicket Resolution DateSystem Install DateAge of System at Time of Ticket Raised (Days)Ticket Resolution Time (Days)ISNUMBERSystem TypeUnique DaysSerial NumberUnique Days
210208ClosedGM0683RADiant Aura 50Kv23/1/2512/2/2525/06/202421220FALSECIX312010-05051
310368OpenGS105CIX314/2/2528/09/20211235FALSEMedical Software12016-07551
410074Opengs099CIX319/12/2414/12/20201466FALSERADiant 50Kv12020-08791
510113ClosedGM0379X1502/1/2517/2/2525/07/2014381446FALSERADiant 80Kv1GM00861
610235OpenGM0517RADiant 80Kv27/1/2516/05/20192083FALSERADiant Aura 50Kv1GM03791
710242ClosedGM0683RADiant Aura 50Kv28/1/2517/2/2525/06/202421720FALSESARRP1GM04501
810190Open2020-0879SARRP20/1/25FALSEX1501GM04691
910331OpenGM0640X20010/2/2520/06/2024235FALSEX2001GM05171
109954OpenGM0536X30012/2/2427/08/20211193FALSEX3001gm05221
1110287OpenGM0564X2004/2/2519/03/20211418FALSEGM05281
1210049OpenGM0450Medical Software16/12/2415/09/20172649FALSEGM05361
1310198Opengm052221/1/2515/11/20191894FALSEGM05641
1410199Open2016-0755SARRP21/1/2529/08/20163067FALSEGM06401
1510168ClosedGM0528RADiant 50Kv15/1/2518/2/2522/06/2021130334FALSEGM06631
1610026ClosedGM0528RADiant 50Kv10/12/2418/2/2522/06/2021126770FALSEGM06831
179358ClosedGM0469X15011/9/2418/2/2520/07/20182245160FALSEgs0991
1810384Open2010-0505SARRP18/2/25FALSEGS1051
199909ClosedGM0663X20021/11/2418/2/2528/06/202414689FALSEGS1471
2010069OpenGS147CIX318/12/2400/01/190045644FALSE
2110193OpenGM0469X15020/1/2520/07/20182376FALSE
2210318OpenGM0086X1506/2/25381497397FALSE
Sheet9
Cell Formulas
RangeFormula
G2:H22G2=IF(T2:U22="","",TEXT(T2:U22,"d/m/yy"))
L2:L22L2=ISNUMBER(G2:G22)
N2:N10N2=SORT(TOCOL(UNIQUE(E2:E22),1))
O2:O10O2=BYROW(MAXIFS(H2:H22,E2:E22,N2#)-MINIFS(G2:G22,E2:E22,N2#)+1,LAMBDA(x,MAX(0,x)))
Q2:Q19Q2=SORT(TOCOL(UNIQUE(D2:D22),1))
R2:R19R2=BYROW(MAXIFS(H2:H22,D2:D22,Q2#)-MINIFS(G2:G22,D2:D22,Q2#)+1,LAMBDA(x,MAX(0,x)))
Dynamic array formulas.
 
Upvote 0
I want to thank both of you, the problem appeared to have lay with me. I was automating the input of this sheet from another system and that input was coming in as a strange format. Upon changing this format to date both solutions now work brilliantly.
 
Upvote 0

Forum statistics

Threads
1,226,795
Messages
6,193,045
Members
453,772
Latest member
aastupin

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