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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

north19701

Active Member
Joined
Jun 17, 2003
Messages
491
it looks like a pivot table would be one option, and group your period my month and year.
 

Shamsuddeen

Active Member
Joined
Feb 16, 2002
Messages
292
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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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.
 

north19701

Active Member
Joined
Jun 17, 2003
Messages
491
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,101
Messages
5,768,101
Members
425,453
Latest member
bince

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
Top