+ Reply to Thread
Results 1 to 13 of 13

Need your help averaging based on month & other criteria

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Question Need your help averaging based on month & other criteria

    Hi everyone, I have a workbook with one data sheet and I need to average data based on the month and several other criteria. My columns are set up in the following order: Business Unit (A), Product Area (B), Product Desk (C), Account (D), Date (E) and Values (F). Based on the last reporting month I would like to calculate an average month to date value, e.g. YTD November (Jan-Nov divided by 11).

    I have tried it with SUMIFS(F2:F25,E2:E25,A2:A25,Helper cell for YTD November,D2:D25,Link to other sheet with Account Description) / Helper cell for YTD number

    Is there a way to solve this in a smarter way, perhaps with an array formula (Sumproduct, Average(if, etc.)?
    I have attached file with the raw data and would appreciate any help I could get.

    Thanks!
    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,208

    Re: Need your help averaging based on month & other criteria

    With proper Excel dates in Column E

    in F14

    =SUMIF($E$2:$E$13,"<=" &EOMONTH(E14,0),$F$2:$F$13)/MONTH(E14)

    Copy down
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-09-2013
    Location
    Iran
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Need your help averaging based on month & other criteria

    Hi..........
    Last edited by rahi_feri; 02-13-2017 at 12:16 PM.
    Islam = Peace
    Shia = Peace
    Iran = Peace

  4. #4
    Registered User
    Join Date
    04-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Need your help averaging based on month & other criteria

    John, thanks for your prompt response. This works beautifully, but, in my original data sheet i have several Business units. Is there a way to add the Business Unit as another criteria and use SUMIFS? If so, how would that work in combination with the EOMONTH formula?

    Thank you

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

    Re: Need your help averaging based on month & other criteria

    Try

    =SUMIFS($F:$F,$E:$E,"<=" &EOMONTH(E14,0),$A:$A,business)/MONTH(E14)

    Replace "business" with a cell or TEXT e.g "Business 1"

    NOTE: with SUMIFS, data to be SUMMED is first range whereas with SUMIF it is the last .

  6. #6
    Registered User
    Join Date
    04-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Need your help averaging based on month & other criteria

    It works perfectly with the sample data, however I get a #VALUE error in my live data file. I made sure that I have my dates custome formatted 'mmm'. Strange...

    I should say that my live data file is formatted as a table. Does this make any difference?

  7. #7
    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,208

    Re: Need your help averaging based on month & other criteria

    Table should not make any difference: #VALUE usually means invalid data somewhere which could include that in column F.

    Is it possible to post the file (removing any confidential data like Business names)?
    Last edited by JohnTopley; 02-14-2017 at 06:21 AM.

  8. #8
    Registered User
    Join Date
    04-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Post Re: Need your help averaging based on month & other criteria

    John, I have included the data table, excluding any sensitive data. Sheet1 contains the formula and some explanation where custom formatting has been applied. Can you spot any error?

    Thanks v much!

  9. #9
    Registered User
    Join Date
    04-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Need your help averaging based on month & other criteria

    Apologies, forgot to include the data file. Unfortunately due to data upload restrictions i wasn't able to upload the whole full data file.
    Attached Files Attached Files

  10. #10
    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,208

    Re: Need your help averaging based on month & other criteria

    Now file attached!!!

  11. #11
    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,208

    Re: Need your help averaging based on month & other criteria

    Does not work because the dates are TEXT not Excel dates

    With proper Excel dates in Column E
    as per #2

    Check the sample file I supplied in #2: ALL dates are entered as 01/10/2016 etc and formatted as "mmmm".

    ALWAYS enter dates in dd/mm/yyyy format.

  12. #12
    Registered User
    Join Date
    04-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Need your help averaging based on month & other criteria

    Thanks for your help with this! Fully understood now. http://www.excelforum.com/images/smilies/rolleyes.gif

  13. #13
    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,208

    Re: Need your help averaging based on month & other criteria

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

+ 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] Need help averaging based on certain month and year.
    By phantasm79 in forum Excel Formulas & Functions
    Replies: 34
    Last Post: 01-26-2017, 05:17 PM
  2. VBA calculation based on month criteria
    By robert989 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-30-2016, 09:56 PM
  3. [SOLVED] Averaging Multiple columns based on Weeknum compared to Month
    By zdonner in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-14-2014, 03:43 PM
  4. Rolling sum of 12 months against each month based on two criteria
    By agupta5231 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2013, 12:01 AM
  5. Average Cells Based on Month and Other Criteria
    By kr11 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2013, 11:45 AM
  6. [SOLVED] Excel 2007 : Averaging across rows based on some criteria
    By cde1983 in forum Excel General
    Replies: 5
    Last Post: 05-15-2010, 07:06 AM
  7. averaging a column based on criteria andputting result in new worksheet
    By BadLilBrat in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-20-2007, 03:01 PM

Tags for this Thread

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