Count number of items by month

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm sure my answer has already been posted, but I've tried searching and
nothing seems to fit.

I want to count the number of cells in a range where the value of column A
is "1", and the date in column B is within the month of August. I will then
in a separate cell need to average the numbers in column C, where A=1 and
B=sometime in August.

I've tried sumproduct and countif's for the first one but nothing seems to
work. And for the second one, getting the average to work only during those
conditions is stumping me.

Thanks in advance for all help!
 
Hi!

For the count:

=SUMPRODUCT(--(A1:A10=1),--(MONTH(B1:B10)=8))

For the average:

Entered as an array using the key combo of CTRL,SHIFT,ENTER:

=AVERAGE(IF((A1:A10=1)*(MONTH(B1:B10)=8),C1:C10))

Biff
 
what formulas did you use?
try
=sumproduct(--(A1:A1000=1),--(month(B1:b1000)=8))
and
=sumproduct(--(A1:A1000=1),--(month(B1:b1000)=8),C1:1000)/sumproduct(--(A1:A1000=1),--(month(B1:b1000)=8))

the other thing that often happens is that the date is not really a date but
text,
If these don't work, try changing the format of the data fields and see if
they relflect the change.

If they don't try inserting =datevalue(B1) [or some cell which has one of
the dates] and try changing the format in this cell.
if this works change the recomended formulas to
....month(datevalue(B1:B1000))...
for all of the month sections.
 

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

Back
Top