+ Reply to Thread
Results 1 to 4 of 4

Counting data based on a date period eg. Month

  1. #1
    Registered User
    Join Date
    02-13-2005
    Posts
    5

    Counting data based on a date period eg. Month

    Hi

    I am wanting to know what formula to use if I want to count the different types of source referrals for clients in a particular month eg. how many clients for December were casefind and how many referrals. For example, the list appears like this:-

    Date Client Source
    28/12/2007 Client A Referral
    29/12/2007 Client B CaseFind
    1/1/2008 Client C CaseFind
    1/1/2008 Client D CaseFind
    2/2/2008 Client E Referral

    To count the number of CaseFinds I would expect an answer under the heading December of '1' for January '2'.

    I have been working on the following formula
    =sumproduct((A1:A119=datevalue(?????))*(C1:C119="Casefind"))
    but can not workout how to get the system to count entries for one month only eg. December. The formula works if I enter in one date only eg. 29/12/2007. Can someone please help me with this formula or maybe suggest a complete new approach?

    Many thanks

    jennyp

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =SUMPRODUCT(--(MONTH(A2:A6)=12)*(D2:D6="CaseFind"))
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    02-13-2005
    Posts
    5

    Counting data based on a date period eg. Month/Year

    Hi

    Thanks for your response. The formula you provided below works perfectly however if the database goes across two calender years what formula do I need for Excel to differentiate between December 07 and December 08.

    =sumproduct(--month(A1:A5)=12)*(C1:C5="CaseFind")

    Many thanks.

    jennp

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You can either add another test for the year, like this

    =sumproduct((month(A1:A5)=12)*(year(A1:A5)=2007)*( C1:C5="CaseFind"))

    or do both together like this

    =sumproduct((text(A1:A5,"mmmyy")="dec07")*( C1:C5="CaseFind"))

+ 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