+ Reply to Thread
Results 1 to 9 of 9

Having issues writing a 'MAXIFS' array function

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Having issues writing a 'MAXIFS' array function

    I’m pretty sure I’m almost there with this but I haven’t had much experience with array formulas so I think I’m missing something really obvious.

    I have a list of measurement points (time and date) and the wind speed at each of those points. For every day I want to be able to say what the maximum and minimum windspeeds were and then also what the max and min were within a specific time period (which I specify in two input cells). Essentially I am looking to create some kind of MAXIFS() and MINIFS() in excel.

    I thought I could do this with an array but the formula I’ve written doesn’t seem to work…

    =MAX(IF(AND($B$6:$B$56219=$B6,$C$6:$C$56219>=$C$2,$C$6:$C$56219<=$C$3),$D$6:$D$56219))

    I’ve attached a sample workbook with completely random data to try and illustrate what I'm trying to do

    Thanks in advance for any help!
    Wind Speed Test book.xlsx
    Last edited by qaliq; 04-23-2013 at 11:02 AM. Reason: Solved

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Having issues writing a 'MAXIFS' array function

    May be this...

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


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Having issues writing a 'MAXIFS' array function

    Maybe??

    =SUMPRODUCT(MAX((C6:C79>=C2)*(C6:C79<=C3)*(D6:D79)))

    Or ARRAY?

    =MAX(IF($B$6:$B$56219=$B6,IF($C$6:$C$56219>=$C$2,IF($C$6:$C$56219<=$C$3,$D$6:$D$56219))))
    Last edited by Fotis1991; 04-23-2013 at 05:40 AM.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Having issues writing a 'MAXIFS' array function

    you were pretty close-you just can't use AND like that in an array formula
    =MAX(IF($B$6:$B$56219=$B6,IF($C$6:$C$56219>=$C$2,IF($C$6:$C$56219<=$C$3,$D$6:$D$56219))))
    also ought to work
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Having issues writing a 'MAXIFS' array function

    Try:

    =MAX(IF($B$6:$B$56219=$B6,IF($C$6:$C$56219>=$C$2,IF($C$6:$C$56219<=$C$3,$D$6:$D$56219)))) array entered


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Having issues writing a 'MAXIFS' array function

    Ah ok, so I guess I wouldn't also be able to use NOT,OR etc. if an IF array either then? That's cool though, I can use nested IFs no problem. I like the SUMPRODUCT solution too, I know it's a really useful function I just hardly ever use it.

    Another question I have with regards to actually entering the array function. The way that I do it is select the range of cells first, enter my formula in the top one and and CTRL+SHIFT+ENTER to fill in the whole range. The problem with this though is that it doesn't change the $B6 reference (to be $B7,$B8,$B9 etc.). Am I making a mistake in the way that I'm entering my array formula?

    Thanks

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Having issues writing a 'MAXIFS' array function

    yes-select one cell and ctrl+shift+enter the formula then drag-fill that down

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Having issues writing a 'MAXIFS' array function

    Thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  9. #9
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Having issues writing a 'MAXIFS' array function

    Thanks for everyones help, I've managed to do this now!

+ 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