+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : AVERAGEIFS - a few conditions put together

  1. #1
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    AVERAGEIFS - a few conditions put together

    I checked the forum and there wasnt and example like this so pls help.

    what im tryng to do is
    get the average of the 6 rows that have something written in it but the conditions are:
    if its not a number, dont take it into counting
    and if possible dont take the smallest and biggest number like this:
    Please Login or Register  to view this content.
    Any idias?

    TNX
    Attached Files Attached Files
    Last edited by stojko89; 05-26-2009 at 12:15 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: AVERAGEIFS - a few conditions put together

    Because we have to check for a number in the range.. I am not sure you can use the AVERAGEIFS function...

    Instead try:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER.. you will see { } brackets appear around the formula
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: AVERAGEIFS - a few conditions put together

    So is it posible to make from this:
    Please Login or Register  to view this content.
    To something like if there are no numbers in the box from B2:G2 then just leave empty space or type 0 ?

    I tryed something like this
    Please Login or Register  to view this content.
    Doesnt seem to work...anyone? help please. couse if i dont have values in the rows yet it shows and error for trying to do 0/0 or something like that.

    Ty

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: AVERAGEIFS - a few conditions put together

    Try:

    Please Login or Register  to view this content.
    Last edited by NBVC; 05-25-2009 at 04:19 PM. Reason: removed initial apostrophe to avoid confusion if copy/pasted

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: AVERAGEIFS - a few conditions put together

    You could perhaps avoid Arrays and use:

    =IF(COUNT(B2:G2)<=2,"",(SUM(B2:G2)-MIN(B2:G2)-MAX(B2:G2))/(COUNT(B2:G2)-2))

    ie check you have more than 2 numbers (given you are removing smallest & biggest) ... if you do SUM all less Smallest & Largest and divide by count of numbers (less 2 obviously)


    In AVERAGEIFS terms:

    =AVERAGEIFS(B2:G2,B2:G2,"<"&MAX(B2:G2),B2:G2,">"&MIN(B2:G2))


    In fact I think these are all flawed if you have 1+ value @ Min / Max.
    Last edited by DonkeyOte; 05-25-2009 at 04:17 PM.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: AVERAGEIFS - a few conditions put together

    Another alternative perhaps...

    =IF(COUNT(B2:G2)<=2,"",SUMPRODUCT(LARGE(B2:G2,ROW(INDIRECT("2:"&COUNT(B2:G2)-1))))/(COUNT(B2:G2)-2))

    (I'll go away now...)

  7. #7
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: AVERAGEIFS - a few conditions put together

    Quote Originally Posted by NBVC View Post
    Try:

    Please Login or Register  to view this content.

    This worked just fine... I saw the other options under this one when i tryed that one out but i think im going to use this one.

    Thank you for ur help

+ 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