+ Reply to Thread
Results 1 to 8 of 8

I need a formula to average the first 10 non zero values in a column

  1. #1
    Registered User
    Join Date
    12-10-2023
    Location
    Louisiana, USA
    MS-Off Ver
    Office 365
    Posts
    8

    I need a formula to average the first 10 non zero values in a column

    I need a formula to average the first 10 non zero values in a column while being able to insert lines to enter new data. I have found some arrays that do what I want but every time I add data I have to press Ctrl+Shift+Enter. This works well but is not user friendly when adding new data. Any suggestions would be greatly appreciated.

    =AVERAGE(IF(ISNUMBER(A1:A36),IF(ROW(A1:A36)<=SMALL(IF(ISNUMBER(A1:A36),ROW(A1:A36)),10),A1:A36)))

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

    Re: I need a formula to average the first 10 non zero values in a column

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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
    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,869

    Re: I need a formula to average the first 10 non zero values in a column

    Try:

    =AVERAGE(TAKE(FILTER(A:A,A:A<>0),10))
    Attached Files Attached Files
    Last edited by AliGW; 12-10-2023 at 10:19 AM. Reason: Typo fixed & workbook attached.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: I need a formula to average the first 10 non zero values in a column

    It is not a good idea to use FILTER with whole columns. It calculates all 1,000,000 rows... twice, and can cause performance issues. It's better to use a sensible, future-proof range and use something like this:

    =AVERAGE(TAKE(TOCOL(A1:A100,1),10))

    Adjust the 100 to whatever is sensible and meets your needs.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    12-10-2023
    Location
    Louisiana, USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: I need a formula to average the first 10 non zero values in a column

    Perfect!! Thank you for your quick response

  6. #6
    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,869

    Re: I need a formula to average the first 10 non zero values in a column

    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.

  7. #7
    Registered User
    Join Date
    12-10-2023
    Location
    Louisiana, USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: I need a formula to average the first 10 non zero values in a column

    Thanks This works equally as well and will take your advice to avoid future problems!!

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: I need a formula to average the first 10 non zero values in a column

    You're welcome. Thanks for letting us know that you got an answer.




    Please take a moment and consider clicking the "Add Reputation" button at the foot of any of the posts of anyone who helped you reach a solution here today.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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 in a column based on values of other columns
    By will.sf in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-29-2022, 11:16 AM
  2. Unique values from array then average adjacent column values
    By tomisthereason in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-24-2021, 09:12 AM
  3. [SOLVED] Getting average of values in a column leaving out values in some cells
    By Anuru in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2015, 07:07 AM
  4. Replies: 4
    Last Post: 11-19-2014, 10:13 PM
  5. [SOLVED] If values in a column are equal, then need to calc average of values in other columns
    By engineerlady in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2013, 02:33 PM
  6. Average range of cells in column if values in adjacent column are equal
    By RyNye in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2012, 10:12 AM
  7. Replies: 8
    Last Post: 02-16-2011, 05:03 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