sumproduct by year??

M

MDI Anne

I have a multi-columned worksheet, and am trying to pick out certain data.

One column has file names & the other has dates this file was submitted.
The formulas I'm using are:
=SUMPRODUCT(--($C$2:$C$15403<>"ABCD*"),(--(YEAR($I$2:$I$15403)=2007))) where
"ABCD*" is the prefix for the file name. This seems to be ok, except I'm
gett ALL of the files that were filed in 2007, not just the ones with the
ABCD prefix.

Any help is appreciated...
Thanks!
 
J

Joel

I think you need LEFT and don't you want = not <>

=SUMPRODUCT(--(left($C$2:$C$15403,4)="ABCD"),(--(YEAR($I$2:$I$15403)=2007)))
 
M

MDI Anne

Perfect!! Thank you!!

Joel said:
I think you need LEFT and don't you want = not <>

=SUMPRODUCT(--(left($C$2:$C$15403,4)="ABCD"),(--(YEAR($I$2:$I$15403)=2007)))
 
T

T. Valko

You can't directly use wildcards in SUMPRODUCT.
This seems to be ok, except I'm gett ALL of the files
that were filed in 2007, not just the ones with the
ABCD prefix.

Your formula is counting all instances that *do not* start with the ABCD
prefix.

Try this:

=SUMPRODUCT(--(LEFT($C$2:$C$15403,4)<>"ABCD"),--(YEAR($I$2:$I$15403)=2007))
 
M

MDI Anne

Ok...now I want to do the same thing except the prefix changes to "WXYK"

Why can't I copy the formula & substitute?? it gives me the #VALUE! error...
 
J

Joel

The only thing in your equation that would give a #Value error is if
I2:I15403 isn't a date. You would of seen this with the original formula for
ABCD. There must be some bad data in the I column giving you the problem. I
can't answer why you didn't see the problem with your original formula.
 

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