Sumproduct for YTD with text filter

O

ocuhcs

I am trying to sum a customers sales for a year to date value so I can
compare it with the year to date sales for the previous years. The formula is:

=SUMPRODUCT(--('Wholesale Orders'!G2:G2008<=TODAY()),--('Wholesale
Orders'!G2:G2008>DATE(2007,12,31)),--('Wholesale
Orders'!C2:C2000)=A5,--('Wholesale Orders'!F2:F2008))

It works perfectly until it calculates array #3, cell #A5 of the current
worksheet is a text value (customer name).
 
T

Tyro

Your formula is incorrect. You need a right parenthesis after A5. Assuming
F2:F2008 contain numbers, you do not need "--".

=SUMPRODUCT(--('Wholesale Orders'!G2:G2008<=TODAY()),--('Wholesale
Orders'!G2:G2008>DATE(2007,12,31)),--('Wholesale
Orders'!C2:C2000=A5),'Wholesale Orders'!F2:F2008)


Tyro
 
B

bpeltzer

I think you want to put the comparison value inside the parenthesis, and also
check the number of elements you've got in that array:
=SUMPRODUCT(--('Wholesale Orders'!G2:G2008<=TODAY()),--('Wholesale
Orders'!G2:G2008>DATE(2007,12,31)),--('Wholesale
Orders'!C2:C2008=A5),--('Wholesale Orders'!F2:F2008))
 
O

ocuhcs

That's it - Thanks!

bpeltzer said:
I think you want to put the comparison value inside the parenthesis, and also
check the number of elements you've got in that array:
=SUMPRODUCT(--('Wholesale Orders'!G2:G2008<=TODAY()),--('Wholesale
Orders'!G2:G2008>DATE(2007,12,31)),--('Wholesale
Orders'!C2:C2008=A5),--('Wholesale Orders'!F2:F2008))
 
T

Tyro

You still do not need the "--" in: --('Wholesale Orders'!F2:F2008) nor do
you need parentheses. 'Wholesale Orders'!F2:F2008 will do
In the first 3 comparisons, the "--" coercing Excel to make TRUE a 1 and
FALSE a 0. With your numbers in F2:F2008, the "--" are
changing the signs of the numbers twice. In other words, 23 becomes -23 (one
minus) and the - 23 becomes 23 (two minuses). In other words,
the "--" is accomplishing nothing.


Tyro
 

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