+ Reply to Thread
Results 1 to 5 of 5

Average if X amount of rows

  1. #1
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    Average if X amount of rows

    HI All,

    I need to do an average if based on one criteria. The tricky part is that i need to do the average for the first 70,80,90&100% of the data set.

    I have worked out how many rows I need to go down for example 235 for 70% 268 for 80% the number of rows they have to go down are in cell E1,E2,E3&E4. the numbers I want to average are in cell A1:A50 the criteria range is in cell B1:B50 and the criteria is in cell E5

    I just need the formula to take these into consideration.

    Any Ideas

  2. #2
    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: Average if X amount of rows

    It's a bit hard to visualise. Can you pst a sample Excel sheet?
    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

  3. #3
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    Re: Average if X amount of rows

    Hi Glenn,

    Please find an example attached.

    In col A is the data I want to average

    in cells B is the criteria column
    In Col E are the % of the total we want to average
    in F is the number of data points we want to average
    In Col G this is where I need the average
    Currently there not in order if we could have a formula which takes that into consideration that would be amazing if not I can sort these from lowest to highest
    I hope this explains it a bit better. Please let me know if you need anything else,
    Thanks
    Attached Files Attached Files

  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: Average if X amount of rows

    There are probably lots of ways to do this. Here's one, using an Array Formula, which must be 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. Press F2 on that cell and try again.

    You can delete the intermediate steps in G & H. I've just left them in for now, in case I have to modify things.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-28-2014
    Location
    Brno
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Average if X amount of rows

    Another way to go:

    =AVERAGEIF(OFFSET($B$2,0,0,SMALL(IF($B$2:$B$50=$D$1,ROW($B$2:$B$50)),$F2)-1,1),$D$1,$A$2:$A$50)

    Still array formula, so needs to be confirmed with CTRL+SHIFT+ENTER.
    Last edited by pepe74287; 04-01-2015 at 09:51 AM.

+ 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 amount between a date range
    By RachaelE in forum Excel General
    Replies: 5
    Last Post: 03-20-2015, 06:19 AM
  2. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM
  3. Average last 14 numbers from changing amount of cells
    By fallon225 in forum Excel General
    Replies: 6
    Last Post: 07-14-2010, 08:21 PM
  4. average of an amount in pivot tables
    By mordak in forum Excel General
    Replies: 1
    Last Post: 12-14-2008, 01:49 PM
  5. how to average a varying amount ou numbers
    By cuewoz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2006, 09:55 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