+ Reply to Thread
Results 1 to 5 of 5

MAXIF formula

  1. #1
    Registered User
    Join Date
    06-01-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    1

    MAXIF formula

    Hi,

    I am looking to create a formula (ideally in Excel, but VBA could also work), that would given me the maximum value in column B for the dates between today and the following 45 calendar days.

    Column A Column B
    January 20, 2015 11.78
    January 21, 2015 11.85
    January 22, 2015 11.99
    January 23, 2015 11.68
    January 26, 2015 11.78
    January 27, 2015 11.82
    ...

    Not every day will have a set of values as weekends and holidays won't have records. In the example above I assume January 24 and January 25 are weekend days.

    Thank you.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: MAXIF formula

    Try this array formula Entered with CTRL + SHIFT + ENTER

    =MAX(IF((A1:A100 > =TODAY())*(A1:A100 < =TODAY()+45),B1:B100))


    ...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.
    Last edited by Jonmo1; 06-01-2015 at 01:49 PM.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: MAXIF formula

    You can use a array formula like this:

    =MAX(IF(A2:A100>=TODAY(),IF(A2:A100<=TODAY()+45,B2:B100)))

    confirm with CTRL+SHIFT+ENTER

    adjust ranges as required
    Audere est facere

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: MAXIF formula

    If I get it right use this.
    confirm with ctrl+shift+enter

    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: MAXIF formula

    Does this help? This is not an array formula.
    Please Login or Register  to view this content.
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

+ 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. MaxIf without using an array formula
    By tigeravatar in forum Tips and Tutorials
    Replies: 13
    Last Post: 11-08-2019, 08:52 PM
  2. [SOLVED] Minif or maxif formula help
    By MARKSTRO in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 11-08-2013, 11:40 AM
  3. Maxif - VBA or Formula
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2013, 03:36 AM
  4. I'm looking for a maxif formula, basically
    By TracyW in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-20-2012, 10:20 AM
  5. [SOLVED] Reference for MAXIF array formula
    By JAK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-22-2005, 03:06 AM

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