+ Reply to Thread
Results 1 to 9 of 9

Mixing AVERAGEIF() with OR() & AND()

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Mixing AVERAGEIF() with OR() & AND()

    I'm having the issue where I need to mix an averageif, with multiple conditions, some OR and some AND.

    I've started with:

    =average(AVERAGEIFS(AI:AI,U:U,"Photo",D:D,"July 2013"),averageifs(AI:AI,U:U,"Photo",D:D,"Aug 2013")), but this doesn't average the full set together.

    The logic I need to accomplish is, average range AI:AI IF U:U=Photo AND D:D="Aug 2013" OR D:D="Jul 2013"

    Any ideas?

    Thanks in advanced!
    -G
    Last edited by gdel; 09-05-2013 at 09:13 AM.

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

    Re: Mixing AVERAGEIF() with OR() & AND()

    Does column D contain real Excel dates or are they TEXT strings?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Mixing AVERAGEIF() with OR() & AND()

    They are text strings.

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Mixing AVERAGEIF() with OR() & AND()

    try this..

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


    if possible.. use D1:D100.. something like this.. in each whole column..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Mixing AVERAGEIF() with OR() & AND()

    Hi,

    You can use an array formula (ensure that you know how to enter these in Excel), though it's best practice not to reference whole rows/columns in these cases (I chose 1000 as an end reference - obviously amend to suit your needs):

    =AVERAGE(IF((U2:U1000="Photo")*((D2:D1000="July 2013")+(D2:D1000="Aug 2013")),AI2:AI1000))

    Regards
    Click * below if this answer helped

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

  6. #6
    Registered User
    Join Date
    09-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Mixing AVERAGEIF() with OR() & AND()

    Hey Debraj,

    I get a #DIV/0! error with this response. But it looks like the response below worked! Thank you for your help!

  7. #7
    Registered User
    Join Date
    09-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Mixing AVERAGEIF() with OR() & AND()

    This worked, thanks for your help! Out of curiosity, why are whole columns an issue? Does it array the whole column causing a memory issue?

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

    Re: Mixing AVERAGEIF() with OR() & AND()

    Try this array formula**.

    Use cells to hold the criteria:

    A2 = Photo
    B2 = July 2013
    C2 = Aug 2013


    =AVERAGE(IF(U2:U100=A2,IF((D2:D100=B2)+(D2:D100=C2),AI2:AI100)))

    ** 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 with array formulas.

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Mixing AVERAGEIF() with OR() & AND()

    That's about it, yes.

+ 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. mixing up numbers
    By aquinlan in forum Excel General
    Replies: 0
    Last Post: 10-13-2011, 01:20 PM
  2. mixing numbers up
    By Duckie in forum Excel General
    Replies: 6
    Last Post: 08-02-2009, 08:04 AM
  3. Mixing two columns
    By etrader in forum Excel General
    Replies: 5
    Last Post: 07-16-2009, 03:03 PM
  4. [SOLVED] Mixing AND & OR functions
    By Barney in forum Excel General
    Replies: 2
    Last Post: 07-02-2006, 03:50 PM
  5. Mixing up the arguments
    By michaelr586 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-24-2005, 05:05 AM

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