+ Reply to Thread
Results 1 to 7 of 7

Average Calculation to exclude specific text in range

  1. #1
    Registered User
    Join Date
    03-20-2015
    Location
    England
    MS-Off Ver
    365
    Posts
    12

    Average Calculation to exclude specific text in range

    I am using this =if(count(K4:BM4)>0,average(K4:BM4),"0") to calculate an average

    However I would like the range to exclude cells if they contain "OOO"

    Is this possible?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Average Calculation to exclude specific text in range

    Try this:

    =LET(s,SUMPRODUCT(K4:BM4<>"*OOO*"),IF(s>0,SUMPRODUCT((K4:BM4<>"*OOO*")*(K4:BM4))/s,0))

    If that doesn't work, attach a sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-20-2015
    Location
    England
    MS-Off Ver
    365
    Posts
    12

    Re: Average Calculation to exclude specific text in range

    thank you

    doesnt work on google sheets - which ideally it needs to as my team need to access the sheet https://docs.google.com/spreadsheets...3tU/edit#gid=0

    when i export to excel - the formula works but doesnt calculate correctly

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Average Calculation to exclude specific text in range

    You posted in the wrong place for GoogleSheets and you made no mention of it in the opening post - I am moving the thread.

    Your workbook is view only - please allow editing access.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Average Calculation to exclude specific text in range

    You hadn't even adjusted the ranges in the formula, but it seems you could use this:

    =IF(COUNTIF(C2:BE2,"<>OOO")>0,AVERAGEIF(C2:BE2,"<>OOO",C2:BE2),0)

  6. #6
    Registered User
    Join Date
    03-20-2015
    Location
    England
    MS-Off Ver
    365
    Posts
    12

    Re: Average Calculation to exclude specific text in range

    Thank you =IF(COUNTIF(C2:BE2,"<>OOO")>0,AVERAGEIF(C2:BE2,"<>OOO",C2:BE2),0) worked

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Average Calculation to exclude specific text in range

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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. Help - only average range if range of text contains specific phrase
    By Matto225 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-20-2017, 12:55 PM
  2. Named Range to exclude cells if it contains specific text
    By Viktor86HUN in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-06-2015, 08:05 AM
  3. How to exclude the text value in Average Function??
    By nigel_12 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-02-2013, 12:00 PM
  4. Exclude a range of cells from a list, and find Average
    By nberzai in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 12-17-2010, 04:25 PM
  5. Exclude outliers in average calculation excel
    By mkvassh in forum Excel General
    Replies: 6
    Last Post: 10-15-2009, 08:36 AM
  6. AVERAGE calculation to exclude blank cells
    By andrewc in forum Excel General
    Replies: 8
    Last Post: 09-04-2009, 03:30 AM
  7. [SOLVED] Exclude cell from average calculation
    By Dave Ramage in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2005, 11:51 AM

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