+ Reply to Thread
Results 1 to 5 of 5

Calculate number of occurences with last 3 and 6 months

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Calculate number of occurences with last 3 and 6 months

    Hi,

    I have a row containing:

    Date entered
    Name
    Date of Birth (DOB)
    Occurrences of Name + DOB this Month
    Occurrences of Name + DOB within last 3 Months
    Occurrences of Name + DOB within last 6 Months

    I can manage the occurrences this month but haven't a clue how to calculate the 3 and 6 months ones. I have attached a sheet and would appreciate some guidance and help.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by jpruffle; 07-14-2009 at 03:59 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Calculate number of occurences with last 3 and 6 months

    Try:

    =SUMPRODUCT((name=D2)*(dob=E2)*(MONTH(month)>=MONTH(C2)-3)*(month<>""))

    and

    =SUMPRODUCT((name=D2)*(dob=E2)*(MONTH(month)>=MONTH(C2)-6)*(month<>""))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Calculate number of occurences with last 3 and 6 months

    Thank you for the quick reply.

    I have added the calculations but they don't seem to stack up?

    I've highlighted where in this sheet.

    Could you possibly have a look, sure I am missing something glaringly obvious.

    Thank you once again.
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Calculate number of occurences with last 3 and 6 months

    Your date in E13 is not formatted the same as the rest, please retype the date and make sure it is the same format...

    Then, assuming for last 3 months you want to exclude "this Months"... then possibly formula in G2 copied down:

    =SUMPRODUCT((name=D2)*(dob=E2)*(MONTH(month)>=MONTH(C2)-3)*(month<>""))-F2

    and in H2, for 6 months less this months...

    =SUMPRODUCT((name=D2)*(dob=E2)*(MONTH(month)>=MONTH(C2)-6)*(month<>""))-F2

    I got 3, 5 and 7 for the last Josh Simpson entry??

  5. #5
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Calculate number of occurences with last 3 and 6 months

    Thanks very much for your patience. My formatting was way out and messed everything up. Works great now.

+ 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