+ Reply to Thread
Results 1 to 9 of 9

Help with advanced dynamic ranges between start and end date

  1. #1
    Registered User
    Join Date
    01-21-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2007
    Posts
    7

    Help with advanced dynamic ranges between start and end date

    G'day,

    I hope I can articulate this one. Apologies, this is my first post.

    I have a set of data within the range B3:K13 which includes random numbers under 10 using =RAND()*10.
    I have created 4 named ranges (where A3 is blank):

    Dates: A3:A13 (Numbered 1 - 10)
    Dates1:A4:A13
    Timesteps: B3:K3 (Dated 1/01/2016 - 10/01/2016)
    Timesteps1: A3:K3

    So I have 4 criteria:

    Start Date:B25 (Dropdown List "Dates")
    End Date: B26 (Dropdown List "Dates")
    Start Timestep: B27 (Dropdown List "Timesteps")
    End Timestep: B28 (Dropdown List "Timesteps")

    There are two formulas I have used that can generate the answers I need.

    =SUM(OFFSET($A$3,MATCH($B$25,Dates,0),MATCH($B$27,Timesteps,0),MATCH($B$26,Dates1,0)-MATCH($B$25,Dates,0),MATCH($B$28,Timesteps1,0)-MATCH($B$27,Timesteps,0)))

    =SUM(INDEX($B$4:$K$13,MATCH($B$25,Dates,0),MATCH($B$27,Timesteps,0)):INDEX($B$4:$K$13,MATCH($B$26,Dates,0),MATCH($B$28,Timesteps,0)))

    Everything is good so far however I want add another criteria to this formula.

    I want to create a new formula that will still sum the dynamic ranges not only for the selected range (All week) but for weekends and weekdays as well within that selected range.

    I tried this formula but it didn't work.

    =SUM(IF($N$4:$N$13>=6,OFFSET($A$3,MATCH($B$25,Dates,0),MATCH($B$27,Timesteps,0),MATCH($B$26,Dates1,0)-MATCH($B$25,Dates,0),MATCH($B$28,Timesteps1,0)-MATCH($B$27,Timesteps,0)),0))

    I have created a work around in order to get there =SUMIFS(P4:P13,Dates,">="&$B$25,Dates,"<="&$B$26). But I need it in one formula!

    I know this is a tricky one but if anyone could help me out it would be much appreciated.

    I got the idea from Excelisfun's EMT 1071 - https://www.youtube.com/watch?v=lh4VjEoD5WY

    Here is a screenshot of my spreadsheet - https://postimg.org/image/c455h66in/

    Cheers!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Help with advanced dynamic ranges between start and end date

    Hi, welcome to the forum

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,745

    Re: Help with advanced dynamic ranges between start and end date

    Welcome to the forum!

    Unfortunately, your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site). Adding these links is not optional.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    01-21-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2007
    Posts
    7

    Re: Help with advanced dynamic ranges between start and end date

    Thanks for the great advice FDibbins.

  5. #5
    Registered User
    Join Date
    01-21-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2007
    Posts
    7

    Re: Help with advanced dynamic ranges between start and end date

    Hi AliGW,

    My plan was to respond to the other forums if I received a solution. Of course I do not want to waste people's time. I appreciate any help I can get with this problem.

    I read the link you provided and it makes sense. I posted on the MrExcel forum and have not gotten a response. That is why I have posted my problem here because I asking the help of more experts.

    Here is my post on MrExcel (Excuse the repeat posts, I made a few errors) - https://www.mrexcel.com/forum/excel-...-end-date.html

  6. #6
    Registered User
    Join Date
    01-21-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2007
    Posts
    7

    Re: Help with advanced dynamic ranges between start and end date

    I figured out the solution. Thanks for anyone who looked it anyway.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,745

    Re: Help with advanced dynamic ranges between start and end date

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

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Help with advanced dynamic ranges between start and end date

    So, what was your solution? Care to share?

  9. #9
    Registered User
    Join Date
    01-21-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2007
    Posts
    7

    Re: Help with advanced dynamic ranges between start and end date

    Sure thing FDibbins.

    I replaced the below formula:

    =SUM(IF($N$4:$N$13>=6,OFFSET($A$3,MATCH($B$25,Dates,0),MATCH($B$27,Timesteps,0),MATCH($B$26,Dates1,0)-MATCH($B$25,Dates,0),MATCH($B$28,Timesteps1,0)-MATCH($B$27,Timesteps,0)),0))

    With this one:

    =SUM(IF(OFFSET(A3,MATCH($B$25,Dates1,0)-1,13,MATCH($B$26,Dates1,0) MATCH($B$25,Dates,0),)>=6,INDEX($B$4:$K$13,MATCH($B$25,Dates,0),MATCH($B$27,Timesteps,0)):INDEX($B$4:$K$13,MATCH($B$26,Dates,0),MATCH($B$28,Timesteps,0))))

    I used the offset and match functions to make my lookup array dynamic and equal the same amount of answers as my dynamic array formula "". Which gave answers - {7.34,8.022,9.761,2.417,7.84,2.366,9.744;8.704,5.259,4.221,4.35,5.584,6.362,4.468;4.43,3.924,2.451,5.516,3.475,4.276,2.327;2.582,2.685,6.182,1.523,3.28,8.94,7.296;3.083,1.948,6.161,8.737,7.752,4.814,4.708;0.329,9.719,7.613,2.891,4.172,2.225,8.112;5.899,3.524,8.756,8.571,3.837,9.323,5.897} You can see that each row has seven different values.

    The problem I was having was that the original formula was that "$N$4:$N$13>=6" was generating "{TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;TRUE;FALSE;FALSE}". This is a total of ten answers.

    These formulas require the same amount of row height to generate an answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dynamic ranges with different start date
    By SnilleMikke in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2015, 09:49 AM
  2. Replies: 1
    Last Post: 04-23-2013, 01:14 PM
  3. Make date ranges for graph (choose start and finish date)
    By zeko90 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2013, 09:13 AM
  4. [SOLVED] Counting the number of times a date occurs in multiple start and end date ranges.
    By Grizz in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-05-2013, 04:41 PM
  5. [SOLVED] Dynamic named range based on a start date and end date
    By Gary Lockton in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-06-2012, 07:26 PM
  6. Replies: 0
    Last Post: 03-30-2012, 01:56 PM
  7. Changing start point in Dynamic Named Ranges for a Chart
    By carsto in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-13-2009, 10:12 AM

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