View Single Post
  #2  
Old April 16th, 2010, 08:16 PM posted to microsoft.public.excel.worksheet.functions
Joe User[_2_]
external usenet poster
 
Posts: 757
Default Sumproduct with mixed data?

"gooders" wrote:
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" wrote:
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))