+ Reply to Thread
Results 1 to 4 of 4

Perfom calculation based on date in range

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    54

    Perfom calculation based on date in range

    I have been looking at this for hours and I'm sure there is an answer but I can't think of it right now.
    Various Index/Match tests are not giving me the answer I seek.

    I have a range of dates (the sunday of each week) across some columns (K->AC).
    To the left I have a dozen rows of tasks.
    Each task has 4 columns with hours (C->F) and 4 with dates (G->J).

    I am trying to make a formula that will look at each date (G->J) for the row, if the date (G->J) is between the current column's date (K->AC) then enter the corresponding summed hours (C->F) in the cell.

    I've attached an example file.

    Maybe I'm trying to do too much?
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    17,307

    Re: Perfom calculation based on date in range

    Put this formula in cell K10:

    =SUMIFS($C10:$F10,$G10:$J10,">="&K$8,$G10:$J10,"<"&K$8+7)

    then copy across and down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-23-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Perfom calculation based on date in range

    Thank you @ Pete_UK! I was over thinking and over complicating it as always.

    I made one small change, I added an extra column with a date outside my expected range, and modified K$8+7 to L$9, just in case one of the dates ends up being changed to some oddball one that is not a Sunday (maybe due to a holiday or something).

    Final formula in cell K10 is:

    =SUMIFS($C10:$F10,$G10:$J10,">="&K$8,$G10:$J10,"<"&L$8)
    Last edited by witchcraftz; 05-21-2019 at 11:23 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    25,389

    Re: Perfom calculation based on date in range

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    Are you new to Power Query and don't know what to do with the code you've been given? Have a look here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

+ 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