+ Reply to Thread
Results 1 to 6 of 6

Count and average formula needed to not count text field

  1. #1
    Forum Contributor
    Join Date
    07-06-2013
    Location
    USA
    MS-Off Ver
    MS Office 2019 Pro Plus
    Posts
    182

    Count and average formula needed to not count text field

    Currently I have the following formula that adds all the totals in a range of cells and then divides them by how many cells entered to give me an average.
    I want to keep this however I want the formula to not count or calculate into the avrage any cells in which an adjacent cell has a specific text entered EXP: “X”
    =SUM(H18:H517)/COUNT(H18:H517)
    H10 = Formula
    H18:H517 = amounts entered
    J18:J517 = area to enter text “X”

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Count and average formula needed to not count text field

    Does this work for you?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Count and average formula needed to not count text field

    Try something like:

    =AVERAGEIF(J18:J517,"<>X",H18:H517)

    Also, if needed:

    =SUMIF(J18:J517,"<>X",H18:H517)/COUNTIF(J18:J517,"<>X")

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count and average formula needed to not count text field

    Maybe this...

    =AVERAGEIF(J18:J517,"<>X",H18:H517)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    07-06-2013
    Location
    USA
    MS-Off Ver
    MS Office 2019 Pro Plus
    Posts
    182

    Re: Count and average formula needed to not count text field

    works great, thx

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count and average formula needed to not count text field

    You're welcome. Thanks for the feedback!

+ 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