+ Reply to Thread
Results 1 to 9 of 9

Request for information on how to ignore leading Zeroes in Average Function

  1. #1
    Registered User
    Join Date
    04-04-2017
    Location
    Chicago,IL
    MS-Off Ver
    2013
    Posts
    10

    Talking Request for information on how to ignore leading Zeroes in Average Function

    Hello Excel Champs,

    Need your help with figuring out on how to ignore leading Zeroes in Average Function.

    I have a a list of Row Numbers which have leading Zeroes, I need to ignore Leading Zeroes in my data while using Average Function, your response would be appreciated.

    Thanks for your time,
    Joshi Ram

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Request for information on how to ignore leading Zeroes in Average Function

    If you have leading zeroes showing, then that implies that the values are text values, in which case the AVERAGE function will not be able to evaluate them directly. (It might be that the leading zeroes are put there by formatting, in which case there should be no problem, as formatting does not affect the underlying value). You can use this array* formula to change the text values to numbers:

    =AVERAGE((A1:A10)*1)

    *Note that an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), instead of the usual < Enter >.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    04-04-2017
    Location
    Chicago,IL
    MS-Off Ver
    2013
    Posts
    10

    Re: Request for information on how to ignore leading Zeroes in Average Function

    Dear Pete_Uk,

    The Problem with the data is, the Row Numbers are as follows 0 0 0 0 58 39 53 39

    I want the average to ignore the first four Zeroes(Leading Zeroes in the Data which is not sorted) If you could help me with this, it would be awesome. Thanks for taking time to answer it, I appreciate it.

    Best,
    Joshi Ram

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Request for information on how to ignore leading Zeroes in Average Function

    In that case you can use this normally-entered formula:

    =AVERAGEIF(A1:A10,"<>0")

    Adjust the range to suit.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    04-04-2017
    Location
    Chicago,IL
    MS-Off Ver
    2013
    Posts
    10

    Re: Request for information on how to ignore leading Zeroes in Average Function

    Hey Pete,

    The Data is pretty long with 303 Coloumns and 4000 rows, Zeroes are at the beginning and in between the data. I want to average by row, by ignoring just the Leadning Zeros sorted by Date.

    Please help me with this.

    Thanks,
    Joshi Ram

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Request for information on how to ignore leading Zeroes in Average Function

    So your data goes out to column KQ? You can use this formula in cell KR2:

    =AVERAGEIF(A2:KQ2,"<>0")

    which will give you the average for row 2. Then you can copy that formula down for the other rows.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    04-04-2017
    Location
    Chicago,IL
    MS-Off Ver
    2013
    Posts
    10

    Re: Request for information on how to ignore leading Zeroes in Average Function

    Hey Pete,

    Thanks, but I just wnat to ignore the leading Zeros, not all the zeros in the data. The data is assigned in chronological order and I can't sort it, all I need is to ignore just the leading zeroes in the beginning.

    Thanks again,
    Joshi Ram

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Request for information on how to ignore leading Zeroes in Average Function

    Okay, try this one in KR2:

    =AVERAGE(INDEX(A2:KQ2,MATCH(0.5,A2:KQ2)+1):KQ2)

    then copy down.

    Hope this helps.

    Pete

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,970

    Re: Request for information on how to ignore leading Zeroes in Average Function

    Or,
    =AVERAGE(INDEX($A$2:$KQ$2,1,MATCH(TRUE,INDEX($A$2:$KQ$2<>0,),0)):$KQ$2)
    Ben Van Johnson

+ 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. Add zeroes within dates (NOT leading zeroes)
    By anthony19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 04:08 PM
  2. Leading Zeroes & XML
    By jlhart76 in forum Excel General
    Replies: 4
    Last Post: 06-03-2009, 08:23 PM
  3. Leading Zeroes In Decimals
    By johnph77 in forum Excel General
    Replies: 3
    Last Post: 05-15-2009, 10:04 AM
  4. Keeping Leading Zeroes
    By EmmaG1959 in forum Excel General
    Replies: 2
    Last Post: 04-09-2008, 05:39 AM
  5. How to preserve leading zeroes
    By pbrase in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2005, 02:10 PM
  6. [SOLVED] Leading Zeroes
    By Ken in forum Excel General
    Replies: 1
    Last Post: 10-07-2005, 11:05 AM
  7. [SOLVED] No decimals and leading zeroes
    By gcotterl in forum Excel General
    Replies: 2
    Last Post: 04-18-2005, 02:06 AM

Tags for this Thread

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