Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel combined COUNTIF and MONTH formula

Status
Not open for further replies.

Dawber

Technical User
Jun 29, 2001
86
GB
I have an Excel spreadsheet with a series of names in Column A and related dates in Column B. I need a formula that counts the occurrences of each name in any given calendar month.

I have been trying along the lines of:

=COUNTIF(A:B,(AND(A:A="Bill",MONTH(B:B)=1)=TRUE))

 
You can't use CountIf like that.

You can, however, use SumProduct:
[COLOR=blue white]=SumProduct( (A2:A5000="Bill") * (month(B2:B5000) = 1))[/color]

Notes:
- You can't use SumProduct with an entire column as you can with CountIf.
- Each section of the SumProduct function must contain the same number of rows.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Hi Dawber:

Adding to what John has said, if you do want to use whole columns A, and B, you may want to consider using the DCOUNTA function ...

ytek-tips-thread770-1412663.gif


I hope this helps.

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top