+ Reply to Thread
Results 1 to 7 of 7

Counting even if doesn't meet criteria

  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    Counting even if doesn't meet criteria

    I am trying to use this function to figure out averages for tests. there can be up to 25 tests in the sheet which is where the "YES" comes in. If the test booklet was used for this class then YES will be placed in the cell in field B2:B26. Now thes issue I'm having is that the formula is doing the math for the fields C2:C26 if there is a number in them if there is even if it does not say YES in the B2:B26 field.

    Here is the formula/function I'm using:

    =(COUNTA(C2:C26))/COUNTIF($B$2:$B$26,"YES")

    Any ideas?
    Last edited by Finn; 06-23-2009 at 03:15 PM. Reason: Solved

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

    Re: Counting even if doesn't meet criteria

    Does the formula I supplied here not do it for you?

    http://www.excelforum.com/excel-work...v-0-error.html
    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
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting even if doesn't meet criteria

    It's a different issue than it was previously. It's a different field and formulas. it's not a #DIV/0 issue it's something with it not following the criteria I set. I most likely set it up wrong. Any help you could offer would be greatly appreciated.

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

    Re: Counting even if doesn't meet criteria

    Or maybe you want?

    =COUNTA(C2:C26)/SUMPRODUCT(--ISNUMBER(C2:C26),--(B2:B26="Yes"))

  5. #5
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting even if doesn't meet criteria

    I've attached what I'm looking at

    If i put numbers into that C2:C26 field and it says NO in B2:B26
    it still factors those numbers in the math for the average at the bottom.
    Attached Files Attached Files

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

    Re: Counting even if doesn't meet criteria

    How about?

    =SUMPRODUCT(--($C$2:$C$26>0),--($B$2:$B$26="Yes"))/COUNTIF($B$2:$B$26,"Yes")

  7. #7
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting even if doesn't meet criteria

    That will work perfectly!

    Thank you very much.

+ 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