Help with Advanced Sum Function (Sumif/Sumproduct Combo)

Cyclone364

New Member
Joined
Mar 20, 2015
Messages
8
Hi all,

Long time user, first time poster, so I know I'm coming to the right place! Anyway, I had a friend reach out to me for some help with an excel formula she is trying to write. She has a table of data with Deal Numbers in the first column, a Strategy ID in the second, an associated date in the third, and a value in the last column (screenshot below).

Essentially what she wants done is for the values to be summed only for strategy A and only for the deals that exist in both January and February. To clarify, she does not want the Jan and Feb values added together (which would be easy enough), she just wants the Jan values summed for deals that have associated entries in Feb.

I created the below formula which accomplishes this, but now she is wanting to know if there is a way to do it without having to directly reference the range of Feb data (i.e., use full columns instead of specific ranges ($D:$D, etc.). The Feb and Jan data would be mixed together so the formula would need to run the test to see if the deal was in both Jan and Feb somehow without referencing data from a Feb section as I have done. I've spent around 4 and half hours with this, scouring forums, playing with Arrays and every version of a Sumifs I can think of. The answer is 320 from the below data set. Any help would be greatly appreciated! Please let me know if I can provide any other information that would be helpful!

Thanks,
Adam
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Every time I try to paste the image in from Excel, it shows the image until I save the post, and then it only shows a long URL string after it saves. Do I have to link to an external URL to include my image?
 
Last edited:
Upvote 0
Excel%20Question_zpsjx4yyvs1.png


Nevermind, here's the pic!
 
Upvote 0
Sorry, are you saying to attach the file? I'm not entirely sure what you mean by Excel Readable. If that is what you're saying, what is the best way to do that? I don't see an option to direct attach a file, and I'm not sure where I could upload it to link to a URL. :)
 
Upvote 0
Upvote 0
Thanks Aladin! Below is the table. Please let me know if this is still not in the desired format.

[TABLE="width: 392"]
<colgroup><col span="2"><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Deal
[/TD]
[TD]Strategy[/TD]
[TD]Date[/TD]
[TD]Value[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100023[/TD]
[TD]B[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]201[/TD]
[TD][/TD]
[TD="align: right"]320[/TD]
[/TR]
[TR]
[TD="align: right"]100024[/TD]
[TD]B[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]302[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101102[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]105[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101103[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]106[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101104[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]107[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101105[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]108[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101106[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]109[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101107[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]110[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101108[/TD]
[TD]A[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]111[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100055[/TD]
[TD]C[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]102[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100066[/TD]
[TD]C[/TD]
[TD="align: right"]1/31/2015[/TD]
[TD="align: right"]202[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100023[/TD]
[TD]B[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]201[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100024[/TD]
[TD]B[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]302[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101102[/TD]
[TD]A[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]201[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101104[/TD]
[TD]A[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]205[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101105[/TD]
[TD]A[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]206[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]101316[/TD]
[TD]A[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]208[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100763[/TD]
[TD]C[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]102[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]100066[/TD]
[TD]C[/TD]
[TD="align: right"]2/28/2015[/TD]
[TD="align: right"]202[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Thanks Aladin! Below is the table. Please let me know if this is still not in the desired format.
[...]

It's exactly the format for a sample. Thanks.

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][/tr]
[tr][td]
1​
[/td][td]Deal[/td][td]Strategy[/td][td]Date[/td][td]Value[/td][td][/td][td][/td][/tr]

[tr][td]
2​
[/td][td]
100023
[/td][td]B[/td][td]
1/31/2015
[/td][td]
201
[/td][td][/td][td]
1/31/2015
[/td][/tr]

[tr][td]
3​
[/td][td]
100024
[/td][td]B[/td][td]
1/31/2015
[/td][td]
302
[/td][td][/td][td]
2/28/2015
[/td][/tr]

[tr][td]
4​
[/td][td]
101102
[/td][td]A[/td][td]
1/31/2015
[/td][td]
105
[/td][td][/td][td]A[/td][/tr]

[tr][td]
5​
[/td][td]
101103
[/td][td]A[/td][td]
1/31/2015
[/td][td]
106
[/td][td][/td][td]Total[/td][/tr]

[tr][td]
6​
[/td][td]
101104
[/td][td]A[/td][td]
1/31/2015
[/td][td]
107
[/td][td][/td][td]
320
[/td][/tr]

[tr][td]
7​
[/td][td]
101105
[/td][td]A[/td][td]
1/31/2015
[/td][td]
108
[/td][td][/td][td][/td][/tr]

[tr][td]
8​
[/td][td]
101106
[/td][td]A[/td][td]
1/31/2015
[/td][td]
109
[/td][td][/td][td][/td][/tr]

[tr][td]
9​
[/td][td]
101107
[/td][td]A[/td][td]
1/31/2015
[/td][td]
110
[/td][td][/td][td][/td][/tr]

[tr][td]
10​
[/td][td]
101108
[/td][td]A[/td][td]
1/31/2015
[/td][td]
111
[/td][td][/td][td][/td][/tr]

[tr][td]
11​
[/td][td]
100055
[/td][td]C[/td][td]
1/31/2015
[/td][td]
102
[/td][td][/td][td][/td][/tr]

[tr][td]
12​
[/td][td]
100066
[/td][td]C[/td][td]
1/31/2015
[/td][td]
202
[/td][td][/td][td][/td][/tr]

[tr][td]
13​
[/td][td]
100023
[/td][td]B[/td][td]
2/28/2015
[/td][td]
201
[/td][td][/td][td][/td][/tr]

[tr][td]
14​
[/td][td]
100024
[/td][td]B[/td][td]
2/28/2015
[/td][td]
302
[/td][td][/td][td][/td][/tr]

[tr][td]
15​
[/td][td]
101102
[/td][td]A[/td][td]
2/28/2015
[/td][td]
201
[/td][td][/td][td][/td][/tr]

[tr][td]
16​
[/td][td]
101104
[/td][td]A[/td][td]
2/28/2015
[/td][td]
205
[/td][td][/td][td][/td][/tr]

[tr][td]
17​
[/td][td]
101105
[/td][td]A[/td][td]
2/28/2015
[/td][td]
206
[/td][td][/td][td][/td][/tr]

[tr][td]
18​
[/td][td]
101316
[/td][td]A[/td][td]
2/28/2015
[/td][td]
208
[/td][td][/td][td][/td][/tr]

[tr][td]
19​
[/td][td]
100763
[/td][td]C[/td][td]
2/28/2015
[/td][td]
102
[/td][td][/td][td][/td][/tr]

[tr][td]
20​
[/td][td]
100066
[/td][td]C[/td][td]
2/28/2015
[/td][td]
202
[/td][td][/td][td][/td][/tr]
[/table]


F6, control+shift+enter, not just enter:
Rich (BB code):

=SUM(IF(ISNUMBER(MATCH(IF($C$2:$C$20=F2,IF($B$2:$B$20=F4,$A$2:$A$20)),
    IF($C$2:$C$20=F3,IF($B$2:$B$20=F4,$A$2:$A$20,"#"),"#"),0)),$D$2:$D$20))
 
Upvote 0
Thank you so much Aladin! :biggrin: That's exactly what I was looking for! Now I'm going to dig through the formula to make sure I understand how it's working. I tried updating the column references to exclude the Row numbers (i.e., $D:$D), and it stopped working, but I'm assuming that's just because it overloads the memory available for the array (not sure if that's the appropriate terminology). I'll just adjust the range to go through 1000 or something instead. Thanks again for the help and for the patience with my being a first time poster!

Adam
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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