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.
 
Hi Colin,

The date headers we've been playing with are housed on half a dozen other sheets also and all reference a set of dates that the dashboard houses, shows and references.

Basically the first month is hard coded although I have a fairly snazzy userform to allow the to select this, although manually changing it is allowed, the following 11 months are populated using;

=DATE(YEAR(B11),MONTH(B11)+1,1)

So all the dates are controlled from the dashboard, The reason I didn't buy into the additional month was that all the reports including the Dashboard have Total Columns in the adjacent cell. Now I could have added and hidden an extra column but I'd probably be digging into some code that kicks in on the Dashboard and to be fair, I knew we could avoid the extra date, just I get lost in these crazy Array formula. Hence my rebuttle of the idea :)

Add that with the users ability to break the most protected of things i didn't want to place my trust in the hundreds of SM's that use this badboy.

Enough babble :)

Thanks again for your help.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi Barry,

I do have an slight problem with your formula that I don't get with Colin's and thats the fatal Leap Day on these two items (well one of), I remember seeing quite an in depth thread regarding this between Peter & Luke and assume its the Leap Day thats foiling your formula;
My God.xls
ABCDEFGH
1TicketNumberAlternateTicketNumberCircuitIdOutageCauseCreatedDate/TimeClosedDate/TimeTotalMinutesOutageTimeMinutes
22008012002668W00000001******20/01/200817:33:2629/02/200802:36:545670356037
3200801270020415469016W00000001CUST27/01/200801:05:4620/02/200803:17:52346920
Data


This also re-emphasizes why I needed to use Column D (H in the real Data) and not the calc between the two dates. Just so you don't think I was being picky :)

Thank you all for your highly appreciated help guys.
 
Upvote 0
Hello Mikey,

Sorry I'm not clear what the problem is. I can't tell from your example, can you explain?

There shouldn't be any issue with leap days or years with my suggested formula, or Colin's........
 
Upvote 0
Hi Barry,

I can't explain it, I replicated it with just the two items and it worked perfectly, placed your formula next to Colin's back in my model with the correct ranges and again, different, 95% of the calculations are perfect just the odd few don't seem to pick up correctly. Here's another;
My God.xls
DEFG
15W0S1934930/01/200805:33:2712/02/200810:04:5110215
Data


The results;
Barclays Capital Global SLA Jan09 090218 New Template.xls
ZAAABAC
32102158,845.272,217.00-
MTBF


Z holds your formula and AA is Colin's, both reading the same period.... It is however clear its not actually related to the Leap Day itself, at least not obviously.

Z = =SUM(IF(CircID=$A32,IF(DateCreated>H$11+32-DAY(H$11+31),0,IF(DateClosed<H$11,0,(IF(DateClosed>H$11+32-DAY(H$11+31),H$11+32-DAY(H$11+31),DateClosed)-IF(DateClosed< H$11,H$11,DateCreated))/(DateClosed-DateCreated)*OutTimeMins))))

AA = =SUM(((CircID=$A32)*((IF(DateClosed>(EOMONTH(H$11,0)+1-(1E-24)),EOMONTH(H$11,0)+1-(1E-24),DateClosed)-IF(DateCreated>H$11,DateCreated,H$11)))*(DateCreated<EOMONTH(H$11,0)+1)*(DateClosed>H$11))/(DateClosed-DateCreated)*(OutTimeMins))

CircID being Column A from original, DateCreated being B, DateClosed being C, OutTimeMins beind D.
 
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