Array Formula

Mike Blackman

Well-known Member
Joined
Jun 8, 2007
Messages
2,494
Hi,

I am trying to write an array formula that will work out how many minutes of tickets are open within a particular month. I have a formula shown on the first table which calculates how many minutes a ticket is open for within a particular month, but this only works for an individual ticket, Basically I neet to populate the 2nd table with an array formula that will calculate the number of minutes within the month that numerous tickets are open, effectively a SUMPRODUCT but I can't get it to work.

The right hand side of Table one doesn't exist in my main file, I am trying to populate the 2nd table using only the first four columns within Table 1.
My God.xls
ABCDEFGH
101/02/2008Jan08Feb08Mar08
2312931
3W00000220/01/200817:33:2629/02/200802:36:545603716,035.8540,001.15-
4W00000127/01/200801:05:4620/02/200803:17:5220041.13158.87-
5W00000122/03/200809:06:1824/03/200808:33:57789--789.00
6W00000124/03/200817:56:0128/03/200813:23:421,966--1,966.00
7W00000107/06/200820:27:1809/06/200806:42:22214---
8W00000124/06/200817:14:3910/07/200807:19:432,882---
9W00000113/08/200806:29:3616/08/200808:14:532,344---
10W00000127/09/200815:49:5328/09/200809:26:051,026---
11W00000124/10/200820:33:0926/10/200810:04:3013---
12W00000120/11/200802:03:2826/11/200815:38:236645---
13W00000120/11/200808:18:3224/11/200811:26:381073---
14W00000115/12/200812:20:5918/01/200915:54:223,445---
15W00000118/01/200916:32:4719/01/200912:50:47317---
16W00000126/12/200714:24:0024/03/200808:33:5712781044,640.0041,760.0033,633.95
Summary
My God.xls
ABCD
20Jan08Feb08Mar08
21W000001?????????
22W000002?????????
Summary


I know this is as clear as mud guys but would really appreciate some help with this.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Did you ever try a Pivot table
 
Upvote 0
In B21 try:

=(SUM(IF($A$3:$A$16=$A21,IF($B$3:$B$16<=B$20,IF($C$3:$C$16>DATE(YEAR(B$20),MONTH(B$20)+1,1),DATE(YEAR(B$20),MONTH(B$20)+1,1),IF($C$3:$C$16>=DATE(YEAR(B$20),MONTH(B$20),1),$C$3:$C$16,DATE(YEAR(B$20),MONTH(B$20),1))))))-SUM(IF($A$3:$A$16=$A21,IF($B$3:$B$16<=B$20,IF($B$3:$B$16>DATE(YEAR(B$20),MONTH(B$20),0),$B$3:$B$16,DATE(YEAR(B$20),MONTH(B$20),1))))))*24*60

which must be confirmed with Ctrl+Shift+Enter. Copy down and across.
 
Upvote 0
Hi Andrew,

Nearly there, The results I'm getting are;
My God.xls
ABCD
20Jan08Feb08Mar08
21W0000014464069317.8666733633.95
22W000002040476.90
Summary


For some reason Row 4 is not picking up in the Jan 08 slot, can't pinpoint why that would be in all honesty.

I also notice you are using the dates to replace Column D, unfortunately Column D is not a direct representation of ((C3-B3)*60)*24 but a slightly different stat based upon Outage Time and not the full ticket time.

Excellent job of picking up what I'm trying to do though.

The Stat I'm calculating is mean time between failure (MTBF) but I doubt such knowledge is actually going to help any :)
 
Upvote 0
With your sample data and the formula I posted I got:

<TABLE style="WIDTH: 338pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=451 border=0 x:str><COLGROUP><COL style="WIDTH: 53pt; mso-width-source: userset; mso-width-alt: 2560" width=70><COL style="WIDTH: 95pt; mso-width-source: userset; mso-width-alt: 4644" span=3 width=127><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl24 id=td_post_1863135 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 53pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=70 height=17> </TD><TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 95pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=127 x:num="39478">31/01/2008</TD><TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 95pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=127 x:num="39507">29/02/2008</TD><TD class=xl25 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 95pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=127 x:num="39538">31/03/2008</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>W000001</TD><TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right x:num="51774.233333319426">51774.23333</TD><TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right x:num="69317.866666652262">69317.86667</TD><TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right x:num="41969.283333336934">41969.28333</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD class=xl26 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>W000002</TD><TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right x:num="16226.566666663857">16226.56667</TD><TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right x:num="40476.899999995949">40476.9</TD><TD class=xl24 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right x:num>0</TD></TR></TBODY></TABLE>
 
Upvote 0
Ahhh, Sorry Andrew, I meant to say and knew it would cause issue but still forgot to say;

My Header dates are the first of the month not the final day.

Also, as i mentioned, I need to be using Column D and not the minutes the ticket is open, I think that is causing issue. The right hand side of my initial table was calculating perferctly, the reults within each row were adding up to the value in Column D so I'd expect to see a result of;
My God.xls
ABCD
24Jan08Feb08Mar08
25W00000144681.128864112241918.871135887836388.9499999979
26W00000216,035.8540,001.15-
Summary
 
Last edited:
Upvote 0
Okay, think I got it....

Going with you result table cell locations per post #6, try this formula in B21 then copy across and down. For the Mar 08 values to show you will have to put in Apr 08 in cell E20.

Code:
=SUM((($A$3:$A$16=$A21)*((IF($C$3:$C$16 > (C$20-(1/86400)),C$20-(1/86400),
    $C$3:$C$16)-IF($B$3:$B$16 > B$20,$B$3:$B$16,B$20)))*($B$3:$B$16 < C$20)
    *($C$3:$C$16 > B$20))/($C$3:$C$16-$B$3:$B$16)*($D$3:$D$16))
 
<?XML:NAMESPACE PREFIX = C$20)*($C$3 /><C$20)*($C$3:$C$16>
</C$20)*($C$3:$C$16>
 
Upvote 0
I amended my formula:

=(SUM(IF($A$3:$A$16=$A21,IF($B$3:$B$16<DATE(YEAR(B$20),MONTH(B$20)+1,1),IF($C$3:$C$16>DATE(YEAR(B$20),MONTH(B$20)+1,1),DATE(YEAR(B$20),MONTH(B$20)+1,1),IF($C$3:$C$16>=DATE(YEAR(B$20),MONTH(B$20),1),$C$3:$C$16,DATE(YEAR(B$20),MONTH(B$20),1))))))-SUM(IF($A$3:$A$16=$A21,IF($B$3:$B$16<DATE(YEAR(B$20),MONTH(B$20)+1,1),IF($B$3:$B$16>DATE(YEAR(B$20),MONTH(B$20),0),$B$3:$B$16,DATE(YEAR(B$20),MONTH(B$20),1))))))*24*60
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

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