+ Reply to Thread
Results 1 to 6 of 6

sumproduct to count number of times between dates

  1. #1
    Registered User
    Join Date
    01-22-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    9

    sumproduct to count number of times between dates

    I am using sumproduct to count the number of times and entry appears between two dates.

    The problem is that against each entry I am trying to find is the number I need to multiply bay:
    e.g
    =sumproduct(('Sheet1'!B2:B200>=A1)*('Sheet1'!B2:B200<=A2)*('Sheet1'!G2:G200="Injury"))

    Cell A1 and A2 are two dates.

    how do I multiple the each occasion of "Injury" by the number next to it in column F ?

    This will give me the total number of injuries within my date range ?

    Thanks
    Last edited by NBVC; 04-08-2010 at 09:13 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: sumproduct to count number of times between dates

    Try:

    =sumproduct(('Sheet1'!B2:B200>=A1)*('Sheet1'!B2:B200<=A2)*('Sheet1'!G2:G200="Injury"), 'Sheet1'!F2:F200)
    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
    Registered User
    Join Date
    01-22-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: sumproduct to count number of times between dates

    excellent thank you very much

    How doI do this with countif then ??

    e.g
    =countif('Sheet1'!K:K,"Injury")

    but multiply against cell in column J

    Thanks
    Steeley7

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

    Re: sumproduct to count number of times between dates

    use Sumif...

    =sumif('Sheet1'!K:K,"Injury",'Sheet1'!J:J)

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

    Re: sumproduct to count number of times between dates

    In 2007,


    =SUMIFS('Sheet1'!F2:F200,'Sheet1'!B2:B200,">="&A1,'Sheet1'!B2:B200,"<="&A2,'Sheet1'!G2:G200,"Injury")

  6. #6
    Registered User
    Join Date
    01-22-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: sumproduct to count number of times between dates

    Thank you very much again for all three answers. I am using 2007 but work is only on 2003 so thanks for both versions.

    Steeley7

+ 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