+ Reply to Thread
Results 1 to 3 of 3

Formula to count and divide only numbers <0 but not #NA

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    62

    Formula to count and divide only numbers <0 but not #NA

    I need help with a formula that will sum up a column of percentages (A2:A29) and divide by a count of the numbers in the column that fit 2 criteria: Are >0 and <>#NA. (to get an average). This is the formula I have so far but it justs returns #N/A:
    =(SUM(A2:A29)/COUNTIFS(A2:A29,">0",A2:A29,"<>#NA")). I think the problem is with summing the column with NA's in it...so I also tried: =(SUMIF(A2:A29,"<>#NA")/COUNTIFS(A2:A29,">0",A2:A29,"<>#NA")). Am I close?
    Last edited by merlyn45; 02-04-2013 at 03:00 PM. Reason: solved

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Formula to count and divide only numbers <0 but not #NA

    =SUMIF(A2:A29, ">0")/COUNTIF(A2:A29, ">0")

    or

    =AVERAGEIF(A2:A29, ">0")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Formula to count and divide only numbers <0 but not #NA

    Works great! thanks. I used the Averageif. I don't know why I thought I needed to use the #NA in the formula. Maybe because the original formula =sum(A2:a29)/countif(A2:A29, ">0") (which I did not write) worked fine until I changed the cell formulas in the data column to produce #NA's instead of 0's. I didnt not want the zeros on the chart, so I made them produce NA's instead. Thanks for your 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