count

M

Mona

I have daily dates (mm/dd/yyyy) in colA and text in colB. In cell C2 I have
03/2008 (mm/yy). I need a formula : count colB when A:A=C2. Thanks! -Mona
 
J

Jacob Skaria

Try
=SUMPRODUCT((TEXT(A1:A100,"mmyy")=TEXT(C2,"mmyy"))*B1:B100)

If this post helps click Yes
 
T

T. Valko

Try this:

=SUMPRODUCT(--(MONTH(A1:A10)=MONTH(C2)),--(YEAR(A1:A10)=YEAR(C2)),--(B1:B10<>""))
 
M

Mike H

Hi,

Try this. "Sometext" is the String your looking for in column B

=SUMPRODUCT((TEXT(A1:A1000,"mmyy")=TEXT(C2,"mmyy"))*(B1:B1000="Sometext"))


Mike
 
M

Mona

I tried and I get a "#value". I am trying to count the text in colB or
simply count each cell. Thanks
 
J

Jacob Skaria

Try the below
=SUMPRODUCT(--(TEXT(A1:A100,"mmyy")=TEXT(C2,"mmyy")),--(B1:B100<>""))

=SUMPRODUCT(--(TEXT(A1:A100,"mmyy")=TEXT(C2,"mmyy")))

If this post helps click Yes
 
M

Mike H

I should have added if you want to count anything in column B use this

=SUMPRODUCT((TEXT(A1:A100,"mmyy")=TEXT(C2,"mmyy"))*(B1:B100<>""))

Mike
 
M

Mona

Thank you Jacob! This works!

Jacob Skaria said:
Try the below
=SUMPRODUCT(--(TEXT(A1:A100,"mmyy")=TEXT(C2,"mmyy")),--(B1:B100<>""))

=SUMPRODUCT(--(TEXT(A1:A100,"mmyy")=TEXT(C2,"mmyy")))

If this post helps click Yes
 

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

Top