+ Reply to Thread
Results 1 to 11 of 11

I want to average including all cell that may have text with numbers.

  1. #1
    Registered User
    Join Date
    04-04-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    office 365, Excel
    Posts
    10

    I want to average including all cell that may have text with numbers.

    65R 0A 67 73 83 D 85RD 82RD 84RD 86R 74 D 76R 57 48 47 43 average here


    Hi, I have data in excel rows which contain numbers and text attached with numbers as you can see above. I want the average of all numbers excluding text in the adjacent cell. average function skips all cells that have text in them. Anybody please suggest me a way out. I will be thankful.

    Afzal Ahmed

    +923212815781

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: I want to average including all cell that may have text with numbers.

    based on samples, perhaps:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-04-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    office 365, Excel
    Posts
    10

    Re: I want to average including all cell that may have text with numbers.

    Thnaks XLent for your valuable suggestion.. The formula you wrote above is working only with the mentioned letters but in my case any alphabet may appear.
    I need little more help can you devise a general formula that detaches any alphabet and averages numbers only. I tried the following one but having problems with it. I will be thankful.

    =AVERAGE(INDEX(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B366:Y366,"A",""),"B",""),"C",""),"D",""),"E",""),"F",""),"G",""),"H",""),"I",""),"J",""),"K",""),"L",""),"M",""),"N",""),"O",""),"P",""),"Q",""),"R",""),"S",""),"T",""),"U",""),"V",""),"W",""),X",""),"Y",""),"Z","")+0,0))

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: I want to average including all cell that may have text with numbers.

    you missed the "RD" in the combination and the quotes around the X, but that being noted I don't believe it will work anyway.
    Any chance of using a helper row? Then it is easily accomplished though if you have multiple rows of these that would make it difficult.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: I want to average including all cell that may have text with numbers.

    It would help to see a more rounded example however based on samples you might try below alternative, to handle multitude of non-numeric suffixes

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    edit: modified number format for negatives {just in case}
    Last edited by XLent; 04-04-2019 at 12:44 PM.

  6. #6
    Registered User
    Join Date
    04-04-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    office 365, Excel
    Posts
    10

    Re: I want to average including all cell that may have text with numbers.

    Dear mates thanks for your time and effort, I am grateful. Formula suggested by XLent is really excellent it detaches all the alphabets and averages the numbers. a little problem is that it does not exclude zeroes in the division. For example i have 24 values in a row and if 20 of them are positive (no -ve) it divides the sum by 24 rather than 20 which affects the average. Is it possible to adjust this, I tried many things but no success e.g inserting "<>0" at different places in the formula. Any help will made my uphill task easier.

    Best Regards
    Afzal Ahmed
    Last edited by afzalahmed81; 04-05-2019 at 08:28 AM. Reason: typo

  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,910

    Re: I want to average including all cell that may have text with numbers.

    Have a look at the end of this thread to find a really nice solution:

    https://www.excelforum.com/excel-for...ml#post4821289

    Try using AVERAGE instead of SUMPRODUCT.
    Last edited by AliGW; 04-05-2019 at 08:56 AM.
    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.

  8. #8
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: I want to average including all cell that may have text with numbers.

    Afzal; negative numbers should be included in the average already - if you wish to exclude modify the -0 to \0 in below format

    To exclude 0s from the Average modify the Divisor

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    @AliGW; the linked thread is not suitable here given the strings are of varied length - some numbers, some strings etc, some w/space, some w/out space etc...

    I see Bosco might be looking at it, so I suspect we will get a nicer solution shortly....

  9. #9
    Registered User
    Join Date
    04-04-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    office 365, Excel
    Posts
    10

    Re: I want to average including all cell that may have text with numbers.

    Thanks Brother XLent, You just gave me great favor, formula does exactly what i wanted. I am impressed by your coding skills, may you get more.
    Can you recommend me a book, website or a pdf etc to learn some excel coding. I am already familiar with python. finally thanks again.

    Best Regards

  10. #10
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: I want to average including all cell that may have text with numbers.

    1] A1:Q1 =65R 0A 67 73 83 D 85RD 82RD 84RD 86R 74 D 76R 57 48 47 43

    2] Average numeric value exclude 0, in A3 enter formula :

    =SUMPRODUCT(--TEXT(MID(TEXT(MID(A1:Q1&"x",1,ROW($2:$16)),),1,ROW($1:$15)),"[<>];-0;0;\0"))/COUNT(INDEX(1/LEFT(A1:Q1),0))

    A3, will return 69.2857

    Regards
    Bosco

  11. #11
    Registered User
    Join Date
    04-04-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    office 365, Excel
    Posts
    10

    Re: I want to average including all cell that may have text with numbers.

    Thank you for your effort as well.

+ 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. Average Values when including a ceiling max of a cell's value
    By Miskondukt in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-22-2016, 03:53 AM
  2. Replies: 7
    Last Post: 08-12-2015, 07:36 PM
  3. Macro to delete all text and characters BUT numbers (including decimals) from excel
    By coolruler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2015, 01:20 AM
  4. problem autofiltering text (numbers) including comma
    By petca059 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2014, 10:04 AM
  5. Replies: 2
    Last Post: 07-02-2013, 10:02 AM
  6. Replies: 3
    Last Post: 04-09-2012, 02:53 PM
  7. Average every Nth cell in a row not including 0
    By RJunior in forum Excel General
    Replies: 4
    Last Post: 10-26-2010, 11:21 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