Hello Excel friends,
I'm trying to sum a multiple array lookup without much success. I've read through many threads on this forum and googled furiously, but just can't quite seem to make it work.
I have a table of lookup values, I'm showing 4 pairs here, which represent start & end dates. In reality the table of lookup values might have 20 or 50+ pairs (rows) of values.
A1:B4
[TABLE="class: grid, width: 174"]
<tbody>[TR]
[TD="width: 87, align: right"]17/07/2017[/TD]
[TD="width: 87, align: right"]31/07/2017[/TD]
[/TR]
[TR]
[TD="align: right"]20/07/2017[/TD]
[TD="align: right"]26/07/2017[/TD]
[/TR]
[TR]
[TD="align: right"]27/07/2017[/TD]
[TD="align: right"]31/07/2017[/TD]
[/TR]
[TR]
[TD="align: right"]24/07/2017[/TD]
[TD="align: right"]31/07/2017[/TD]
[/TR]
</tbody>[/TABLE]
These are used to perform searches on a date table (which I've named WorkdayArray, with WorkdayArrayDateCol as [Date], and WorkdayArrayColMon-Fri as [Monday] to [Friday]).
[TABLE="width: 522"]
<tbody>[TR]
[TD="class: xl63, width: 87, bgcolor: #4472C4"]Date[/TD]
[TD="width: 87, bgcolor: #4472C4"]Monday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Tuesday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Wednesday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Thursday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Friday[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]11/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]12/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]13/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]14/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]17/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]18/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]19/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]20/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]21/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]24/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]25/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]26/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]27/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]28/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]31/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
This lookup serves to sum up the number of each workday in the range of the task.
At the moment I'm using:
=INDEX(WorkdayArrayMonCol,MATCH(A1,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1,WorkdayArrayDateCol))
To perform the search which returns a 2d array. In this example the range specified (17/7/2017-31/07/2017) returns an array, which if I SUM it returns 11.
I then multiply the result of that first lookup with an availability entry, which is a 5-value array itself, representing whether they work a full day or not. In this example, the staff member works half days on Monday & Friday.
(Values in P3:P7)
[TABLE="class: grid, width: 260"]
<tbody>[TR]
[TD]Monday[/TD]
[TD="align: right"]0.5[/TD]
[/TR]
[TR]
[TD]Tuesdays[/TD]
[TD="align: right"]1.0[/TD]
[/TR]
[TR]
[TD]Wednesdays[/TD]
[TD="align: right"]1.0[/TD]
[/TR]
[TR]
[TD]Thursdays[/TD]
[TD="align: right"]1.0[/TD]
[/TR]
[TR]
[TD]Fridays[/TD]
[TD="align: right"]0.5[/TD]
[/TR]
[TR]
[TD]Total Availability[/TD]
[TD="align: right"]0.80[/TD]
[/TR]
</tbody>[/TABLE]
In this example, when I multiply the two:
=INDEX(WorkdayArrayMonCol,MATCH(A1,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1,WorkdayArrayDateCol))*TRANSPOSE(P3:P7)
= 8.5
What I need is the sum from multiple lookups all in one shot so I can get the total, in this case, 19, in one lookup.
[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A1,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=8.5[/TD]
[/TR]
[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A2,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B2,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=4[/TD]
[/TR]
[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A3,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B3,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=2[/TD]
[/TR]
[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B4,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=4.5[/TD]
[/TR]
[TR]
[TD]Total:[/TD]
[TD]=19[/TD]
[/TR]
</tbody>[/TABLE]
I thought =SUM(INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol))*TRANSPOSE($P$3:$P$7)) would be a winner but no such luck.
I've also tried:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]=IFERROR(MMULT(MMULT(TRANSPOSE(ROW(INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol)))^0),INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol))),$P$3:$P$7),0)
=SUMPRODUCT((H2:H38>=A1)*(H2:H38<=B1)*I2:M38*TRANSPOSE(P3:P7)) (only good for one entry)
Even breaking it down into vectors and adding them to see if that made a difference:
=SUM(INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayMonCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$3
+INDEX(WorkdayArrayTueCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayTueCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$4
+INDEX(WorkdayArrayWedCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayWedCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$5
+INDEX(WorkdayArrayThuCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayThuCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$6
+INDEX(WorkdayArrayFriCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$7)
& NETWORKDAYS.INTL but that doesn't seem to work with ranges at all.[/TD]
[/TR]
</tbody>[/TABLE]
The closest I can ever seem to manage is an array with the 4 resulting totals in it like so:
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]8.5[/TD]
[/TR]
[TR]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]4.5[/TD]
[/TR]
</tbody>[/TABLE]
..and that always seems to be the end of the line, I can't manage to SUM up to 19. As per the title I need to perform this summation in one cell.
Thank you very much for your help, I can't seem to quite get it there!
I'm trying to sum a multiple array lookup without much success. I've read through many threads on this forum and googled furiously, but just can't quite seem to make it work.
I have a table of lookup values, I'm showing 4 pairs here, which represent start & end dates. In reality the table of lookup values might have 20 or 50+ pairs (rows) of values.
A1:B4
[TABLE="class: grid, width: 174"]
<tbody>[TR]
[TD="width: 87, align: right"]17/07/2017[/TD]
[TD="width: 87, align: right"]31/07/2017[/TD]
[/TR]
[TR]
[TD="align: right"]20/07/2017[/TD]
[TD="align: right"]26/07/2017[/TD]
[/TR]
[TR]
[TD="align: right"]27/07/2017[/TD]
[TD="align: right"]31/07/2017[/TD]
[/TR]
[TR]
[TD="align: right"]24/07/2017[/TD]
[TD="align: right"]31/07/2017[/TD]
[/TR]
</tbody>[/TABLE]
These are used to perform searches on a date table (which I've named WorkdayArray, with WorkdayArrayDateCol as [Date], and WorkdayArrayColMon-Fri as [Monday] to [Friday]).
[TABLE="width: 522"]
<tbody>[TR]
[TD="class: xl63, width: 87, bgcolor: #4472C4"]Date[/TD]
[TD="width: 87, bgcolor: #4472C4"]Monday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Tuesday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Wednesday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Thursday[/TD]
[TD="width: 87, bgcolor: #4472C4"]Friday[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]11/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]12/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]13/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]14/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]17/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]18/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]19/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]20/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]21/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]24/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]25/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]26/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]27/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]28/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=D9E1F2]#D9E1F2[/URL] , align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]31/07/2017[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B4C6E7]#B4C6E7[/URL] , align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
This lookup serves to sum up the number of each workday in the range of the task.
At the moment I'm using:
=INDEX(WorkdayArrayMonCol,MATCH(A1,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1,WorkdayArrayDateCol))
To perform the search which returns a 2d array. In this example the range specified (17/7/2017-31/07/2017) returns an array, which if I SUM it returns 11.
I then multiply the result of that first lookup with an availability entry, which is a 5-value array itself, representing whether they work a full day or not. In this example, the staff member works half days on Monday & Friday.
(Values in P3:P7)
[TABLE="class: grid, width: 260"]
<tbody>[TR]
[TD]Monday[/TD]
[TD="align: right"]0.5[/TD]
[/TR]
[TR]
[TD]Tuesdays[/TD]
[TD="align: right"]1.0[/TD]
[/TR]
[TR]
[TD]Wednesdays[/TD]
[TD="align: right"]1.0[/TD]
[/TR]
[TR]
[TD]Thursdays[/TD]
[TD="align: right"]1.0[/TD]
[/TR]
[TR]
[TD]Fridays[/TD]
[TD="align: right"]0.5[/TD]
[/TR]
[TR]
[TD]Total Availability[/TD]
[TD="align: right"]0.80[/TD]
[/TR]
</tbody>[/TABLE]
In this example, when I multiply the two:
=INDEX(WorkdayArrayMonCol,MATCH(A1,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1,WorkdayArrayDateCol))*TRANSPOSE(P3:P7)
= 8.5
What I need is the sum from multiple lookups all in one shot so I can get the total, in this case, 19, in one lookup.
[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A1,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=8.5[/TD]
[/TR]
[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A2,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B2,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=4[/TD]
[/TR]
[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A3,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B3,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=2[/TD]
[/TR]
[TR]
[TD]=SUM(INDEX(WorkdayArrayMonCol,MATCH(A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B4,WorkdayArrayDateCol))*TRANSPOSE(P3:P7))[/TD]
[TD]=4.5[/TD]
[/TR]
[TR]
[TD]Total:[/TD]
[TD]=19[/TD]
[/TR]
</tbody>[/TABLE]
I thought =SUM(INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol))*TRANSPOSE($P$3:$P$7)) would be a winner but no such luck.
I've also tried:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]=IFERROR(MMULT(MMULT(TRANSPOSE(ROW(INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol)))^0),INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol))),$P$3:$P$7),0)
=SUMPRODUCT((H2:H38>=A1)*(H2:H38<=B1)*I2:M38*TRANSPOSE(P3:P7)) (only good for one entry)
Even breaking it down into vectors and adding them to see if that made a difference:
=SUM(INDEX(WorkdayArrayMonCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayMonCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$3
+INDEX(WorkdayArrayTueCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayTueCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$4
+INDEX(WorkdayArrayWedCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayWedCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$5
+INDEX(WorkdayArrayThuCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayThuCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$6
+INDEX(WorkdayArrayFriCol,MATCH(A1:A4,WorkdayArrayDateCol)):INDEX(WorkdayArrayFriCol,MATCH(B1:B4,WorkdayArrayDateCol))*$P$7)
& NETWORKDAYS.INTL but that doesn't seem to work with ranges at all.[/TD]
[/TR]
</tbody>[/TABLE]
The closest I can ever seem to manage is an array with the 4 resulting totals in it like so:
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]8.5[/TD]
[/TR]
[TR]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]4.5[/TD]
[/TR]
</tbody>[/TABLE]
..and that always seems to be the end of the line, I can't manage to SUM up to 19. As per the title I need to perform this summation in one cell.
Thank you very much for your help, I can't seem to quite get it there!