Hi. So sorry, but I think I conveyed the wrong idea due to the wrong
wording used.
My purpose is to actually count the number of contracts that were
completed in the month of January, February and so on, not really the
sum.
For instance, I'd want to know that the number of contracts that took
place in January was 2 (The format is in the ddmmyyyy format),
February: 0, June: 1, August: 2 and so on
Sorry for the confusion!
> One way to count the number of contracts done in January of 2006:
>
[quoted text clipped - 41 lines]
> > Regards
> > Maccann Yeo
Roger Govier - 01 Nov 2006 11:09 GMT
Hi
Dave had a slight typo in his formula. He meant to type
=SUMPRODUCT(--(TEXT(B1:B100,"yyyymm")="200601"))
It will give you a count of the number of contracts completed in the
month of January 2006
Don't take any notice of the fact that it is Sumproduct being used, it
will in this instance produce a count, not a Sum.
Each test will return True or False. The double unary minus -- coerces
True's to 1's and False's to 0's, which Sumproduct then sums to give you
the total number of matches.
Alternatively you could use
=SUMPRODUCT(--(MONTH(B1:B100)=1)) for January, 2 for February etc.
but be aware that if you had more than one year's worth of data, it
would add January 06 and January 07 results together.
Dave's method takes account of Year as well as month.

Signature
Regards
Roger Govier
> Hi. So sorry, but I think I conveyed the wrong idea due to the wrong
> wording used.
[quoted text clipped - 59 lines]
>> > Regards
>> > Maccann Yeo
Dave Peterson - 01 Nov 2006 13:22 GMT
Thanks for the correction, Roger (but excel would have corrected it, too <bg>.)
And just another warning...
=SUMPRODUCT(--(MONTH(B1:B100)=1))
will count empty cells as January, too.
I'd add a check:
=SUMPRODUCT(--(MONTH(B1:B100)=1),--ISNUMBER(B1:B100))
> Hi
> Dave had a slight typo in his formula. He meant to type
[quoted text clipped - 86 lines]
> >>
> >> Dave Peterson

Signature
Dave Peterson
Roger Govier - 01 Nov 2006 13:48 GMT
Absolutely right Dave, as always <vbg>

Signature
Regards
Roger Govier
> Thanks for the correction, Roger (but excel would have corrected it,
> too <bg>.)
[quoted text clipped - 110 lines]
>> >>
>> >> Dave Peterson
Dave Peterson - 01 Nov 2006 15:22 GMT
You have to read more of my posts and you'll be busier with corrections! <bg>
> Absolutely right Dave, as always <vbg>
>
[quoted text clipped - 121 lines]
> >
> > Dave Peterson

Signature
Dave Peterson
BigMac - 01 Nov 2006 17:10 GMT
Hey guys, I've managed to get it to work. Thank you so much!
Regards
Maccann
> You have to read more of my posts and you'll be busier with corrections! <bg>
>
[quoted text clipped - 123 lines]
> > >
> > > Dave Peterson