Dynamic Share Array Issue

Firehazurd

New Member
Joined
Jun 9, 2015
Messages
4
I've got an issue with how to pull out the sum product of a value (X) set based on the share of presence of A and B respectively. The main problem is that I can't actually see A and B explicitly as shown below. Instead I've got a reference that tells me that A runs from 11/4 to 12/30 and B runs from 12/9 to 2/3.

I've been working with trying to get a SUMPRODUCT formula to work, but it seems to struggle with it. I'm currently trying an array formula, but also not getting the results I know I should.

With the below example, I should be able to sum the -5 values from 11/4, 11/11 and 11/18 at a 100% rate for A, and then the -10 on 12/9 as a 50% rate for A and B. That means that A should total -20, while B totals -5.

I need to be able to accomplish this without adding any columns to the bigger table, and with the understanding that the A and B column don't actually exist, they're for visualizing purposes in this post only.

Here is the excel file I'm using as an example. https://drive.google.com/open?id=1CcNNN20GTcoxcEta-TUSfb9QydP-ZB2C

Currently, my terrible attempt is this:

Code:
{=IF(AND(C3:C25>=$L$2,C3:C25<m2),($k$2 sumifs(k2:k3,l2:l3,"="">="&C3:C25,M2:M3,"<"&C3:C25))*E3:E25,0)}

[TABLE="class: grid, width: 196"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]K[/TD]
[TD="align: center"]L[/TD]
[TD="align: center"]M[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A[/TD]
[TD]100[/TD]
[TD]11/04/18[/TD]
[TD]12/30/18[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]B[/TD]
[TD]100[/TD]
[TD]12/09/18[/TD]
[TD]02/03/19[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="class: grid, width: 192"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]11/04/18[/TD]
[TD="align: center"]-5[/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]11/11/18[/TD]
[TD="align: center"]-5[/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]11/18/18[/TD]
[TD="align: center"]-5[/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]11/25/18[/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]12/02/18[/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]12/09/18[/TD]
[TD="align: center"]-10[/TD]
[TD="align: center"]100[/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]12/16/18[/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]12/23/18[/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: center"]12/30/18[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"]01/06/19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]01/13/19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]01/20/19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: center"]01/27/19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]100[/TD]
[/TR]
</tbody>[/TABLE]

</m2),($k$2>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
The following array formula (to be entered using Ctrl+Shift+Enter, not just Enter) returns the expected results for the posted dataset:

=SUMPRODUCT($E$3:$E$25*($C$3:$C$25>=$L2)*($C$3:$C$25<=$M2),IFERROR($K2/($K$2*($C$3:$C$25>=$L$2)*($C$3:$C$25<=$M$2)+$K$3*($C$3:$C$25>=$L$3)*($C$3:$C$25<=$M$3)),0))
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,080
Members
453,021
Latest member
Justyna P

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