+ Reply to Thread
Results 1 to 7 of 7

COUNTIFS help

  1. #1
    Registered User
    Join Date
    05-25-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    4

    COUNTIFS help

    Hi,

    I'm not sure if this is possible, but I'm trying to create a formula that will count if the average of three cells is greater than x and the average of the next three cells is greater than y.

    I could create a row/column next to the data set to work out the averages, but ideally i'd have the flexibility to adjust the number of cells that are being averaged.

    To help clarify, this is one data set:
    2,6,2,7,7,3,1,2,2,13,11,1,1,2,2,19,1,0,0,3,2,3,1,2,1,8,2,0,0,7

    A formula I would want to create would count the number of instances three cells averaged above 5 when the previous three cells averaged above 4.

    Any help would be greatly appreciated.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: COUNTIFS help

    Maybe this should work for you

    =IF(AND(AVERAGE(A1:A3)>x,AVERAGE(B1:B3)>y),...
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    05-25-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIFS help

    Sorry, i didn't think to upload a spreadsheet. Here it is
    Attached Files Attached Files

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: COUNTIFS help

    What means these red numbers?

  5. #5
    Registered User
    Join Date
    05-25-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIFS help

    the colours are irrelevent - please ignore

  6. #6
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: COUNTIFS help

    Are you comparing...

    B1:D1 with C1:E1

    C1:E1 with D1:F1

    D1:F1 with E1:G1

    ...and so on? If so, try...

    =SUMPRODUCT(--(SUBTOTAL(1,OFFSET(B1:AE1,,ROW(INDIRECT("1:"&COLUMNS(B1:AE1)-3))-1,,3))>4),--(SUBTOTAL(1,OFFSET(B1:AE1,,ROW(INDIRECT("1:"&COLUMNS(B1:AE1)-3)),,3))>5))

    or

    =SUMPRODUCT(--(MMULT((SUBTOTAL(1,OFFSET(B1:AE1,,ROW(INDIRECT("1:"&COLUMNS(B1:AE1)-3))-{1,0},,3))>{4,5})+0,{1;1})=2))

    Note, however, MMULT will return #VALUE! if the output of cells exceeds 5,460 for PC or 4,095 for the Mac. If this is the case, download and install the free add-in, Morefunc.xll, and use MMULT.EXT instead. Unfortunately, though, the add-in is not compatible with the Macintosh computer.
    Last edited by Domenic; 05-25-2009 at 06:36 PM.

  7. #7
    Registered User
    Join Date
    05-25-2009
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIFS help

    that looks absolutely perfect domenic! i will play around with it when i get home from work tomorrow.

    many thanks

+ 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