Sumproduct based on multple conditions

Shamsuddeen

Active Member
Joined
Feb 16, 2002
Messages
292
Hi all!

I have a table with the following data:

Column A-Date Column B-Amount

01-Jan-2000 25000
12-Jan-2000 15000
18-Jan-2000 10000
20-Mar-2001 2500
25-Mar-2001 3000
01-Aug-2002 45000
02-Aug-2002 100
31-Aug-2003 650

and so on......

I would like to have the totat and count of amount per month as below:

Period Total Count
Jan-2000 xxxxx xx
Mar-2001 xxxxxx xx
Aug-2002 xxxxxx xx
Aug-2003 xxxxxx xx


Thanks for the help in advance.


Shamsuddeen
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Thanks for the reply.

My table contains more than 1000 rows and I need to preserve the original table as is and the total and count should appear at the bottom of the table with the sumproduct formula.



Any help please.


Shamsuddeen
 
Upvote 0
Shamsuddeen said:
Thanks for the reply.

My table contains more than 1000 rows and I need to preserve the original table as is and the total and count should appear at the bottom of the table with the sumproduct formula.



Any help please.


Shamsuddeen

I don't think that's a good reason, but lets have it as you wish...

=SUMPRODUCT(--(TEXT(DateRange,"m/yy")=TEXT(CritDate,"m/yy"),AmountRange)

which gives you the total wrt the month/year in CritDate.

=SUMPRODUCT(--(TEXT(DateRange,"m/yy")=TEXT(CritDate,"m/yy"),--ISNUMBER(AmountRange))

counts the amounts wrt CritDate.
 
Upvote 0
Book8
ABCDEFGH
101-Jan-200025000
212-Jan-200015000
318-Jan-200010000
420-Mar-20012500
525-Mar-20013000
601-Aug-200245000
702-Aug-2002100
831-Aug-2003650
9
10
11TotalCount
12Jan-00500003
13Mar-0155002
14Aug-02451002
15Aug-036501
16
17
18
19
20
Sheet3


Something like this?

the formula in b12 is:
=SUMPRODUCT((MONTH($A$1:$A$8)=MONTH($A12))*(YEAR($A$1:$A$8)=YEAR($A12)),$B$1:$B$8)

and c12 is:

=SUMPRODUCT((MONTH($A$1:$A$8)=MONTH($A12))*(YEAR($A$1:$A$8)=YEAR($A12)))

I really believe the pivot table would be much easier to manage, though.
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,981
Members
448,934
Latest member
audette89

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