Counting cells

  • Thread starter Thread starter Raymond Wood
  • Start date Start date
R

Raymond Wood

I have a number of dates in the range $A$2:$AE$2.

These all begin from a specified date, which is entered in
cell A1.

So if cell A1 has 1-March-2003 input, the range $A$2:$AE$2
will show:

1-March-2003, 2-March-2003, 3-March-2003, 6-March-2003, 7-
March-2003, 8-March-2003, etc.

Note that some days are missed out as they represent
weekend days, and I do not need data from these.

The range $A$2:$AE$2 has 31 cells in it, and some of these
will represent days during April.

What I want to do is count the number of cells within this
range that are during March. How do I do this??
 
Raymond Wood said:
I have a number of dates in the range $A$2:$AE$2.

These all begin from a specified date, which is entered in
cell A1.

So if cell A1 has 1-March-2003 input, the range $A$2:$AE$2
will show:

1-March-2003, 2-March-2003, 3-March-2003, 6-March-2003, 7-
March-2003, 8-March-2003, etc.

Note that some days are missed out as they represent
weekend days, and I do not need data from these.

The range $A$2:$AE$2 has 31 cells in it, and some of these
will represent days during April.

What I want to do is count the number of cells within this
range that are during March. How do I do this??

One way:
=SUMPRODUCT(--(MONTH($A$2:$AE$2)=3))
 
Thanks, THat works!!

What does the -- at the beginning of the SUMPRODUCT
formula do??
 
SUMPRODUCT expects numeric parameters. (MONTH($A$2:$AE$2)=3) is boolean
(i.e. TRUE or FALSE). The two minus signs simply convert TRUE to 1 and FALSE
to 0. You could do the same thing with
=SUMPRODUCT((MONTH($A$2:$AE$2)=3)*1)
 
Back
Top