Sumproduct and list of dates

G

Guest

Morning All,
I have a list of dates in a column I need to know how many are from January,
February, March etc.
The formula I am currently using is
=SUMPRODUCT(--(MONTH(Rng)=1)),--(ISNUMBER(Rng)))
this works fine if all the dates are from one year eg all 2004, however I
now have data containing dates from 2004 and 2005.
How can I adapt the formula to distinguish btn Jan 2004 and Jan 2005?
TIA
Ajay
 
L

Leo Heuser

Hi Ajay

One way:

=SUMPRODUCT(--(MONTH(Rng)=1)),--(YEAR(Rng)=2004)),--(ISNUMBER(Rng)))
 
B

Bob Phillips

=SUMPRODUCT(--(Year(Rng)=2005), --(MONTH(Rng)=1))

or

=SUMPRODUCT(--(TEXT(rng,"yyyymm")="200501"))
 
M

Mangesh

If you know the year, then use:
=SUMPRODUCT(--(MONTH(rng)=1),--(YEAR(rng)=2006),--(ISNUMBER(rng)))

- Mangesh
 
G

Guest

Thanks everyone they all work
Ajay

Mangesh said:
If you know the year, then use:
=SUMPRODUCT(--(MONTH(rng)=1),--(YEAR(rng)=2006),--(ISNUMBER(rng)))

- Mangesh
 

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

Excel Sumproduct 0
counting dates using SUMPRODUCT 4
Follow up Question to Countif 4
dates of month automation 3
Sumproduct, countif and format? 0
sumproduct tracking 6
sorting dates 5
Formula to assist with counting dates 2

Top