+ Reply to Thread
Results 1 to 5 of 5

Count and sum values for previous week

  1. #1
    Registered User
    Join Date
    06-20-2005
    Posts
    15

    Count and sum values for previous week

    Spreadsheet is a record of missions performed over the past year. Column B is the date of missions, E is the length of the mission in hours (1.5, 2.7, 4.6 etc.)

    I need to count the number of missions performed during the previous week (the previous Mon - Sun...not the previous 7 days) So today is Thursday Feb 24, I need to count the number of missions performed between Monday the 14th and Sunday the 20th.

    I also need to sum the total mission hours (column E) during the previous week as well.

    Any help is much appreciated.

    Scott

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: Count and sum values for previous week

    Hi Scott,
    It would be beneficial for you to supply a sample workbook for somebody to work with.
    Showing how your original data is laid out and then showing what your desired results should be.

  3. #3
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Count and sum values for previous week

    EDIT: I also agree with Dave - it would be much more helpful to upload a worksheet.

    One way would be to use a helper colum say col c where you put your between dates, in ur eg 10/02/2011 and 20/02/2011

    This is a count of mission hourss
    =SUMPRODUCT(--($B$1:$B$8>=$C$1), --($B$1:$B$8<=$C$2), $E$1:$E$8)

    Please note that you can adjust the array to B1000 and E1000 if required

    Where is the count of actual missions?

    See the attachment.
    Attached Files Attached Files
    Last edited by Blake 7; 02-25-2011 at 05:00 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Count and sum values for previous week

    Hi, just an attempt

    to count the dates ($B$2:$B$1000 the range, in $C$1 = Thursday Feb 24, the date you have to refer )

    =SUMPRODUCT(($B$2:$B$1000>=$C$1-WEEKDAY($C$1)-5)*($B$2:$B$1000<=$C$1-WEEKDAY($C$1)+1))

    To sum the hours (same formula integrated by E2:E1000)

    =SUMPRODUCT(($B$2:$B$1000>=$C$1-WEEKDAY($C$1)-5)*($B$2:$B$1000<=$C$1-WEEKDAY($C$1)+1)*$E$2:$E$1000)
    Regards

  5. #5
    Registered User
    Join Date
    06-20-2005
    Posts
    15

    Re: Count and sum values for previous week

    Quote Originally Posted by CANAPONE View Post
    Hi, just an attempt

    to count the dates ($B$2:$B$1000 the range, in $C$1 = Thursday Feb 24, the date you have to refer )




    To sum the hours (same formula integrated by E2:E1000)



    Regards
    Perfect, thanks!

+ 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