+ Reply to Thread
Results 1 to 10 of 10

Date Range Based Sumifs...

  1. #1
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Date Range Based Sumifs...

    Here's what I've been trying to do...

    Sheet 1 has dates in column A for all the working days in a month. The other columns B onwards until AL have data, and I need to use this data depending upon the required criteria to populate sheet 2.

    Sheet 2 has the working weekdays (start date and end date) in Column A2 & B2. In other words, if a Monday is on June 4(Column A) and Friday is June 8(Column B) , then I should be able sum (using Sumifs function) the data in sheet 2 for all items that are in sheet 1 in columns C3, D3 etc... within that date range (June 4-8), and similarly for the next week (June 11 cell A3 and June 15 cell B3, and so on for the remaining 2 weeks....

    Hope this makes sense of what I'm trying to get at...

    Please advise your thoughts...
    Experience is not what happens to you; it's what you do with what happens to you.

  2. #2
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Date Range Based Sumifs...

    Hi life,

    How's this? date range based sumifs.xls

    Notice that I entered an extra column to sum the data.

    Then I used the SUMIFS function.

    Is this something that you can work with?

    Let me know.

    - Dennis

  3. #3
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Re: Date Range Based Sumifs...

    Thanks for a prompt response, I really appreciate your help!

    The formula looks alright, but as I need to use this across 2-3 sheets,it may get more complex with few criterias in place. Do you think there is a simpler one that can be used?

    One other limitation is that my data is quite large, and I cannot introduce any additional columns

    =_xlfn.SUMIFS($B$2:$B$8,$A$2:$A$8,">="&A13,$A$2:$A$8,"<="&B13)

    Please advise your thoughts...

    Thanks a ton in advance!
    Last edited by lifeisaspreadsheet; 10-16-2012 at 02:11 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Date Range Based Sumifs...

    Hi life,

    Boy, this was a lot tougher that I bargained for...

    But I think I found a dirty way of solving this...

    Check this out and let me know what you think... date range based sumifs v2.xls

    This is the formula I'm using...
    =SUM(INDIRECT("B"&MATCH($A13,$A$1:$A$8)&":"&"AL"&MATCH($B13,$A$1:$A$8)))

    To summarize, I'm taking advantage of the fact that you are looking consecutive dates ranges.

    For example, if you want 1/1/2012 - 1/4/2012, we want to see =SUM(B2:AL5)

    So, I used MATCH to recreate "B2:AL5"... then used the INDIRECT function to make it cell references...

    Don't say I didn't warn you that it's an ugly formula... but it should work...

    Let me know if this can work for you.

    Later,
    Dennis

  5. #5
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Date Range Based Sumifs...

    Hi life,

    If this still doesn't fit your needs, please attach a sample spreadsheet so that I can see what you are really trying to do...

    Thanks,
    Dennis

  6. #6
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Re: Date Range Based Sumifs...

    Thanks Dennis,

    I'm not at my desk at this point so will take a look asap, and seek your advice.

    For now, just one query:

    Can I substitute the SUM in your formula with SUMIFS, as I'll have multiple criteria's to sum?

    As far as my data sheet is concerned, I'll definitely upload one. However, it is exactly as the one you uploaded in the first instance. The only 2 differences are:

    1) My data is in one sheet for the working days in a week. Some columns have text data, that forms the basis of the criteria
    2) The week date ranges for which the sum is to be extracted is in a seprate sheet

    Thanks for your immense help on this!

    If this works as per my needs. It will surely be a great tool to cut down mannual effort!

    You're a Rock Star

    Best regards.
    Last edited by lifeisaspreadsheet; 10-16-2012 at 08:51 PM.

  7. #7
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Date Range Based Sumifs...

    Hi life,

    SUMIFS will not be able to work because the INDIRECT function returns a 2-dimensional array, while your criterias will only be a 1-dimensional array...

    By the way, you really don't have anymore room after column AL for the totals? Because that will simplify your SUMIFS function...

    What kind of criterias do you have? Maybe we can manipulate the MATCH function instead...

    I'll check on you later...

    Dennis

  8. #8
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Re: Date Range Based Sumifs...

    Thank you Dennis!

    This along with some minor tweaks in my data set worked superbly!

    My apologies for not getting back a bit. earlier than this...

    You are a magician!

    Look forward to stay connected!

    I'll mark this as solved (courtesy) you:-)

    Thanks much!

  9. #9
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Date Range Based Sumifs...

    Hi life,

    Glad you were able to solve what you wanted and hopefully you learned some new stuff...

    Keep asking questions for there are amazing people on this site to help if I'm not around...

    Take care,
    Dennis

  10. #10
    Forum Contributor lifeisaspreadsheet's Avatar
    Join Date
    10-04-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    208

    Re: Date Range Based Sumifs...

    True!

    Learned -> Executed/Implemented -> Succeeded!

    Cheers!!!

+ 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