+ Reply to Thread
Results 1 to 6 of 6

counting entries in a given month

  1. #1
    Registered User
    Join Date
    02-16-2007
    Posts
    13

    counting entries in a given month

    I have a database that has a list of dates (A) and Profit (B)

    So I wanna count all the entries made in a given month.

    What I'm trying now is:

    =COUNTIF($A$2:$A$600,(($A$2:$A$600<>"")*(MONTH($A$2:$A$600)=1)*(YEAR($A$2:$A$600)=2007)))

    where column A = date

    However, this is just returning "0".

    Am I one the right track, or am I not thinking about this correctly??

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    cwik, try using sumproduct, like this:

    =SUMPRODUCT(--($A$2:$A$600<>""),--(MONTH($A$2:$A$600)=1),--(YEAR($A$2:$A$600)=2007))

  3. #3
    Registered User
    Join Date
    02-16-2007
    Posts
    13
    humm, plugged that in, and it just gave me #value.

    Anyhow, if done right, wouldn't that just add up all the dates? I just want them counted, i.e. ten entries = 10.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    I entered dates in column A, and numbers in column B. That's the example you gave.

    When I enter

    =SUMPRODUCT(--($A$2:$A$600<>""),--(MONTH($A$2:$A$600)=1),--(YEAR($A$2:$A$600)=2007))

    in cell D2, it tells me the count of entries for January 2007 (Month=1, Year=2007).

    When I enter

    =SUMPRODUCT(--($A$2:$A$600<>""),--(MONTH($A$2:$A$600)=2),--(YEAR($A$2:$A$600)=2007))

    in cell D3, it tells me the count of entries for February 2007 (Month=2, Year=2007).

    Etc..

    I have attached an example.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-16-2007
    Posts
    13
    Thanks, I got it.

    I realized my database doesn't start till row 15, and while I changed the column I did not edit the range... so well there ya go.

    Thanks a lot. Very helpful.

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Great, glad to hear it worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1