+ Reply to Thread
Results 1 to 5 of 5

Creating Max If Formula with multiple conditions

  1. #1
    Registered User
    Join Date
    05-07-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    2

    Creating Max If Formula with multiple conditions

    First time actually posting an issue on here so thank you in advance for the help. What I have been wracking my brain on lately is the following:

    I have a worksheet that has the following data: Community name, Date, and Water Usage for that day.

    On a separate worksheet I have a row for each community to calculate their monthly accrual. What I am looking for is a formula that will return the Max usage between a specific date range (say 4/1/2012 and 5/1/2012) for a specific community. Thanks for any help I get and if there are any questions let me know.

    Thanks!

  2. #2
    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: Creating Max If Formula with multiple conditions

    Hi and welcome to the forum.

    So you need to count how match times exist a certain community between two days..

    B1=START DATE

    C1=END DATE.

    So try this.

    =SUMPRODUCT((A2:A5>=B1)*(A2:A5<=C1)*(B2:B5="A"))

    Column A= dates

    Column B= Names of communities.
    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.

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Creating Max If Formula with multiple conditions

    How about using array equations?

    Range "A1:C31" in sheet one has
    name Date Water Usage
    A 1-May 204
    B 1-May 453
    C 1-May 499
    A 2-May 528
    B 2-May 257
    C 2-May 319
    A 3-May 545
    B 3-May 165
    C 3-May 131
    A 4-May 610
    B 4-May 726
    C 4-May 249
    A 5-May 621
    B 5-May 308
    C 5-May 318
    A 6-May 174
    B 6-May 705
    C 6-May 202
    A 7-May 113
    B 7-May 121
    C 7-May 448
    A 8-May 489
    B 8-May 518
    C 8-May 362
    A 9-May 126
    B 9-May 296
    C 9-May 733
    A 10-May 248
    B 10-May 425
    C 10-May 509

    Then in Sheet 2:
    Range A1:D2

    Comm Start End Max
    A 1-May 3-May 545

    Where for max I used: {=MAX(IF(N(Sheet1!A2:A31=Sheet2!A2)*N(Sheet1!B2:B31<=Sheet2!C2)*N(Sheet1!B2:B31>=Sheet2!B2),Sheet1!C2:C31))}
    note: instead of typing in curly brackets, use <ctrl><Shift><enter>

    Above equation will be a lot more readable if you use named ranges.

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

    Re: Creating Max If Formula with multiple conditions

    Try this syntax

    =MAX(IF((Community=Z1)*(Date>=Z2)*(Date<=Z3),Usage))

    confirmed with CTRL+SHIFT+ENTER

    where Z1, Z2 and Z3 contain a specific community name, start date and end date respectively
    Audere est facere

  5. #5
    Registered User
    Join Date
    05-07-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Creating Max If Formula with multiple conditions

    That works perfectly. Thanks a ton!

+ 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