+ Reply to Thread
Results 1 to 6 of 6

SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

  1. #1
    Registered User
    Join Date
    05-24-2019
    Location
    London
    MS-Off Ver
    Microsoft Office Professional Plus 2016 | for Office 365 MSO | 32-bit
    Posts
    23

    SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

    Hi guys

    I hope you are doing great

    I would like to do a revenue projection in a chart based on date (day of the month) and revenue:

    I need a formula to calculate the average revenue of each day of the month for the past 12 months (sheet 2) and then project on a chart what I should achieve.

    For exemple, the first day of this month should be above $1,637.81

    I can't change Sheet 2 as it's automatically generated by a script every day. So even if I change it today it will get overwritten the day after...

    I'm sure there is an easy formula to take DD in sheet 1 column A in YYYY-MM-DD from sheet 2

    Could you help me, please?
    Attached Files Attached Files

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

    First of all, add numbers in Sheet1 column A, and apply custom format DD to have actual numbers.
    Here are 2 formulas, see if these work:
    =SUMPRODUCT((DAY(Sheet2!$A$2:$A$401)=$A2)*Sheet2!$B$2:$B$401)/12
    =AVERAGE(IF(DAY(Sheet2!$A$2:$A$401)=$A2,Sheet2!$B$2:$B$401))
    The second one is array, so you need Ctrl+Shift+Enter to make it work
    Click the * to say thanks.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

    Your day numbers in column A are actually text values, rather than numbers. Just fill the column with the numbers from 1 to 31 then apply a custom format to the cells of:

    00

    to display them in the same way with leading zeros.

    Hope this helps.

    Pete

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

    It is misleading if you just divide by 12, as your dates in Sheet2 go from June to July of different years. Hence you have some days which occur 13 times in your data and some which occur 14 times. Also, as some months only have 30 days, there are only 8 entries which have 31 as the day number. You can see this if you put this formula in D2 of Sheet1:

    =SUMPRODUCT(--(DAY(Sheet2!$A$2:$A$401)=A2))

    For a more exact average of your data, you should use this formula in cell B2:

    =SUMPRODUCT(--(DAY(Sheet2!$A$2:$A$401)=A2),Sheet2!$B$2:$B$401)/SUMPRODUCT(--(DAY(Sheet2!$A$2:$A$401)=A2))

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    05-24-2019
    Location
    London
    MS-Off Ver
    Microsoft Office Professional Plus 2016 | for Office 365 MSO | 32-bit
    Posts
    23

    Re: SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

    Thank you so very much, Pete, it does work!! You are my hero :D
    Thank you a lot Paul as well

  6. #6
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,727

    Re: SUMIFS()/12 or AVERAGEIFS() formula by DD from YYYY-MM-DD

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

+ 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. SUMIFS and AVERAGEIFS using multiple criteria help
    By Thunderclap911 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-19-2018, 04:17 PM
  2. [SOLVED] SUMIFS statement according to mm/dd/yyyy
    By kevinSHR in forum Excel General
    Replies: 0
    Last Post: 05-11-2016, 01:36 PM
  3. [SOLVED] SUMIFS/AVERAGEIFS across multiple columns
    By keith740 in forum Excel General
    Replies: 30
    Last Post: 06-25-2015, 01:25 PM
  4. [SOLVED] Sumifs or Averageifs
    By ntate in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-05-2014, 07:45 PM
  5. [SOLVED] Need date formula to convert mm-dd-yyyy or mm/dd/yyyy to dd-mm-yyyy in 1 formula
    By ChristopherH in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-29-2014, 09:07 AM
  6. [SOLVED] AverageIFs / SumIfs
    By Decar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2013, 02:59 PM
  7. Index with sumifs and averageifs
    By LUNARCEA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2013, 11:59 AM

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