+ Reply to Thread
Results 1 to 7 of 7

Min value between 2 dates

  1. #1
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Min value between 2 dates

    I have tab 1 that lists every day on it. Next to every day is a dollar amount. Tab 2 lists the start date of each week. For each week on tab 2 I want to see what the minimum dollar value is from the values on tab 1.

    Tab 1
    1/1/2014 $20
    1/2/2014 $10
    1/3/2014 $10
    1/4/2014 $15
    1/5/2014 $15
    1/6/2014 $20
    1/7/2014 $20
    1/8/2014 $15
    1/9/2014 $15
    ...


    Tab 2
    1/1/2014 (Min value of dates 1/1/2014 through 1/7/2014) $10
    1/8/2014 (Min value of dates 1/8/2014 through 1/14/2014) $15

    I can sum the values between those dates with sumifs(), I can count them with countifs(). But I don't know how to find the minimum value between them.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Min value between 2 dates

    Try this in C1 on sheet 2

    =MIN(IF(Sheet1!A1:A9>=A1,IF(Sheet1!A1:A9<=B1,Sheet1!B1:B9)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.


    on Sheet 2

    where A1=1/1/2014
    B1=1/8/2014
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Min value between 2 dates

    It works. Thank you. It takes some serious processing. I've got 3700 days of data in tab 1 and over 500 weeks in tab 2.

    I was trying to use index or vlookup to find the first day in the week and then look up the next 6 days as well. That didn't seem to work. Is there something I could change on the first tab with the days to make this process easier?
    Last edited by nigelbloomy; 06-18-2014 at 01:38 PM.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Min value between 2 dates

    Thank you for the feedback!. Of course, if you have to work with a high volume of data you would need to look for a Vb solution.

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Min value between 2 dates

    Try this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of just Enter.
    On sheet2, in B2
    Please Login or Register  to view this content.
    and then copy down.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  6. #6
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Min value between 2 dates

    I ended up using the following formula:
    =IF(A2="","",MIN(INDIRECT("'Sheet 1'!B" & MATCH(A2,'Sheet 1'!A:A,0) & ":B" & (MATCH(A2,'Sheet 1'!A:A,0)+6))))
    The match part finds the row on tab 1 that matches the begining of the week. If I add 6 to that result then I have the range where I want to find the minimum value. This seems to run pretty fast even with 3700 rows of days.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Min value between 2 dates

    Another way......
    Try this regular formula.

    Please Login or Register  to view this content.
    The problem with this formula and the one which you posted in your last reply is that if you skip a date, it will produce the wrong result. But the choice is yours.
    Attached Files Attached Files

+ 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. Check dates in range either same dates or different dates by formula
    By breadwinner in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 07:42 AM
  2. Replies: 6
    Last Post: 03-11-2013, 06:11 PM
  3. [SOLVED] Array of dates when tested shows no dates ......but there are dates
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2012, 12:45 PM
  4. [SOLVED] Highlight Group of Dates if Dates Match List of other Dates
    By martinpgibson in forum Excel General
    Replies: 5
    Last Post: 10-24-2012, 08:14 PM
  5. [SOLVED] Auto filling dates based on previously entered dates and averaging numbers if dates equal
    By grambograham in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 03:21 PM

Tags for this Thread

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