+ Reply to Thread
Results 1 to 6 of 6

Formula to provide an average of the last 15 rows based upon multiple conditions

  1. #1
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Formula to provide an average of the last 15 rows based upon multiple conditions

    I am trying to create a formula that giving me the average of the last 15 or 20 rows in a spreadsheet based upon multiple conditions.

    The formula below works however it is not based upon any conditions.
    =AVERAGE(OFFSET(E$7,COUNT(E7:E129)+1-S133,0,S$133))

    S133 is the cell that will determine how many rows (last rows), so if I wanted the average of the last 15 rows I would input 15 in cell S133.

    I tried the below averageifs formula where it should look for "GIS Take-UP" in rows $D$6:$D$129 and then give an average of the last 15 rows ( or whatever value is input in S133) where the "GIS Take-Up" is present however the below formula does not work.

    =AVERAGEIFS(OFFSET(E$7,COUNT(E7:E129)+1-S133,0,S$133),$D$6:$D$129,"GIS Take-Up")

    Can anybody help me solve this problem it would be very much appreciated.

    Thanking everyone in advance for all your help.

    K

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: Formula to provide an average of the last 15 rows based upon multiple conditions

    The ranges need to be the same size, and you should not add 1 to the row offset count:

    =AVERAGEIFS((OFFSET(E$7,COUNT(E7:E129)-S$133,0,S$133)),(OFFSET(D$7,COUNT(E7:E129)-S$133,0,S$133)),"GIS Take-Up")
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Re: Formula to provide an average of the last 15 rows based upon multiple conditions

    Thank you very much for your quick response however it does the provide the answer that I am expecting. For an example there are two columns D which equals: GIS New Business, GIS Renewal or GIS Take-Up, Column E will be the Percentages.
    Row Column D Column E
    1 GIS Renewal 100%
    2 GIS Renewal 0%
    3 GIS Take Up 100 %
    4 GIS Take Up 100 %
    5 GIS Take Up 0 %
    6 GIS Renewal 100 %
    7 GIS Take Up 100 %
    8 GIS Take Up 100 %
    9 GIS Renewal 100 %
    10 GIS Renewal 0%

    Now I would like to have the averages of the last three rows for GIS Take Up (this would be in Cell G: 5 ( Averageifs formula targeting GIS Take Up condition)
    and I would like to have the averages of the last three rows for GIS Renewal in Cell G: 6 (Averageifs formula targeting GIS Renewal condition)

    I would expect that average last three GIS Take Up to be 67% however the formulas gives me a result of 100%
    I would expect that average last three GIS Renewal to be 67% however the formulas gives me a result of 100%

    Am I even using the right formula for what I want to achieve? If not can you please provide me with an alternative suggest?

    Thank you again for all your help, I have spent three days trying to finger this out and at my wits end.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: Formula to provide an average of the last 15 rows based upon multiple conditions

    That is a different problem - I thought you wanted the last 15 values to be analyzed, not the last 15 of a specific value.

    Try this formula, entered using Ctrl-Shift-Enter instead of just Enter:


    =SUMPRODUCT(E7:E129*(D7:D129="GIS Take-Up")*(ROW(D7:D129)>=LARGE(IF(D7:D129="GIS Take-Up",ROW(D7:D129)),S$133)))/S$133

  5. #5
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Re: Formula to provide an average of the last 15 rows based upon multiple conditions

    OMG Thank you so so much it works!!! You are amazing

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: Formula to provide an average of the last 15 rows based upon multiple conditions

    Great - glad to hear my formula worked for you

+ 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. Formula to average all Cells that meet multiple conditions
    By ajw089 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-23-2014, 05:24 PM
  2. Replies: 3
    Last Post: 06-16-2014, 03:13 PM
  3. identifying rows to delete based on multiple conditions
    By DannyGIS in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-09-2014, 06:29 PM
  4. [SOLVED] Average results based on multiple conditions and by month
    By Tanya_ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-14-2013, 06:41 PM
  5. [SOLVED] Quite Complex Average based on multiple conditions
    By ryanmanc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-22-2013, 05:59 AM
  6. Average based on multiple conditions
    By kostas in forum Excel General
    Replies: 1
    Last Post: 03-27-2010, 07:00 PM
  7. Replies: 1
    Last Post: 03-12-2009, 06:33 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