+ Reply to Thread
Results 1 to 5 of 5

Finding average of data for certain criteria

  1. #1
    Registered User
    Join Date
    05-19-2017
    Location
    Nottingham, England
    MS-Off Ver
    2013
    Posts
    13

    Finding average of data for certain criteria

    Hello

    I hope someone can help me out. I'm trying to make a report that finds out the average meantimetofix (on data sheet) depending on the month/year and priority.
    I would also like to make the formulas dynamic since the user should be able to add data into the data sheet and the excel to workout the average.

    So the data should only be used if it has a closed date too, if the data doesn't this should not be used to work out the average.

    I have attached a spreadsheet that will make these clear.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,276

    Re: Finding average of data for certain criteria

    Which Month/Year date: opening or closing?

  3. #3
    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,116

    Re: Finding average of data for certain criteria

    Assuming it's opening.. change the headers to Sev - 1 etc and use this, copied across and down:

    =IFERROR(AVERAGEIFS(DATA!$E:$E,DATA!$C:$C,Report!B$2,DATA!$F:$F,"<>"&"",DATA!$B:$B,">="&EOMONTH($A3,-1)+1,DATA!$B:$B,"<="&EOMONTH($A3,0)),"")
    Attached Files Attached Files
    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

  4. #4
    Registered User
    Join Date
    05-19-2017
    Location
    Nottingham, England
    MS-Off Ver
    2013
    Posts
    13

    Re: Finding average of data for certain criteria

    Quote Originally Posted by Glenn Kennedy View Post
    Assuming it's opening.. change the headers to Sev - 1 etc and use this, copied across and down:

    =IFERROR(AVERAGEIFS(DATA!$E:$E,DATA!$C:$C,Report!B$2,DATA!$F:$F,"<>"&"",DATA!$B:$B,">="&EOMONTH($A3,-1)+1,DATA!$B:$B,"<="&EOMONTH($A3,0)),"")
    Hi Glenn

    Thank you so much... Could you explain how the formula works please? Also does this ignore if the data doesn't have a closed date?

    Many thanks

  5. #5
    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,116

    Re: Finding average of data for certain criteria

    It could be made a fair bit simpler if you used a more rational way of collecting the data for column A. The first date is 22/12/2015 (not very convenient as it isn't the 1st of the month) and all the rest are 1 month later.

    However....

    =IFERROR(AVERAGEIFS(DATA!$E:$E,DATA!$C:$C,Report!B$2,DATA!$F:$F,"<>"&"",DATA!$B:$B,">="&EOMONTH($A3,-1)+1,DATA!$B:$B,"<="&EOMONTH($A3,0)),"")

    Red: return the average of these data
    Light Green: when the severity matches B2, AND
    Dark blue: when the closing date is anything other than a blank, AND
    Orange: when the start date is greater than 1st of month of column A (see note below), AND
    Cyan: when the start date is LESS than the end of the month of column A.
    Balck: if you get an error as a result, return a blank.

    Note:

    EOMONTH($A3,-1)+1

    so for 22/11/2015, your first date (formatted to look like "December 2015"...

    return the end of the PREVIOUS month (red) plus 1 day (blue), which will (of course) be 1st November 2015.



    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] Finding an average based on criteria from other cells
    By TnD_Guy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-20-2016, 06:02 PM
  2. [SOLVED] Finding average of cells based on criteria
    By asml8d in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-20-2016, 12:54 PM
  3. [SOLVED] Finding an average of a multiple column range using criteria
    By sadinoel in forum Excel General
    Replies: 7
    Last Post: 07-08-2015, 04:23 PM
  4. [SOLVED] looking up & then finding average based on different criteria
    By VBAhelp3456 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2015, 01:14 AM
  5. Finding average with one criteria or another.
    By buddyhackit9 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2012, 06:15 AM
  6. Finding Average with 2 criteria.
    By Fos605 in forum Excel General
    Replies: 3
    Last Post: 03-10-2009, 01:41 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