+ Reply to Thread
Results 1 to 5 of 5

COUNT ONLY CELLS THAT AREN'T BLANK

  1. #1
    paulinec
    Guest

    COUNT ONLY CELLS THAT AREN'T BLANK

    This is the present function I have to get an average of $D$4:$D$3710:
    =(SUMIF($A$4:$A$3710,A3742,$D$4:$D$3710))/(COUNTIF($A$4:$A$3710,A3742)
    The problem with this is that it is counting all cells in $A$4:$A$3710 that
    equal A3742.
    To get a correct average I need to only count cells that are not blank in
    $D$4:$D$3710 based on $A$4:$A$3710 equalling A3742.
    Can anyone help me with this?
    --
    PaulineC

  2. #2

    Re: COUNT ONLY CELLS THAT AREN'T BLANK

    paulinec wrote...
    >This is the present function I have to get an average of $D$4:$D$3710:
    >=(SUMIF($A$4:$A$3710,A3742,$D$4:$D$3710))/(COUNTIF($A$4:$A$3710,A3742)
    >The problem with this is that it is counting all cells in $A$4:$A$3710

    that
    >equal A3742.
    >To get a correct average I need to only count cells that are not blank

    in
    >$D$4:$D$3710 based on $A$4:$A$3710 equalling A3742.

    ....

    You may be better off using the array formula

    =AVERAGE(IF($A$4:$A$3710=A3742,$D$4:$D$3710))

    which will skip nonnumeric cells in D4:D3710. If you can't use array
    formulas, then you need to use a 2-criteria denominator.

    =SUMIF($A$4:$A$3710,A3742,$D$4:$D$3710)
    /SUMPRODUCT(--($A$4:$A$3710=A3742),--ISNUMBER($D$4:$D$3710))


  3. #3
    Dave R.
    Guest

    Re: COUNT ONLY CELLS THAT AREN'T BLANK

    change that /(countif part to:

    SUMPRODUCT(($A$4:$A$3710=A3742)*($D$4:$D$3710<>""))


    "paulinec" <[email protected]> wrote in message
    news:[email protected]...
    > This is the present function I have to get an average of $D$4:$D$3710:
    > =(SUMIF($A$4:$A$3710,A3742,$D$4:$D$3710))/(COUNTIF($A$4:$A$3710,A3742)
    > The problem with this is that it is counting all cells in $A$4:$A$3710

    that
    > equal A3742.
    > To get a correct average I need to only count cells that are not blank in
    > $D$4:$D$3710 based on $A$4:$A$3710 equalling A3742.
    > Can anyone help me with this?
    > --
    > PaulineC




  4. #4
    William
    Guest

    Re: COUNT ONLY CELLS THAT AREN'T BLANK

    Hi Pauline

    I'm not sure I completely understand your question, but to return an average
    of cells D4:D3710 that are not blank use this array formula which you should
    enter by pressing Ctrl|Shift|Enter at the same time rather than just "Enter"

    {=AVERAGE(IF(D4:D3710<>"",D4:D3710))}

    I dont see the relevance of cell A3742 - if you want an average of those
    cells that equal cell A3742, then cell A3742 would be the average - what am
    I missing?

    --
    XL2002
    Regards

    William

    [email protected]

    "paulinec" <[email protected]> wrote in message
    news:[email protected]...
    | This is the present function I have to get an average of $D$4:$D$3710:
    | =(SUMIF($A$4:$A$3710,A3742,$D$4:$D$3710))/(COUNTIF($A$4:$A$3710,A3742)
    | The problem with this is that it is counting all cells in $A$4:$A$3710
    that
    | equal A3742.
    | To get a correct average I need to only count cells that are not blank in
    | $D$4:$D$3710 based on $A$4:$A$3710 equalling A3742.
    | Can anyone help me with this?
    | --
    | PaulineC




  5. #5
    William
    Guest

    Re: COUNT ONLY CELLS THAT AREN'T BLANK

    Bad day - ignore the last part of my post :-(

    --
    XL2002
    Regards

    William

    [email protected]

    "William" <[email protected]> wrote in message
    news:[email protected]...
    | Hi Pauline
    |
    | I'm not sure I completely understand your question, but to return an
    average
    | of cells D4:D3710 that are not blank use this array formula which you
    should
    | enter by pressing Ctrl|Shift|Enter at the same time rather than just
    "Enter"
    |
    | {=AVERAGE(IF(D4:D3710<>"",D4:D3710))}
    |
    | I dont see the relevance of cell A3742 - if you want an average of those
    | cells that equal cell A3742, then cell A3742 would be the average - what
    am
    | I missing?
    |
    | --
    | XL2002
    | Regards
    |
    | William
    |
    | [email protected]
    |
    | "paulinec" <[email protected]> wrote in message
    | news:[email protected]...
    | | This is the present function I have to get an average of $D$4:$D$3710:
    | | =(SUMIF($A$4:$A$3710,A3742,$D$4:$D$3710))/(COUNTIF($A$4:$A$3710,A3742)
    | | The problem with this is that it is counting all cells in $A$4:$A$3710
    | that
    | | equal A3742.
    | | To get a correct average I need to only count cells that are not blank
    in
    | | $D$4:$D$3710 based on $A$4:$A$3710 equalling A3742.
    | | Can anyone help me with this?
    | | --
    | | PaulineC
    |
    |
    |



+ 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