+ Reply to Thread
Results 1 to 3 of 3

Adjust the countif formula

  1. #1
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    378

    Adjust the countif formula

    Hello,

    I have a formula to find the average like this: SUM(A1:A5)/COUNTIF(A1:A5,">"&0)

    The formula above is applied for range. Now I want to apply by individual cells how can I use the countif like above. For example, I want to find an average in column S2 and W2 if S2 is 0 then I just need to use W2 number. If I applied formula above, it would look like this SUM(S2,W2)/COUNTIF(?). Since Countif only allows to use range, how can modify this formula and get what I expected. Please help.

    Thanks,

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Adjust the countif formula

    I am not exactly sure I follow what you are trying to do.

    Can you mock up a sample data set, or desensitize the actual data set you are using, and give us a mocked up solution?
    Last edited by mikeTRON; 01-13-2014 at 01:59 PM.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Adjust the countif formula

    I would recommend a helper row. Using your example, in cells S1:W1 put a TRUE if you want to use the cell in your calculation, else put a FALSE. So, you would have TRUE in S1 and W1 and FALSE everywhere else. Then use this formula:
    =AVERAGEIFS(S2:W2,S2:W2,">0",S1:W1,TRUE)
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Auto Adjust Stacked Column Need to Adjust Legend
    By tbren in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-29-2013, 01:56 PM
  2. adjust logarithmic scale + adjust chart
    By voltaire101 in forum Excel General
    Replies: 5
    Last Post: 08-05-2010, 08:12 PM
  3. Replies: 1
    Last Post: 01-16-2009, 05:31 PM
  4. Auto adjust row in formula
    By excellicious in forum Excel General
    Replies: 2
    Last Post: 03-02-2008, 10:43 PM
  5. Need Macro to adjust formula
    By floridagunner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2007, 04:41 PM

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