+ Reply to Thread
Results 1 to 6 of 6

Averageifs with an or statement

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    redditch
    MS-Off Ver
    Excel 2003
    Posts
    12

    Unhappy Averageifs with an or statement

    Hi

    I hope you can help! Just keep going round in circles...

    I have an averageifs formula but one of the criteria requires it to look for 2 values in a column. I have used a format i found on line and tried many other formats too but i can't get it to bring back the right result. This is what i have used

    =AVERAGEIFS(OfferedNSC!$Q:$Q,OfferedNSC!$K:$K,$C22,OfferedNSC!$R:$R,L$12,OfferedNSC!$L:$L,{"m","t"})

    Thanks
    Kerry

  2. #2
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Averageifs with an or statement

    =average(if((OfferedNSC!$K:$K=$C22)*(OfferedNSC!$R:$R=L$12)*(OfferedNSC!$L:$L={"m","t"}),OfferedNSC!$Q:$Q)) array entered should work
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: Averageifs with an or statement

    Try this array formula**:

    =AVERAGE(IF(OfferedNSC!$K2:$K20=$C22,IF(OfferedNSC!$R2:$R20=L$12,IF(OfferedNSC!$L2:$L20={"m","t"},OfferedNSC!$Q2:$Q20))))

    ** 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.

    You should avoid using entire columns as range references in array formulas.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Averageifs with an or statement

    You won't be able to use AVERAGEIFS, try SUMIFS/COUNTIFS like this

    =SUM(SUMIFS(OfferedNSC!$Q:$Q,OfferedNSC!$K:$K,$C22,OfferedNSC!$R:$R,L$12,OfferedNSC!$L:$L,{"m","t"}))/SUM(COUNTIFS(OfferedNSC!$K:$K,$C22,OfferedNSC!$R:$R,L$12,OfferedNSC!$L:$L,{"m","t"}))

    or use an "array formula" like this

    =AVERAGE(IF((OfferedNSC!$K:$K=$C22)*(OfferedNSC!$R:$R=L$12)*(OfferedNSC!$L:$L={"m","t"}),OfferedNSC!$Q:$Q))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  5. #5
    Registered User
    Join Date
    02-08-2012
    Location
    redditch
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Averageifs with an or statement

    Thank you all!! Greatly appreciated. Looks like it is working now thank you

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

    Re: Averageifs with an or statement

    You're welcome. We appreciate the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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