Multiple criteria for sumproduct

O

ocuhcs

I am trying to keep a running sum of customer order amounts for a given year
to compare TY vs. LY using the following formula:

=SUMPRODUCT(--('Wholesale Orders'!G2:G2000<=DATE(2008,12,31)),--('Wholesale
Orders'!G2:G2000>=DATE(2008,1,1)),--('Wholesale
Orders'!C2:C2000=A2))--('Wholesale Orders'!F2:F2000)

With the G column as the date range, C column as the customer name, and F
column as the $amount.

i do not get an error, but the formula result is an erroneous value. Do the
arrays in sumproduct need to fall in a specific sequence?
 
D

Domenic

Try...

=SUMPRODUCT(--('Wholesale Orders'!C2:C2000=A2),--('Wholesale
Orders'!G2:G2000>=DATE(2008,1,1)),--('Wholesale
Orders'!G2:G2000<=DATE(2008,12,31)),'Wholesale Orders'!F2:F2000)

Hope this helps!
 
T

T. Valko

Do the arrays in sumproduct need to fall in a specific sequence?

No

You can eliminate the test for the date range and just test for the year
number:

=SUMPRODUCT(--(YEAR('Wholesale Orders'!G2:G2000)=2008),--('Wholesale
Orders'!C2:C2000=A2),'Wholesale Orders'!F2:F2000)
 
J

John

I say your post and wondering if you have advice for a formula I'm tryinig to
write:
C6=4/25/08
C44=Project1213

=sumproduct(--(sheet1!K$2:50001<=C$6),--(Sheet1!E$2:E$50001=C44),Sheet1!T$2:T:50001)

I want to sum datat in column T that has a specific ID in column E that has
a date less than 4/25/08. The reason I have I'm using a specific cell ref
for the date is because I want it to change to the current date. So tommorow
date will be 4/26/08. I keep getting a #Ref! error when I'm writing this,
any ideas?
 
T

T. Valko

=sumproduct(--(sheet1!K$2:50001<=C$6),--(Sheet1!E$2:E$50001=C44),Sheet1!T$2:T:50001)

As posted, the formula has some ranges not properly defined. It's missing
the column letter in the first array and there's an extra colon in the last
array. However, those won't cause a #REF! error, Excel just won't accept
that as a formula and will display the general "The formula you typed
contains an error" message.

=SUMPRODUCT(--(Sheet1!K$2:K$50001<=C$6),--(Sheet1!E$2:E$50001=C44),Sheet1!T$2:T$50001)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top