+ Reply to Thread
Results 1 to 13 of 13

MAX IF AND with criteria ??

Hybrid View

luke_p MAX IF AND with criteria ?? 07-01-2010, 09:07 AM
romperstomper Re: MAX IF AND with criteria... 07-01-2010, 09:10 AM
Bob Phillips Re: MAX IF AND with criteria... 07-01-2010, 09:14 AM
luke_p Re: MAX IF AND with criteria... 07-01-2010, 09:47 AM
daddylonglegs Re: MAX IF AND with criteria... 07-01-2010, 10:10 AM
duanzhuanming Re: MAX IF AND with criteria... 07-01-2010, 10:25 AM
duanzhuanming Re: MAX IF AND with criteria... 07-01-2010, 10:37 AM
luke_p Re: MAX IF AND with criteria... 07-01-2010, 10:39 AM
duanzhuanming Re: MAX IF AND with criteria... 07-01-2010, 10:45 AM
daddylonglegs Re: MAX IF AND with criteria... 07-01-2010, 11:13 AM
luke_p Re: MAX IF AND with criteria... 07-02-2010, 05:45 AM
daddylonglegs Re: MAX IF AND with criteria... 07-02-2010, 06:08 AM
luke_p Re: MAX IF AND with criteria... 07-02-2010, 06:27 AM
  1. #1
    Registered User
    Join Date
    11-20-2008
    Location
    England
    MS-Off Ver
    2007
    Posts
    65

    MAX IF AND with criteria ??

    Hi all,

    I'm having a few issues with the attached spreadsheet, if anyone can assist

    I'm trying to get the MAX and MIN movement from a dated range, by doing the following;
    for example; the movement between 2 dates i.e. weekly and 2 weekly movement

    I'm using the follwing formula- MAX(IF(AND(B2:AA2>B2,B2:AA2<=H2),B13:FZ13))

    so the MAX which is greater than 1 Jan 07 but less than 7 Jan 07 and same with the MIN.
    then the next one would be between 7 Jan and 14 Jan and so on.. and then for 2 weekly
    between 1 Jan & 14 Jan....

    Can anyone steer me in the right direction as to why it doesn't work or a more efficient
    way to work this out ?

    Thanks
    Attached Files Attached Files
    Last edited by luke_p; 07-02-2010 at 06:28 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: MAX IF AND with criteria ??

    Why B:AA in the conditions, but B:FZ in the data range?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: MAX IF AND with criteria ??

    Use

    =MAX(IF(($B$2:$FZ$2>B$2)*($B$2:$FZ$2<=H$2),B13:FZ13))

    =MIN(IF(($B$2:$FZ$2>B$2)*($B$2:$FZ$2<=H$2),B13:FZ13))

    remember t arry-enter them

  4. #4
    Registered User
    Join Date
    11-20-2008
    Location
    England
    MS-Off Ver
    2007
    Posts
    65

    Re: MAX IF AND with criteria ??

    Bob,

    entered the above and array entered (ctrl - shift - enter) but it doesn't give the max between B2 and H2
    instead it gives me the value at Z13 !!

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,738

    Re: MAX IF AND with criteria ??

    Bob's suggestion works if you have valid dates in row 2 but you don't - they are text values, can you change them to dates?
    Audere est facere

  6. #6
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: MAX IF AND with criteria ??

    slt,
    I do not know much English. but I understand your problems. You can combine functions :match, address
    ..very simple

  7. #7
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: MAX IF AND with criteria ??

    Example:
    E17 = Start date
    F17 = End date
    Formula: =MAX(TRANSPOSE(INDIRECT(ADDRESS(13,ROW(INDIRECT(MATCH(E17,$A$2:$FZ$2,0)&":"&MATCH(F17,$A$2:$FZ$2,0)))))))
    Press Ctr+ Shift+Enter
    I am very pleased with your opinion!

  8. #8
    Registered User
    Join Date
    11-20-2008
    Location
    England
    MS-Off Ver
    2007
    Posts
    65

    Re: MAX IF AND with criteria ??

    The dates are text i'm afraid.

    Will this not work then ? or is there an alternative

  9. #9
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: MAX IF AND with criteria ??

    Quote Originally Posted by luke_p View Post
    The dates are text i'm afraid.

    Will this not work then ? or is there an alternative
    File:attached file
    Attached Files Attached Files

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,738

    Re: MAX IF AND with criteria ??

    As you have consecutive dates without gaps you could just get the maximum of every 7 columns starting from B13. To do that put this formula in C18 and copy down

    =MAX(OFFSET(B$13,0,(ROWS(C$18:C18)-1)*7,1,7))

    obviously you can do the same for MIN......and if you want every 14 days just change the two 7s to 14s

  11. #11
    Registered User
    Join Date
    11-20-2008
    Location
    England
    MS-Off Ver
    2007
    Posts
    65

    Re: MAX IF AND with criteria ??

    You're a star......... and here's the but

    what if i wanted it go to across re columns ? How would the formula change please.

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,738

    Re: MAX IF AND with criteria ??

    Try this version

    =MAX(OFFSET($B13,0,(COLUMNS($C18:C18)-1)*7,1,7))

  13. #13
    Registered User
    Join Date
    11-20-2008
    Location
    England
    MS-Off Ver
    2007
    Posts
    65

    Re: MAX IF AND with criteria ??

    beautiful

    Many thanks

+ 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