Sumproduct with mixed data?

G

gooders

Hi, I have a column that is predominately filled with dates i.e. 1/12/2010;
16/4/2010 etc, and my formula below counted the number of rows based upon the
month and year of these dates, this worked well until now. Some fields within
the column now have text instead of a date and this has now messed up my
formula which returns a #value error. Any assistance you can give would be
greately appreciated.

Thanking you in advance.

=SUMPRODUCT(N(MONTH('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=3),N(YEAR('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=2010))
 
J

Joe User

gooders said:
Some fields within the column now have text instead
of a date and this has now messed up my formula which
returns a #value error.

Try:

=SUMPRODUCT(
(MONTH(N('C:\Users\[monitor.xls]Adjusting Output'!$A$3:$A$10001))=3)
*
(YEAR(N('C:\Users\[monitor.xls]Adjusting Output'!$A$3:$A$10001))=2010))

Alternatively:

=SUMPRODUCT(
--(MONTH(N('C:\Users\[monitor.xls]Adjusting Output'!$A$3:$A$10001))=3),
--(YEAR(N('C:\Users\[monitor.xls]Adjusting Output'!$A$3:$A$10001))=2010))

(Beware of line-wrap when you copy-and-paste into Excel.)

Note: MONTH(0) is 1 and YEAR(0) is 1900. That could give false positives
if you tested for that month and year. I doubt that will be a problem.


----- original message -----

gooders said:
Hi, I have a column that is predominately filled with dates i.e. 1/12/2010;
16/4/2010 etc, and my formula below counted the number of rows based upon the
month and year of these dates, this worked well until now. Some fields within
the column now have text instead of a date and this has now messed up my
formula which returns a #value error. Any assistance you can give would be
greately appreciated.

Thanking you in advance.

=SUMPRODUCT(N(MONTH('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=3),N(YEAR('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=2010))
 
T

T. Valko

One way...

=SUMPRODUCT(--(TEXT('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001,"mmmyyyy")="Mar2010"))
 
G

gooders

Thanks for your response but the formula isn't working for me. In the Text
formula it returns a value of 0 which is incorrect as there are definitely
Mar2010 dates.

In the other solution I get a #value error.

Thanks guys

T. Valko said:
One way...

=SUMPRODUCT(--(TEXT('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001,"mmmyyyy")="Mar2010"))

--
Biff
Microsoft Excel MVP


gooders said:
Hi, I have a column that is predominately filled with dates i.e.
1/12/2010;
16/4/2010 etc, and my formula below counted the number of rows based upon
the
month and year of these dates, this worked well until now. Some fields
within
the column now have text instead of a date and this has now messed up my
formula which returns a #value error. Any assistance you can give would
be
greately appreciated.

Thanking you in advance.

=SUMPRODUCT(N(MONTH('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=3),N(YEAR('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=2010))


.
 
T

T. Valko

In the Text formula it returns a value of 0

Hmmm...

Try this one:

=SUMPRODUCT(--('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001>=DATE(2010,3,1)),--('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001<=DATE(2010,3,31)))

--
Biff
Microsoft Excel MVP


gooders said:
Thanks for your response but the formula isn't working for me. In the
Text
formula it returns a value of 0 which is incorrect as there are definitely
Mar2010 dates.

In the other solution I get a #value error.

Thanks guys

T. Valko said:
One way...

=SUMPRODUCT(--(TEXT('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001,"mmmyyyy")="Mar2010"))

--
Biff
Microsoft Excel MVP


gooders said:
Hi, I have a column that is predominately filled with dates i.e.
1/12/2010;
16/4/2010 etc, and my formula below counted the number of rows based
upon
the
month and year of these dates, this worked well until now. Some fields
within
the column now have text instead of a date and this has now messed up
my
formula which returns a #value error. Any assistance you can give
would
be
greately appreciated.

Thanking you in advance.

=SUMPRODUCT(N(MONTH('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=3),N(YEAR('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=2010))


.
 
G

gooders

Oh dear, I must apologise T. Valko. Your first formula does work. I
stupidly didn't include the -- into the formula. I thought that they
signified spaces and didn't appreciate that they were actually part of the
formula. Anyway, many thanks for your time and solving my problem for me.

Lesley

T. Valko said:
In the Text formula it returns a value of 0

Hmmm...

Try this one:

=SUMPRODUCT(--('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001>=DATE(2010,3,1)),--('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001<=DATE(2010,3,31)))

--
Biff
Microsoft Excel MVP


gooders said:
Thanks for your response but the formula isn't working for me. In the
Text
formula it returns a value of 0 which is incorrect as there are definitely
Mar2010 dates.

In the other solution I get a #value error.

Thanks guys

T. Valko said:
One way...

=SUMPRODUCT(--(TEXT('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001,"mmmyyyy")="Mar2010"))

--
Biff
Microsoft Excel MVP


Hi, I have a column that is predominately filled with dates i.e.
1/12/2010;
16/4/2010 etc, and my formula below counted the number of rows based
upon
the
month and year of these dates, this worked well until now. Some fields
within
the column now have text instead of a date and this has now messed up
my
formula which returns a #value error. Any assistance you can give
would
be
greately appreciated.

Thanking you in advance.

=SUMPRODUCT(N(MONTH('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=3),N(YEAR('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=2010))



.


.
 
T

T. Valko

Ok, good deal. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


gooders said:
Oh dear, I must apologise T. Valko. Your first formula does work. I
stupidly didn't include the -- into the formula. I thought that they
signified spaces and didn't appreciate that they were actually part of the
formula. Anyway, many thanks for your time and solving my problem for me.

Lesley

T. Valko said:
In the Text formula it returns a value of 0

Hmmm...

Try this one:

=SUMPRODUCT(--('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001>=DATE(2010,3,1)),--('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001<=DATE(2010,3,31)))

--
Biff
Microsoft Excel MVP


gooders said:
Thanks for your response but the formula isn't working for me. In the
Text
formula it returns a value of 0 which is incorrect as there are
definitely
Mar2010 dates.

In the other solution I get a #value error.

Thanks guys

:

One way...

=SUMPRODUCT(--(TEXT('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001,"mmmyyyy")="Mar2010"))

--
Biff
Microsoft Excel MVP


Hi, I have a column that is predominately filled with dates i.e.
1/12/2010;
16/4/2010 etc, and my formula below counted the number of rows based
upon
the
month and year of these dates, this worked well until now. Some
fields
within
the column now have text instead of a date and this has now messed
up
my
formula which returns a #value error. Any assistance you can give
would
be
greately appreciated.

Thanking you in advance.

=SUMPRODUCT(N(MONTH('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=3),N(YEAR('C:\Users\[monitor.xls]Adjusting
Output'!$A$3:$A$10001)=2010))



.


.
 

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

Similar Threads


Top