+ Reply to Thread
Results 1 to 9 of 9

min/max over moving range

  1. #1
    Registered User
    Join Date
    09-23-2014
    Location
    Washington, DC
    MS-Off Ver
    2011
    Posts
    92

    min/max over moving range

    Hi Everyone,

    Currently, I have two cells that allow users to pick a start and end date (by way of a drop down list) to view different types of data. I'd like to write a formula that returns the maximum value over that range. The range can change, which is the tricky part. Any ideas?

  2. #2
    Forum Contributor Cerbera's Avatar
    Join Date
    07-06-2010
    Location
    Rotorua, New Zealand
    MS-Off Ver
    Excel 2007, 2013, 2016 & 365
    Posts
    137

    Re: min/max over moving range

    Hi,

    Can you provide a workbook with some sample data in so that we can see how it is laid out?

    If you can define the range, you can then simply use =MAX(A1:A10), etc. Obviously the range (in this case A1:A10) is what you need to determine.

    In order to advise on how to do that, it would help to see how the data is laid out. Often using a dynamic named range (e.g. =OFFSET($A$1,0,0,COUNTA($A:$A),1)) is a good way around this, but will need to see the data to confirm it.

  3. #3
    Registered User
    Join Date
    09-23-2014
    Location
    Washington, DC
    MS-Off Ver
    2011
    Posts
    92

    Re: min/max over moving range

    Forum sample.xlsx

    Thanks for the help! I've attached an example (hopefully)

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: min/max over moving range

    I didn't download your file.

    Try to adapt this to suit your needs.

    A1:A100 = dates
    B1:B100 = number values

    D1 = drop down start date
    E1 = drop down end date

    This array formula** for the max value within the date range:

    =MAX(IF(A1:A100>=D1,IF(A1:A100<=E1,B1:B100)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: min/max over moving range

    As mentioned in the previous post his is what you are looking for (I was just working on this when that post showed up), but you would need to change the latter part of the formula to show "C" or "D" if looking for West Virginia or US results.

    MIN & MAX.xlsx


  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: min/max over moving range

    Hi, Check it out the attachmet
    Attached Files Attached Files
    Click just below left if it helps, Boo?ath?

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: min/max over moving range

    Pl see attached file.
    Formula
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: min/max over moving range

    Does this look like what you are after?

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: min/max over moving range

    Some second thoughts on the file I posted above. My original solution took your example range to be Q1 2006 inclusive.

    This would produce a range of 2 years plus one quarter........an unlikely query. So, I'm posting an updated version of that file.

+ 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. [SOLVED] Copy range from multiple sheets, into a master sheet and moving over by variable col range
    By g1eagle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2012, 01:36 PM
  2. Copying moving range based on moving cell reff.
    By Varmark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2011, 04:47 AM
  3. Chart with moving range
    By CarlosAndres in forum Excel General
    Replies: 2
    Last Post: 06-09-2010, 11:01 AM
  4. Moving a Range
    By costadina in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2009, 02:47 PM
  5. [SOLVED] sum with moving range
    By snax500 in forum Excel General
    Replies: 3
    Last Post: 07-10-2006, 03:29 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