+ Reply to Thread
Results 1 to 6 of 6

Getting Avg from nth number of rows

  1. #1
    Registered User
    Join Date
    12-21-2018
    Location
    stuttgart
    MS-Off Ver
    2007
    Posts
    2

    Getting Avg from nth number of rows

    Hello Everyone,
    I have tried so many options but just can't find the answer yet.
    Scenario is as follows...
    values are from A3 to A1082
    i want to get the value from A3, A18 (A3 + 15), A33 (A18+15), A48 (A33 + 15), A63 (A48 + 15).... so on.. till A1082 and calculate the average of it.
    I know the answer can be obvious but i just cannot seem to get the right answer.
    Any help will be highly appreciated.

    Thanks in advance!

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,150

    Re: Getting Avg from nth number of rows

    How about
    =AVERAGE(IF(MOD(ROW($A$3:$A$1082)-3,15)=0,$A$3:$A$1082,0))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,666

    Re: Getting Avg from nth number of rows

    Slight correction in the above ARRAY formula

    =AVERAGE(IF(MOD(ROW($A$3:$A$108)-3,15)=0,$A$3:$A$108,""))
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Registered User
    Join Date
    12-21-2018
    Location
    stuttgart
    MS-Off Ver
    2007
    Posts
    2

    Re: Getting Avg from nth number of rows

    Thank you so much for replying. But the answers are not exactly right.
    The Answer for the first row A3 is right but the rest is not.
    The last row is A1082 and that is fixed but the first row changes from A3, A4, A5.... to A1082 sequentially.
    so the calculation should be average of (A3, A18(A3+15), A33(A18+15)....... in cell J3 as an answer
    A4, A19(A4+15), A34(a19+15).... in cell J4 as an answer
    i hope you are understanding me.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,487

    Re: Getting Avg from nth number of rows

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,666

    Re: Getting Avg from nth number of rows

    ARRAY formula in C3 then drag down.

    =AVERAGE(IF(MOD(ROW($A3:$A$1082)-ROW($A3),15)=0,$A3:$A$1082,""))
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 10-03-2017, 10:54 AM
  2. Replies: 1
    Last Post: 01-17-2013, 10:44 AM
  3. [SOLVED] Define a range of fixed number of columns, but unlimited number of rows
    By ccopac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2012, 02:23 PM
  4. [SOLVED] Excel VBA/Macro - Copy Number of Rows based on the number in a cell to another sheet
    By diane.alexander58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 11:32 AM
  5. number in cell is number to add number of rows wit copy some contex
    By nicollab in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2012, 08:09 AM
  6. Replies: 2
    Last Post: 07-15-2012, 04:05 PM
  7. VBA code to unhide X number of rows based on a number entered into a cell above
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2010, 08:48 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