+ Reply to Thread
Results 1 to 4 of 4

Average if based on month in date string - Formula not working

  1. #1
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Average if based on month in date string - Formula not working

    Hi all,

    Please see the attached. I can't fathom out why the formulas in N7 to N17 fail to work (Jan to Nov) but N18 (Dec) works.

    Any pointers would be great.

    Thanks
    Attached Files Attached Files
    Last edited by Badvgood; 01-16-2019 at 04:00 PM.

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

    Re: Average if based on month in date string - Formula not working

    You only have data for December and January, but the formula for January has not been entered using Ctrl-Shift-Enter. Put this formula in N7 instead:

    =AVERAGE(IF(MONTH($A$2:$A$394)=ROWS($1:1),$C$2:$C$394))

    Commit it by holding down the Ctrl and Shift keys together, then tapping on Enter. Then you can copy the one formula down (without having to explicitly include the month numbers).

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Re: Average if based on month in date string - Formula not working

    Hi,

    Thanks for the speedy response. I have done this but the averages dont seem to averaging, they are incorrect.

    IE for Jan I would expect 6.9 but I'm getting 3.3.

    Any ideas?

  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,728

    Re: Average if based on month in date string - Formula not working

    That's because the formula is counting 31 days in January. Use this instead:

    =AVERAGE(IF((MONTH($A$2:$A$394)=ROWS($1:1))*($C$2:$C$394<>""),$C$2:$C$394))

    Commit using CSE, then copy down.

    Hope this helps.

    Pete

+ 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] Date Formula - First of Month Not Working ?
    By Logit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2017, 12:13 AM
  2. Replies: 7
    Last Post: 11-29-2016, 07:12 AM
  3. formula to get number of working days in a month based on criteria
    By aravindhan_31 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-15-2016, 06:22 AM
  4. [SOLVED] date formula that puts the first of the prior month based on which month it is
    By cmorten82 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-08-2015, 05:38 PM
  5. [SOLVED] YTD Average Formula based on the Current Month
    By tskabo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2015, 03:37 PM
  6. Formula for average duration for each month based on the ending month
    By bobby769 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-21-2013, 11:18 AM
  7. Replies: 3
    Last Post: 09-25-2007, 10:26 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